mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fixed merge conflicts
This commit is contained in:
commit
480f0d85f0
15 changed files with 474 additions and 230 deletions
|
|
@ -287,13 +287,21 @@ public class WebSocketBot : ChatBot
|
|||
|
||||
[TomlInlineComment("$ChatBot.WebSocketBot.DebugMode$")]
|
||||
public bool DebugMode = false;
|
||||
|
||||
[TomlInlineComment("$ChatBot.WebSocketBot.AllowIpAlias$")]
|
||||
public bool AllowIpAlias = false;
|
||||
}
|
||||
|
||||
public WebSocketBot()
|
||||
{
|
||||
_password = Config.Password;
|
||||
_authenticatedSessions = new();
|
||||
_waitingEvents = new();
|
||||
|
||||
var match = Regex.Match(Config.Ip!, @"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}");
|
||||
|
||||
if (!match.Success)
|
||||
// If AllowIpAlias is set to true in the config, then always ignore this check
|
||||
if (!match.Success & !Config.AllowIpAlias!)
|
||||
{
|
||||
LogToConsole(Translations.bot_WebSocketBot_failed_to_start_ip);
|
||||
return;
|
||||
|
|
@ -307,9 +315,6 @@ public class WebSocketBot : ChatBot
|
|||
|
||||
_ip = Config.Ip;
|
||||
_port = Config.Port;
|
||||
_password = Config.Password;
|
||||
_authenticatedSessions = new();
|
||||
_waitingEvents = new();
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
|
|
@ -420,6 +425,9 @@ public class WebSocketBot : ChatBot
|
|||
_authenticatedSessions.Add(newId);
|
||||
}
|
||||
|
||||
// Update the responder to the new session id
|
||||
responder = new WsCommandResponder(this, newId, cmd.Command, cmd.RequestId);
|
||||
|
||||
responder.SendSuccessResponse(
|
||||
responder.Quote("The session ID was successfully changed to: '" + newId + "'"), true);
|
||||
LogToConsole(string.Format(Translations.bot_WebSocketBot_session_id_changed, sessionId, newId));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue