From ad9b32b7417d0837c485b6c9b802cc90aa51c521 Mon Sep 17 00:00:00 2001 From: oy Date: Sat, 7 Aug 2010 20:22:25 +0200 Subject: added the possibility to store commands within the console and execute them later on when everything is initialised correctly - fixes several possible startup crashes and the "Support bans in server configuration"-ticket --- src/engine/server/server.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/engine/server/server.cpp') diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index 847d07ce..0fd314d0 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -1038,6 +1038,9 @@ int CServer::Run() GameServer()->OnInit(); dbg_msg("server", "version %s", GameServer()->NetVersion()); + // process pending commands + m_pConsole->StoreCommands(false); + // start game { int64 ReportTime = time_get(); @@ -1325,13 +1328,13 @@ void CServer::RegisterCommands() m_pConsole = Kernel()->RequestInterface(); Console()->Register("kick", "i", CFGFLAG_SERVER, ConKick, this, ""); - Console()->Register("ban", "s?i", CFGFLAG_SERVER, ConBan, this, ""); - Console()->Register("unban", "s", CFGFLAG_SERVER, ConUnban, this, ""); - Console()->Register("bans", "", CFGFLAG_SERVER, ConBans, this, ""); + Console()->Register("ban", "s?i", CFGFLAG_SERVER|CFGFLAG_STORE, ConBan, this, ""); + Console()->Register("unban", "s", CFGFLAG_SERVER|CFGFLAG_STORE, ConUnban, this, ""); + Console()->Register("bans", "", CFGFLAG_SERVER|CFGFLAG_STORE, ConBans, this, ""); Console()->Register("status", "", CFGFLAG_SERVER, ConStatus, this, ""); Console()->Register("shutdown", "", CFGFLAG_SERVER, ConShutdown, this, ""); - Console()->Register("record", "s", CFGFLAG_SERVER, ConRecord, this, ""); + Console()->Register("record", "s", CFGFLAG_SERVER|CFGFLAG_STORE, ConRecord, this, ""); Console()->Register("stoprecord", "", CFGFLAG_SERVER, ConStopRecord, this, ""); Console()->Register("reload", "", CFGFLAG_SERVER, ConMapReload, this, ""); -- cgit 1.4.1