Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新:改为string[] #595

Merged
merged 2 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Lagrange.XocMat.Adapter/Net/WebSocketReceive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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++;
Expand Down
4 changes: 2 additions & 2 deletions src/Lagrange.XocMat.Adapter/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<TSPlayer> ServerPlayers = new();

Expand Down Expand Up @@ -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));
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/Lagrange.XocMat.Adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@

- [Lagrange.XocMat](https://github.com/UnrealMultiple/XocMat)

## 更新日志

```
v1.0.0.1
阻止语句改string[]
```
## 指令

```
Expand All @@ -21,7 +26,7 @@
```json
{
"阻止未注册进入": true,
"阻止语句": "未注禁止进入服务器!",
"阻止语句": ["未注禁止进入服务器!"],
"Socket": {
"套字节地址": "127.0.0.1",
"服务器名称": "玄荒", // 名称要求相同
Expand Down
2 changes: 1 addition & 1 deletion src/Lagrange.XocMat.Adapter/Setting/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading