about summary refs log tree commit diff
path: root/src/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/client/client.cpp1
-rw-r--r--src/engine/server/server.cpp13
-rw-r--r--src/engine/server/server.h4
-rw-r--r--src/engine/shared/config_variables.h1
4 files changed, 15 insertions, 4 deletions
diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp
index aca576a7..97adeeac 100644
--- a/src/engine/client/client.cpp
+++ b/src/engine/client/client.cpp
@@ -1916,6 +1916,7 @@ void CClient::RegisterCommands()
 	m_pConsole->Register("shutdown", "", CFGFLAG_SERVER, Con_ServerDummy, this, "Shut down");
 	m_pConsole->Register("record", "s", CFGFLAG_SERVER, Con_ServerDummy, this, "Record to a file");
 	m_pConsole->Register("stoprecord", "", CFGFLAG_SERVER, Con_ServerDummy, this, "Stop recording");
+	m_pConsole->Register("reload", "", CFGFLAG_SERVER, Con_ServerDummy, this, "Reload the map");
 
 	m_pConsole->Register("quit", "", CFGFLAG_CLIENT, Con_Quit, this, "Quit Teeworlds");
 	m_pConsole->Register("exit", "", CFGFLAG_CLIENT, Con_Quit, this, "Quit Teeworlds");
diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp
index 45cec1e4..05e56a74 100644
--- a/src/engine/server/server.cpp
+++ b/src/engine/server/server.cpp
@@ -178,6 +178,8 @@ CServer::CServer() : m_DemoRecorder(&m_SnapshotDelta)
 
 	m_pCurrentMapData = 0;
 	m_CurrentMapSize = 0;
+	
+	m_MapReload = 0;
 
 	Init();
 }
@@ -1039,9 +1041,9 @@ int CServer::Run()
 			int NewTicks = 0;
 			
 			// load new map TODO: don't poll this
-			if(str_comp(g_Config.m_SvMap, m_aCurrentMap) != 0 || g_Config.m_SvMapReload)
+			if(str_comp(g_Config.m_SvMap, m_aCurrentMap) != 0 || m_MapReload)
 			{
-				g_Config.m_SvMapReload = 0;
+				m_MapReload = 0;
 				
 				// load map
 				if(LoadMap(g_Config.m_SvMap))
@@ -1270,6 +1272,11 @@ void CServer::ConStopRecord(IConsole::IResult *pResult, void *pUser)
 	((CServer *)pUser)->m_DemoRecorder.Stop();
 }
 
+void CServer::ConMapReload(IConsole::IResult *pResult, void *pUser)
+{
+	((CServer *)pUser)->m_MapReload = 1;
+}
+
 void CServer::ConchainSpecialInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
 {
 	pfnCallback(pResult, pCallbackUserData);
@@ -1290,6 +1297,8 @@ void CServer::RegisterCommands()
 
 	Console()->Register("record", "s", CFGFLAG_SERVER, ConRecord, this, "");
 	Console()->Register("stoprecord", "", CFGFLAG_SERVER, ConStopRecord, this, "");
+	
+	Console()->Register("reload", "", CFGFLAG_SERVER, ConMapReload, this, "");
 
 	Console()->Chain("sv_name", ConchainSpecialInfoupdate, this);
 	Console()->Chain("password", ConchainSpecialInfoupdate, this);
diff --git a/src/engine/server/server.h b/src/engine/server/server.h
index 6904085a..7d56bd33 100644
--- a/src/engine/server/server.h
+++ b/src/engine/server/server.h
@@ -25,7 +25,7 @@ class CSnapIDPool
 	int m_LastTimed;
 	int m_Usage;
 	int m_InUsage;
-
+	
 public:	
 
 	CSnapIDPool();
@@ -105,6 +105,7 @@ public:
 	int64 m_GameStartTime;
 	//int m_CurrentGameTick;
 	int m_RunServer;
+	int m_MapReload;
 
 	char m_aBrowseinfoGametype[16];
 	int m_BrowseinfoProgression;
@@ -181,6 +182,7 @@ public:
 	static void ConShutdown(IConsole::IResult *pResult, void *pUser);
 	static void ConRecord(IConsole::IResult *pResult, void *pUser);
 	static void ConStopRecord(IConsole::IResult *pResult, void *pUser);
+	static void ConMapReload(IConsole::IResult *pResult, void *pUser);
 	static void ConchainSpecialInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
 
 	void RegisterCommands();
diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h
index e5541911..cc36b932 100644
--- a/src/engine/shared/config_variables.h
+++ b/src/engine/shared/config_variables.h
@@ -67,7 +67,6 @@ MACRO_CONFIG_INT(SvMaxClients, sv_max_clients, 8, 1, MAX_CLIENTS, CFGFLAG_SERVER
 MACRO_CONFIG_INT(SvHighBandwidth, sv_high_bandwidth, 0, 0, 1, CFGFLAG_SERVER, "Use high bandwidth mode. Doubles the bandwidth required for the server. LAN use only")
 MACRO_CONFIG_INT(SvRegister, sv_register, 1, 0, 1, CFGFLAG_SERVER, "Register server with master server for public listing")
 MACRO_CONFIG_STR(SvRconPassword, sv_rcon_password, 32, "", CFGFLAG_SERVER, "Remote console password")
-MACRO_CONFIG_INT(SvMapReload, sv_map_reload, 0, 0, 1, CFGFLAG_SERVER, "Reload the current map")
 
 MACRO_CONFIG_INT(Debug, debug, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Debug mode")
 MACRO_CONFIG_INT(DbgStress, dbg_stress, 0, 0, 0, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Stress systems")