mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
fixed registering of ban commands. Closes #942
This commit is contained in:
parent
fa85cede53
commit
ffd89938d7
|
@ -1255,10 +1255,6 @@ void CServer::InitRegister(CNetServer *pNetServer, IEngineMasterServer *pMasterS
|
||||||
|
|
||||||
int CServer::Run()
|
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);
|
m_PrintCBIndex = Console()->RegisterPrintCallback(g_Config.m_ConsoleOutputLevel, SendRconLineAuthed, this);
|
||||||
|
|
||||||
|
@ -1291,7 +1287,6 @@ int CServer::Run()
|
||||||
|
|
||||||
m_NetServer.SetCallbacks(NewClientCallback, DelClientCallback, this);
|
m_NetServer.SetCallbacks(NewClientCallback, DelClientCallback, this);
|
||||||
|
|
||||||
m_ServerBan.Init(Console(), Storage(), this);
|
|
||||||
m_Econ.Init(Console(), &m_ServerBan);
|
m_Econ.Init(Console(), &m_ServerBan);
|
||||||
|
|
||||||
char aBuf[256];
|
char aBuf[256];
|
||||||
|
@ -1609,7 +1604,11 @@ void CServer::ConchainConsoleOutputLevelUpdate(IConsole::IResult *pResult, void
|
||||||
void CServer::RegisterCommands()
|
void CServer::RegisterCommands()
|
||||||
{
|
{
|
||||||
m_pConsole = Kernel()->RequestInterface<IConsole>();
|
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("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("status", "", CFGFLAG_SERVER, ConStatus, this, "List players");
|
||||||
Console()->Register("shutdown", "", CFGFLAG_SERVER, ConShutdown, this, "Shut down");
|
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("sv_max_clients_per_ip", ConchainMaxclientsperipUpdate, this);
|
||||||
Console()->Chain("mod_command", ConchainModCommandUpdate, this);
|
Console()->Chain("mod_command", ConchainModCommandUpdate, this);
|
||||||
Console()->Chain("console_output_level", ConchainConsoleOutputLevelUpdate, 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
|
// register all console commands
|
||||||
pServer->RegisterCommands();
|
pServer->RegisterCommands();
|
||||||
pGameServer->OnConsoleInit();
|
|
||||||
|
|
||||||
// execute autoexec file
|
// execute autoexec file
|
||||||
pConsole->ExecuteFile("autoexec.cfg");
|
pConsole->ExecuteFile("autoexec.cfg");
|
||||||
|
|
Loading…
Reference in a new issue