fixed registering of ban commands. Closes #942

This commit is contained in:
oy 2012-03-04 12:47:09 +01:00
parent d9c27c8426
commit 9fee99b2f6

View file

@ -1258,10 +1258,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);
@ -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<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");
@ -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");