diff --git a/MinecraftClient/config/ChatBots/WebSocketBot.cs b/MinecraftClient/config/ChatBots/WebSocketBot.cs index a1111b77..875daa58 100644 --- a/MinecraftClient/config/ChatBots/WebSocketBot.cs +++ b/MinecraftClient/config/ChatBots/WebSocketBot.cs @@ -18,7 +18,8 @@ //using MinecraftClient.Scripting //using MinecraftClient -MCC.LoadBot(new WebSocketBot("127.0.0.1", 8043, "wspass12345")); +// IMPORTANT: Change the password below before use! +MCC.LoadBot(new WebSocketBot("127.0.0.1", 8043, "CHANGE_THIS_PASSWORD")); //MCCScript Extensions @@ -207,7 +208,7 @@ public class WebSocketBot : ChatBot private bool _gameJoined; private static readonly Regex Ipv4Regex = new( - @"^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$", + @"^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.){3}(25[0-5]|(2[0-4]|1\d|[1-9]|)\d)$", RegexOptions.Compiled); public WebSocketBot(string ip, int port, string password, bool debugMode = false) diff --git a/docs/guide/websocket/Commands.md b/docs/guide/websocket/Commands.md index 8fe8232b..d3ca44f7 100644 --- a/docs/guide/websocket/Commands.md +++ b/docs/guide/websocket/Commands.md @@ -31,7 +31,7 @@ Must be called before any other command (except `ChangeSessionId`). { "command": "Authenticate", "requestId": "auth-001", - "parameters": ["wspass12345"] + "parameters": ["your-password-here"] } ``` @@ -514,7 +514,7 @@ No parameters. ## Mapping Commands (New) -These commands address [issue #2805](https://github.com/MCCTeam/Minecraft-Console-Client/issues/2805), allowing clients to query enum mappings dynamically instead of maintaining hardcoded ID tables. +These commands let clients query enum mappings dynamically at runtime, so they do not need to maintain hardcoded numeric ID tables that break across MCC versions. For background, see [issue #2805](https://github.com/MCCTeam/Minecraft-Console-Client/issues/2805). ### `GetItemTypeMappings` diff --git a/docs/guide/websocket/README.md b/docs/guide/websocket/README.md index 45c45f1b..ee5000f3 100644 --- a/docs/guide/websocket/README.md +++ b/docs/guide/websocket/README.md @@ -13,11 +13,11 @@ You load it as a standalone script with `/script ChatBots/WebSocketBot.cs`. 1. Copy `config/ChatBots/WebSocketBot.cs` into your MCC `config/ChatBots/` folder (it ships in the repo under that path). 2. Open the file and edit the line near the top: ```csharp - MCC.LoadBot(new WebSocketBot("127.0.0.1", 8043, "wspass12345")); + MCC.LoadBot(new WebSocketBot("127.0.0.1", 8043, "CHANGE_THIS_PASSWORD")); ``` - Replace `127.0.0.1` with the IP to bind (use `+` or `*` for all interfaces). - Replace `8043` with your preferred port. - - Replace `wspass12345` with a strong password. + - Replace `CHANGE_THIS_PASSWORD` with a strong, unique password. 3. Optionally enable debug logging: ```csharp MCC.LoadBot(new WebSocketBot("127.0.0.1", 8043, "mypassword", debugMode: true));