about summary refs log tree commit diff
path: root/src/engine/server/server.cpp
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-08-07 20:22:25 +0200
committeroy <Tom_Adams@web.de>2010-08-07 20:22:25 +0200
commitad9b32b7417d0837c485b6c9b802cc90aa51c521 (patch)
treefb2c0cd8d68f58bbbd1e0d895cb82086ea824fe7 /src/engine/server/server.cpp
parent3f0ff1fb1404efcb312a6bfcef0beb4b6a0d92ef (diff)
downloadzcatch-ad9b32b7417d0837c485b6c9b802cc90aa51c521.tar.gz
zcatch-ad9b32b7417d0837c485b6c9b802cc90aa51c521.zip
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
Diffstat (limited to 'src/engine/server/server.cpp')
-rw-r--r--src/engine/server/server.cpp11
1 files changed, 7 insertions, 4 deletions
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<IConsole>();
 	
 	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, "");