Changeset - r18789:a08172f62fc8
[Not reviewed]
master
0 1 0
truebrain - 13 years ago 2011-12-21 12:25:17
truebrain@openttd.org
(svn r23647) -Add: add rescan_game as console command (patch by Xaroth)
1 file changed with 18 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/console_cmds.cpp
Show inline comments
 
@@ -1265,24 +1265,41 @@ DEF_CONSOLE_CMD(ConRescanAI)
 
	}
 

	
 
	if (_networking && !_network_server) {
 
		IConsoleWarning("Only the server can rescan the AI dir for scripts.");
 
		return true;
 
	}
 

	
 
	AI::Rescan();
 

	
 
	return true;
 
}
 

	
 
DEF_CONSOLE_CMD(ConRescanGame)
 
{
 
	if (argc == 0) {
 
		IConsoleHelp("Rescan the Game Script dir for scripts. Usage: 'rescan_game'");
 
		return true;
 
	}
 

	
 
	if (_networking && !_network_server) {
 
		IConsoleWarning("Only the server can rescan the Game Script dir for scripts.");
 
		return true;
 
	}
 

	
 
	Game::Rescan();
 

	
 
	return true;
 
}
 

	
 
DEF_CONSOLE_CMD(ConRescanNewGRF)
 
{
 
	if (argc == 0) {
 
		IConsoleHelp("Rescan the data dir for NewGRFs. Usage: 'rescan_newgrf'");
 
		return true;
 
	}
 

	
 
	ScanNewGRFFiles(NULL);
 

	
 
	return true;
 
}
 

	
 
@@ -1909,24 +1926,25 @@ void IConsoleStdLibRegister()
 
	IConsoleAliasRegister("list_patches", "list_settings %+");
 
	IConsoleAliasRegister("developer",    "setting developer %+");
 

	
 
	IConsoleCmdRegister("list_ai_libs", ConListAILibs);
 
	IConsoleCmdRegister("list_ai",      ConListAI);
 
	IConsoleCmdRegister("reload_ai",    ConReloadAI);
 
	IConsoleCmdRegister("rescan_ai",    ConRescanAI);
 
	IConsoleCmdRegister("start_ai",     ConStartAI);
 
	IConsoleCmdRegister("stop_ai",      ConStopAI);
 

	
 
	IConsoleCmdRegister("list_game",    ConListGame);
 
	IConsoleCmdRegister("list_game_libs", ConListGameLibs);
 
	IConsoleCmdRegister("rescan_game",    ConRescanGame);
 

	
 
	/* networking functions */
 
#ifdef ENABLE_NETWORK
 
/* Content downloading is only available with ZLIB */
 
#if defined(WITH_ZLIB)
 
	IConsoleCmdRegister("content",         ConContent);
 
#endif /* defined(WITH_ZLIB) */
 

	
 
	/*** Networking commands ***/
 
	IConsoleCmdRegister("say",             ConSay, ConHookNeedNetwork);
 
	IConsoleCmdRegister("companies",       ConCompanies, ConHookServerOnly);
 
	IConsoleAliasRegister("players",       "companies");
0 comments (0 inline, 0 general)