diff --git a/src/Lagrange.XocMat.Adapter/Net/WebSocketReceive.cs b/src/Lagrange.XocMat.Adapter/Net/WebSocketReceive.cs index ee253e96e..72e458c3c 100644 --- a/src/Lagrange.XocMat.Adapter/Net/WebSocketReceive.cs +++ b/src/Lagrange.XocMat.Adapter/Net/WebSocketReceive.cs @@ -45,7 +45,7 @@ public static void Start(string Host, int Port) try { ClientWebSocket = new(); - ClientWebSocket.ConnectAsync(new Uri($"ws://{Host}:{Port}/momo?name={Plugin.Config.SocketConfig.ServerName}"), CancellationToken.None).Wait(); + ClientWebSocket.ConnectAsync(new Uri($"ws://{Host}:{Port}/"), CancellationToken.None).Wait(); OnConnect?.Invoke(); while (true) { @@ -68,7 +68,7 @@ public static void Start(string Host, int Port) catch { ClientWebSocket.Dispose(); - TShock.Log.ConsoleError($"[Lagrange.XocMat.Adapter]({count}) 未连接至MorMor机器人,正在进行连接.."); + TShock.Log.ConsoleError($"[Lagrange.XocMat.Adapter]({count}) 未连接至XocMat机器人,正在进行连接.."); } count++; diff --git a/src/Lagrange.XocMat.Adapter/Plugin.cs b/src/Lagrange.XocMat.Adapter/Plugin.cs index fae40c8aa..9b6334013 100644 --- a/src/Lagrange.XocMat.Adapter/Plugin.cs +++ b/src/Lagrange.XocMat.Adapter/Plugin.cs @@ -28,7 +28,7 @@ public class Plugin : TerrariaPlugin public override string Name => "机器人适配插件"; - public override Version Version => new(1, 0, 0, 0); + public override Version Version => new(1, 0, 0, 1); internal static readonly List ServerPlayers = new(); @@ -320,7 +320,7 @@ private void OnJoin(JoinEventArgs args) { if (Config.LimitJoin && TShock.UserAccounts.GetUserAccountByName(player.Name) == null) { - player.Disconnect(Config.DisConnentFormat); + player.Disconnect(string.Join("\n", Config.DisConnentFormat)); } } } diff --git a/src/Lagrange.XocMat.Adapter/README.md b/src/Lagrange.XocMat.Adapter/README.md index 21a513d94..58680ee3d 100644 --- a/src/Lagrange.XocMat.Adapter/README.md +++ b/src/Lagrange.XocMat.Adapter/README.md @@ -7,7 +7,12 @@ - [Lagrange.XocMat](https://github.com/UnrealMultiple/XocMat) +## 更新日志 +``` +v1.0.0.1 +阻止语句改string[] +``` ## 指令 ``` @@ -21,7 +26,7 @@ ```json { "阻止未注册进入": true, - "阻止语句": "未注禁止进入服务器!", + "阻止语句": ["未注禁止进入服务器!"], "Socket": { "套字节地址": "127.0.0.1", "服务器名称": "玄荒", // 名称要求相同 diff --git a/src/Lagrange.XocMat.Adapter/Setting/Config.cs b/src/Lagrange.XocMat.Adapter/Setting/Config.cs index da4582ba8..08d6c58c0 100644 --- a/src/Lagrange.XocMat.Adapter/Setting/Config.cs +++ b/src/Lagrange.XocMat.Adapter/Setting/Config.cs @@ -10,7 +10,7 @@ public class Config public bool LimitJoin { get; set; } [JsonProperty("阻止语句")] - public string DisConnentFormat { get; set; } = "未注禁止进入服务器!"; + public string[] DisConnentFormat { get; set; } = { "未注禁止进入服务器!" }; [JsonProperty("Socket")] public SocketConfig SocketConfig { get; set; } = new();