fixed registering of ban commands. Closes #942

This commit is contained in:
oy 2012-03-04 12:47:09 +01:00
parent fa85cede53
commit ffd89938d7

View file

@ -1255,10 +1255,6 @@ void CServer::InitRegister(CNetServer *pNetServer, IEngineMasterServer *pMasterS
int CServer::Run()
{
m_pGameServer = Kernel()->RequestInterface<IGameServer>();
m_pMap = Kernel()->RequestInterface<IEngineMap>();
m_pStorage = Kernel()->RequestInterface<IStorage>();
//
m_PrintCBIndex = Console()->RegisterPrintCallback(g_Config.m_ConsoleOutputLevel, SendRconLineAuthed, this);
@ -1291,7 +1287,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];
@ -1609,7 +1604,11 @@ void CServer::ConchainConsoleOutputLevelUpdate(IConsole::IResult *pResult, void
void CServer::RegisterCommands()
{
m_pConsole = Kernel()->RequestInterface<IConsole>();
m_pGameServer = Kernel()->RequestInterface<IGameServer>();
m_pMap = Kernel()->RequestInterface<IEngineMap>();
m_pStorage = Kernel()->RequestInterface<IStorage>();
// 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");
@ -1626,6 +1625,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();
}
@ -1706,7 +1709,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");