WSClient-Sync ——可跨主机的群组服基础插件(暂停维护)

LSE WSClient-Sync ——可跨主机的群组服基础插件(暂停维护) 1.6.40

请登录后获取
All functions of this plug-in can be switched on and off separately

[MD] # ▶️ WSClient-Sync 1.6.32 tutorial after update ***Ask and answer questions in the QQ question group (click the icon below to add a group)*** ***Join QQ groups to experience new versions and bug fixes first*** <a target="_blank" href="[URL]https://qm.qq.com/cgi-bin/qm/qr?k=mNKF6IJNZGdYtLXfoo0Ze-Lmxvf_B43A&jump_from=webapi[/URL]"><img border="1" src="[URL]https://q4.qlogo.cn/g?b=qq&nk=1803422592&s=140[/URL]" alt="WSClient-Sync插件反馈交" title="WSClient-Sync插件反馈交流"></a> ***Most of this document uses translation software to convert Chinese into English. If there is anything difficult to understand, please understand and feed back to the author. I will try my best to make this plugin easier to use*** --- ## 📌 Pre knowledge - This plugin is divided into two parts, one is WSClient-Sync (JS plugin, referred to as client for short), and the other is WebSockets_ Server (EXE program, referred to as server or WSS for short) --- ## 🔮 WSClient-Sync usage method: 1. From the [WSClient-Sync release page](https://www.minebbs.com/resources/wsclient-sync.3334/) download WSClient-Sync-pack.zip and unzip it 2. Copy WSClient-Sync.js to the plugins directory of BDS 3. Start the server, wait for WSClient-Sync to output the warn prompt, and then shut down the BDS 4. Enter the BDS / plugins / WSClient-Sync directory, open config.json and modify it according to your situation. Restart the server after saving 5. If the server outputs "Connected WebSockets_Server", Congratulations, the plugin is connected to the server, and you can enter the game to enjoy the fun of plugins ### 📄 Client Configuration ```json { "Synchronization_options": { "Welcomemessage": true,//Whether to enable welcome message "Syncmessage": true,//Whether to enable cross server messages "Syncinventory": true,//Whether to enable cross server backpack "Syncllmoney": true, // whether to enable cross server LLMoney "Syncscoreboard": true,//Whether to enable cross server scoreboard "Synctags": true,//Whether to enable cross server tag "Syncenderchest": true,//Whether to enable cross server ender chest "Synclevel": true,//Whether to enable cross server experience "Synceffects": true//Whether to enable cross server potion effects }, "Ws_connection_options": { "Wss_ip": "127.0.0.1",//WSS IP "Wss_port": 9001,//WSS port "Passwd": "WSClient_Sync",//WSS password "HookFunction": false//Allow the plug-in to save the player's backpack at the same time as BDS }, "Ws_client_options": { "Servername": "Myserver",//The name of this server "Detectconnectionsec": 15,//Websockets disconnection detection interval, unit: seconds "Saveplayernbttimingmin": 5,//Automatically save player NBT information interval, unit: minutes "Consoleloggerlevel": 4,//Server console log output level, see the detailed explanation of output level below "Fileloggerlevel": 0//Log file record level, see the detailed explanation of output level below }, "inGameText": {//Send messages in the game when an event occurs "PlayerJoinText": "${Format.MinecoinGold}[+] ${Format.Aqua}${Message.playerRealName}${Format.MinecoinGold} joined server ${parseName(msg)}",//Player connected the server "PlayerLeftText": "${Format.MinecoinGold}[-] ${Format.Aqua}${Message.playerRealName}${Format.MinecoinGold} left server ${parseName(msg)}",//Player left the server "SyncMessage": "[${Format.Aqua}${parseName(msg)}${Format.Clear}] ${Message.playerRealName} >> ${Message.message}",//Cross server chat "ServerOffLineText": "",//Server offline "ServerOnLineText": "",//Server online "SavePlayerNBTText": "",//Save player data "ReadPlayerNBTText": ""//Apply player data }, "inConsoleText": {//Output a message on the console when an event occurs "PlayerJoinText": "Player ${Message.playerRealName} joined server ${parseName(msg)}",//Player connected the server "PlayerLeftText": "Player ${Message.playerRealName} left server ${parseName(msg)}",//Player left the server "SyncMessage": "[${parseName(msg)}] ${Message.playerRealName} >> ${Message.message}",//Cross server chat "ServerOffLineText": "",//Server offline "ServerOnLineText": ""//Server online } } ``` | Log Output Level | Log Severity | Log Description | | :---: | :---: | :---: | | 0 | Slient | No log output | | 1 | Fatal | Only critical error messages | | 2 | Error | Only critical error messages | | 3 | Warn | Output arnings, errors, critical errors | | 4 | Info | Output everythng except debug info | | 5 | Debug | Output everything | --- ## 🔗 WebSockets_ Server usage method: 1. From the [WSClient-Sync release page](https://www.minebbs.com/resources/wsclient-sync.3334/) download WSClient-Sync-pack.zip and unzip it 2. Copy WebSockets_Server.exe and config.json to the same directory you choose 3. Open config.json, modify it according to your own situation and save it 4. Double click WebSockets_Server running server program 5. If the prompt of listening port appears on your WSS console, Congratulations, the server program is completed ### 📄 Server Configuration ```json { "Port": 9001,//Port number.Note that it cannot occupy the same port with other applications "Passwd": "WSClient_Sync",//Password.Even if the IP and port of the WSS are exposed, as long as the password is not exposed, other people cannot maliciously access your WSS and rely on synchronous illegal acquisition of items "Showmessageonreceive": false//Whether to display the messages sent by the client on the WSS console } ``` --- ## 💻 Console commands The root command is wscsync. When using it, enter the root command plus secondary commands on the console, such as "wscsync list" The following is a list of secondary commands 1. list "list the player data stored in the local kvdb database of this server" 2. delete <playerName> "delete the corresponding player data stored in the local kvdb database of this server, for example: wscsync delete xialiag" 3. packdb <playerName> "package the data of the specified player stored in the local kvdb database of this server into JSON format, for example: wscsync packdb xialiag (the packaged JSON file will be stored in the BDS directory/plugins/WSClient-Sync)" --- ## ❔ Common problems & Matters needing attention - "serverName" try not to use strings with "::" or "#". The plugin depends on the position and segmentation of these two characters to determine the message type, message sender and message body. If these two characters are used,**the plugin may not work** -**The "serverName" of the client cannot be the same**. If the client has the same name, the server will refuse the request of the client to set the name, which has no impact on the cross server synchronization function. However, the cross server message and the message source when the player enters and leaves the server will display UNNAMED - After the update of WSClient-Sync1.6.32, instead of using JSON to store player backpack data, it uses kvdb database to store it. The stored player backpack data cannot be deleted directly as before, so the client registered a console command to operate player backpack data. The usage is: wscsync list - list all player backpack data (only list local player data recorded by the plug-in), Wscsync delete player name - delete player data (only delete local player data recorded by the plug-in) - When the player has backpack data, but the plug-in does not save its data, the player should first enter the server that wants to save the backpack data, ensure that the plug-in saves the player's backpack data, and then let the player enter other servers to prevent**the player's backpack data from being overwritten by the empty white backpack data of the new server** - This plugin**is not compatible with plugins that modify synchronized content**. For example, if you modify llmoney offline (mainly depending on whether other plugins modify player data at the same time), you can close the conflicting configuration terms in the configuration file - JSON file**do not open it with Notepad provided by windows**. Notepad will change the file encoding format to BOM UTF-8, which will make the plugin unable to read it. It is recommended to edit the file with visual studio code. If the configuration file has been opened with Notepad, please delete the configuration file and run BDS, and then modify and start BDS again after regenerating the configuration file - Addon items can be synchronized, but**each server**needs to load this addon, otherwise the synchronized items cannot be written to player NBT - If synchronization failed,please**check whether LiteLoader is updated** - There is no limit on the maximum number of servers in this plugin - The server and client can be the same host, and the client can also be the same host - Distributed storage, high fault tolerance, player data is subject to the**latest records of plugins between servers** --- # ➕ Update log - 2022.7.27 client-v1.6.33 server-v1.6.29 > Client-v1.6.33 1. add console secondary command: packdb > Server-v1.6.29 1. repair the Chinese output garbled code 2. Repair the active disconnection of the server when the client sends too much data - 2022.7.29 client-v1.6.34 > Client-v1.6.34 1. Fix the false coverage of the backpack caused by players' wrong exit from the game (such as the game process is killed by the system) when they cross server - 2022.8.26 client-v1.6.40 server-v1.6.34 >Client-v1.6.39 1. Fix the problem that auto save fails 2. Add custom notification messages (customizable console messages and in-game messages) 3. Fix the problem that players cannot enter the server when auto save is too fast 4. Add WSS exception handling (servername setting fails to automatically use GUID) 5. Perform exception handling when players are not monitored to exit >Server-v1.6.34 1. Optimize code logic 2. Adjust the timeout duration to 1200 --- [/MD]
后退
顶部 底部