diff --git a/Library/Main.cs b/Library/Main.cs index d9efe41..0f6b26f 100644 --- a/Library/Main.cs +++ b/Library/Main.cs @@ -4,6 +4,10 @@ using Oshima.FunGame.WebAPI.Controllers; using Oshima.FunGame.OshimaModules; using Oshima.FunGame.OshimaServers.Service; +_ = new Milimoe.FunGame.Testing.Tests.CheckDLL(); + +Console.WriteLine(); + _ = new Milimoe.FunGame.Testing.Tests.WebSocketTest(); CharacterModule cm = new(); diff --git a/Library/Tests/CheckDLL.cs b/Library/Tests/CheckDLL.cs index 94cf406..c0b8fbb 100644 --- a/Library/Tests/CheckDLL.cs +++ b/Library/Tests/CheckDLL.cs @@ -16,11 +16,11 @@ namespace Milimoe.FunGame.Testing.Tests Console.WriteLine(plugin + " is loaded."); } - Dictionary plugindllsha512 = []; + Dictionary plugindllsha256 = []; foreach (string pfp in PluginLoader.PluginFilePaths.Keys) { - string text = Encryption.FileSha512(PluginLoader.PluginFilePaths[pfp]); - plugindllsha512.Add(pfp, text); + string text = Encryption.FileSha256(PluginLoader.PluginFilePaths[pfp]); + plugindllsha256.Add(pfp, text); Console.WriteLine(pfp + $" is {text}."); } @@ -45,20 +45,26 @@ namespace Milimoe.FunGame.Testing.Tests } } - Dictionary moduledllsha512 = []; + Dictionary moduledllsha256 = []; foreach (string mfp in GameModuleLoader.ModuleFilePaths.Keys) { - string text = Encryption.FileSha512(GameModuleLoader.ModuleFilePaths[mfp]); - moduledllsha512.Add(mfp, text); + string text = Encryption.FileSha256(GameModuleLoader.ModuleFilePaths[mfp]); + moduledllsha256.Add(mfp, text); Console.WriteLine(mfp + $" is {text}."); } - foreach (string moduledll in moduledllsha512.Keys) + GameModuleLoader serverModels = GameModuleLoader.LoadGameModules(FunGameInfo.FunGame.FunGame_Server, []); + + foreach (string moduledll in serverModels.ModuleServers.Keys) { - string server = moduledllsha512[moduledll]; - if (plugindllsha512.TryGetValue(moduledll, out string? client) && client != "" && server == client) + if (!serverModels.ModuleServers[moduledll].IsAnonymous) { - Console.WriteLine(moduledll + $" is checked pass."); + string server = Encryption.FileSha256(GameModuleLoader.ModuleFilePaths[moduledll]); + string client = moduledllsha256[moduledll]; + if (server == client) + { + Console.WriteLine(moduledll + $" is checked pass."); + } } } } diff --git a/Library/Tests/WebSocketTest.cs b/Library/Tests/WebSocketTest.cs index 93a64b5..75147c6 100644 --- a/Library/Tests/WebSocketTest.cs +++ b/Library/Tests/WebSocketTest.cs @@ -66,6 +66,12 @@ namespace Milimoe.FunGame.Testing.Tests data.Add("sc", 1); await HTTPClient.Send(SocketMessageType.AnonymousGameServer, OshimaGameModuleConstant.Anonymous, data); } + if (str == "sclist") + { + Dictionary data = []; + data.Add("command", "sclist"); + await HTTPClient.Send(SocketMessageType.AnonymousGameServer, OshimaGameModuleConstant.Anonymous, data); + } if (str == "wsclose") { await HTTPClient.Send(SocketMessageType.EndGame);