fixed registering of ban commands. Closes #942

This commit is contained in:
oy 2012-03-04 12:47:09 +01:00 committed by heinrich5991
parent fa57b979fd
commit c7f8697c51

View file

@ -1283,10 +1283,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);
@ -1319,7 +1315,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];
@ -1636,7 +1631,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");
@ -1653,6 +1652,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();
}
@ -1733,7 +1736,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");