mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Address code review feedback: fix password placeholder, IPv4 regex, and doc references
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/c762752f-46be-44f6-a05d-8c5effc8ef43
This commit is contained in:
parent
6d6d1105eb
commit
d5a9ae3deb
3 changed files with 7 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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`
|
||||
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue