diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index 8f2e314d5..a2781b464 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -1258,10 +1258,6 @@ void CServer::InitRegister(CNetServer *pNetServer, IEngineMasterServer *pMasterS int CServer::Run() { - m_pGameServer = Kernel()->RequestInterface(); - m_pMap = Kernel()->RequestInterface(); - m_pStorage = Kernel()->RequestInterface(); - // m_PrintCBIndex = Console()->RegisterPrintCallback(g_Config.m_ConsoleOutputLevel, SendRconLineAuthed, this); @@ -1295,7 +1291,6 @@ int CServer::Run() m_NetServer.SetCallbacks(NewClientCallback, DelClientCallback, this); - m_ServerBan.Init(Console(), Storage(), this); m_Econ.Init(Console(), &m_ServerBan); char aBuf[256]; @@ -1613,7 +1608,11 @@ void CServer::ConchainConsoleOutputLevelUpdate(IConsole::IResult *pResult, void void CServer::RegisterCommands() { m_pConsole = Kernel()->RequestInterface(); + m_pGameServer = Kernel()->RequestInterface(); + m_pMap = Kernel()->RequestInterface(); + m_pStorage = Kernel()->RequestInterface(); + // register console commands Console()->Register("kick", "i?r", CFGFLAG_SERVER, ConKick, this, "Kick player with specified id for any reason"); Console()->Register("status", "", CFGFLAG_SERVER, ConStatus, this, "List players"); Console()->Register("shutdown", "", CFGFLAG_SERVER, ConShutdown, this, "Shut down"); @@ -1630,6 +1629,10 @@ void CServer::RegisterCommands() Console()->Chain("sv_max_clients_per_ip", ConchainMaxclientsperipUpdate, this); Console()->Chain("mod_command", ConchainModCommandUpdate, this); Console()->Chain("console_output_level", ConchainConsoleOutputLevelUpdate, this); + + // register console commands in sub parts + m_ServerBan.Init(Console(), Storage(), this); + m_pGameServer->OnConsoleInit(); } @@ -1710,7 +1713,6 @@ int main(int argc, const char **argv) // ignore_convention // register all console commands pServer->RegisterCommands(); - pGameServer->OnConsoleInit(); // execute autoexec file pConsole->ExecuteFile("autoexec.cfg");