From b0bffa0b5d505d5d69b16a161f46188e8f20a920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Mei=C3=9Fner?= Date: Sun, 19 Jan 2014 10:06:33 +0100 Subject: [PATCH] Allow setting the G values for the servers in the server.ini Setting these values is optional. If they are not set in the ini file, default values will be used. This way, we don't have to change all our ini files. --- .../pfConsoleCore/pfConsoleCommandsCore.cpp | 30 +++++++++++++++++++ .../Plasma/NucleusLib/pnNetBase/pnNbKeys.cpp | 3 ++ .../Plasma/NucleusLib/pnNetBase/pnNbKeys.h | 6 ++-- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCommandsCore.cpp b/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCommandsCore.cpp index 1373e374..0e94e9fa 100644 --- a/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCommandsCore.cpp +++ b/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCommandsCore.cpp @@ -178,6 +178,16 @@ PF_CONSOLE_CMD( kNetDiffieHellmanKeyBits / 8, kAuthDhXData); } +//============================================================================ +PF_CONSOLE_CMD( + Server_Auth, + G, + "int GValue", + "Set the Auth Server G value" + ) { + kAuthDhGValue = (int)params[0]; +} + //============================================================================ // Server.Game group @@ -219,6 +229,16 @@ PF_CONSOLE_CMD( kNetDiffieHellmanKeyBits / 8, kGameDhXData); } +//============================================================================ +PF_CONSOLE_CMD( + Server_Game, + G, + "int GValue", + "Set the Game Server G value" + ) { + kGameDhGValue = (int)params[0]; +} + //============================================================================ // Server.Gate group @@ -269,3 +289,13 @@ PF_CONSOLE_CMD( Base64Decode(strlen((const char *)params[0]), (const char *)params[0], kNetDiffieHellmanKeyBits / 8, kGateKeeperDhXData); } + +//============================================================================ +PF_CONSOLE_CMD( + Server_Gate, + G, + "int GValue", + "Set the GateKeeper Server G value" + ) { + kGateKeeperDhGValue = (int)params[0]; +} diff --git a/Sources/Plasma/NucleusLib/pnNetBase/pnNbKeys.cpp b/Sources/Plasma/NucleusLib/pnNetBase/pnNbKeys.cpp index 4c421a73..b9fa7fa2 100644 --- a/Sources/Plasma/NucleusLib/pnNetBase/pnNbKeys.cpp +++ b/Sources/Plasma/NucleusLib/pnNetBase/pnNbKeys.cpp @@ -43,13 +43,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnNbKeys.h" // Auth Server +uint32_t kAuthDhGValue = 41; uint8_t kAuthDhNData[kNetDiffieHellmanKeyBits / 8] = {0}; uint8_t kAuthDhXData[kNetDiffieHellmanKeyBits / 8] = {0}; // Game Server +uint32_t kGameDhGValue = 73; uint8_t kGameDhNData[kNetDiffieHellmanKeyBits / 8] = {0}; uint8_t kGameDhXData[kNetDiffieHellmanKeyBits / 8] = {0}; // GateKeeper Server +uint32_t kGateKeeperDhGValue = 4; uint8_t kGateKeeperDhNData[kNetDiffieHellmanKeyBits / 8] = {0}; uint8_t kGateKeeperDhXData[kNetDiffieHellmanKeyBits / 8] = {0}; diff --git a/Sources/Plasma/NucleusLib/pnNetBase/pnNbKeys.h b/Sources/Plasma/NucleusLib/pnNetBase/pnNbKeys.h index 235795f2..c6669ca0 100644 --- a/Sources/Plasma/NucleusLib/pnNetBase/pnNbKeys.h +++ b/Sources/Plasma/NucleusLib/pnNetBase/pnNbKeys.h @@ -47,17 +47,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnNbConst.h" // Auth Server -static const unsigned kAuthDhGValue = 41; +extern uint32_t kAuthDhGValue; extern uint8_t kAuthDhNData[kNetDiffieHellmanKeyBits / 8]; extern uint8_t kAuthDhXData[kNetDiffieHellmanKeyBits / 8]; // Game Server -static const unsigned kGameDhGValue = 73; +extern uint32_t kGameDhGValue; extern uint8_t kGameDhNData[kNetDiffieHellmanKeyBits / 8]; extern uint8_t kGameDhXData[kNetDiffieHellmanKeyBits / 8]; // GateKeeper Server -static const unsigned kGateKeeperDhGValue = 4; +extern uint32_t kGateKeeperDhGValue; extern uint8_t kGateKeeperDhNData[kNetDiffieHellmanKeyBits / 8]; extern uint8_t kGateKeeperDhXData[kNetDiffieHellmanKeyBits / 8];