Skip to content

Commit

Permalink
Update to LL&LL.NET latest
Browse files Browse the repository at this point in the history
  • Loading branch information
FantasyTownServer committed Feb 24, 2023
1 parent 03662dc commit f0dd3d6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Allowlist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public bool Delete(string Player)
List<AllowlistFile>? list = JsonConvert.DeserializeObject<List<AllowlistFile>>(Read());
int n = 0;
if (list == null || list.Count == 0)
logger.error.WriteLine("白名单为空,无法删除!");
logger.Error.WriteLine("白名单为空,无法删除!");
else
{
foreach (var item in list)
Expand Down
8 changes: 4 additions & 4 deletions Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public void ServerStrated(Version version)
//服务器开启后执行的
ServerStartedEvent.Subscribe(e =>
{
logger.info.WriteLine("FantasyTownAllowlist is loaded!");
logger.info.WriteLine("FantasyTownAllowlist已加载!");
logger.info.WriteLine("Plugin version: " + version.ToString());
logger.info.WriteLine("插件版本:" + version.ToString());
logger.Info.WriteLine("FantasyTownAllowlist is loaded!");
logger.Info.WriteLine("FantasyTownAllowlist已加载!");
logger.Info.WriteLine("Plugin version: " + version.ToString());
logger.Info.WriteLine("插件版本:" + version.ToString());
if (File.Exists(OldFile) == false && File.Exists(FilePath) == false)
{
logger.Info.WriteLine("检测到白名单文件不存在,正在创建……");
Expand Down
6 changes: 5 additions & 1 deletion FantasyTownAllowlist.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@
<DebugType>embedded</DebugType>
</PropertyGroup>

<ItemGroup>
<None Remove=".gitignore" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

<ItemGroup>
<Reference Include="LiteLoader.NET">
<HintPath>..\LiteLoader\LiteLoader.NET.dll</HintPath>
<HintPath>..\.lib\SDK-dotnet\LiteLoader\LiteLoader.NET.dll</HintPath>
</Reference>
</ItemGroup>

Expand Down
20 changes: 10 additions & 10 deletions RegCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ internal class RegCommand
Allowlist allowlistMgr = new();
public void CommandRegisiter()
{
logger.info.WriteLine("Registering Commands...");
logger.info.WriteLine("正在注册命令……");
logger.Info.WriteLine("Registering Commands...");
logger.Info.WriteLine("正在注册命令……");
var AllowlistOperate = cmd.SetEnum("Operate Allowlist", new() { "add", "remove" }); //增删操作指令枚举
var Allowlister = cmd.SetEnum("List the player in the Allowlist", new() { "list" }); //列出白名单指令枚举
//设置指令参数
Expand Down Expand Up @@ -85,8 +85,8 @@ public void CommandRegisiter()
else pln += $", {item.Name}";
}
}
logger.info.WriteLine("There are players in allowlist:");
logger.info.WriteLine(pln);
logger.Info.WriteLine("There are players in allowlist:");
logger.Info.WriteLine(pln);
}
break;
default:
Expand All @@ -95,17 +95,17 @@ public void CommandRegisiter()
}
catch (Exception e)
{
logger.error.WriteLine(e.Message);
logger.error.WriteLine(e.Source);
logger.error.WriteLine(e.StackTrace);
logger.Error.WriteLine(e.Message);
logger.Error.WriteLine(e.Source);
logger.Error.WriteLine(e.StackTrace);
throw;
}
}
else logger.error.WriteLine("results is null or empty!");
else logger.Error.WriteLine("results is null or empty!");
});
Setup(cmd);
logger.info.WriteLine("Commands Registered!");
logger.info.WriteLine("命令注册成功!");
logger.Info.WriteLine("Commands Registered!");
logger.Info.WriteLine("命令注册成功!");
}
}
}

0 comments on commit f0dd3d6

Please sign in to comment.