Implementing packet encryption

This commit is contained in:
qinfyy
2024-10-01 15:50:55 +08:00
parent c86540dd33
commit da456bee9b
15 changed files with 1135 additions and 2 deletions

View File

@@ -100,7 +100,6 @@ public class EntryPoint
Logger.Info(I18NManager.Translate("Server.ServerInfo.LoadedItem",
I18NManager.Translate("Word.DatabaseAccount")));
Logger.Warn(I18NManager.Translate("Server.ServerInfo.WaitForAllDone"));
}
catch (Exception e)
{
@@ -111,7 +110,16 @@ public class EntryPoint
}
HandlerManager.Init();
if (ConfigManager.Config.GameServer.UsePacketEncryption)
{
Crypto.ClientSecretKey = Crypto.InitEc2b();
if (Crypto.ClientSecretKey == null)
{
ConfigManager.Config.GameServer.UsePacketEncryption = false;
}
}
Logger.Warn(I18NManager.Translate("Server.ServerInfo.WaitForAllDone"));
WebProgram.Main([], GetConfig().HttpServer.Port, GetConfig().HttpServer.GetBindDisplayAddress());
Logger.Info(I18NManager.Translate("Server.ServerInfo.ServerRunning", I18NManager.Translate("Word.Dispatch"),
GetConfig().HttpServer.GetDisplayAddress()));