コード例 #1
0
ファイル: ScriptLoader.cpp プロジェクト: PseudoProxen/Phasor
	e_command_result sv_script_load(void*, 
		commands::CArgParser& args, COutStream& out)
	{
		std::string script = args.ReadString();
		bool persistent = false;
		if (args.size() == 2) persistent = args.ReadBool();
		
		if (g_Scripts->OpenScript(script.c_str(), persistent))
			out << script << " has been loaded." << endl;
		else
			out << script << " couldn't be loaded." << endl;
		return e_command_result::kProcessed;
	}
コード例 #2
0
ファイル: ScriptLoader.cpp プロジェクト: PseudoProxen/Phasor
	e_command_result sv_script_reload(void*, 
		commands::CArgParser& args, COutStream& out)
	{
		if (args.size() == 1) {
			std::string script = args.ReadString();

			if (g_Scripts->ReloadScript(script))
				out << script << " has been reloaded." << endl;
			else
				out << script << " isn't currently loaded." << endl;
		} else {
			g_Scripts->ReloadScripts(true);
			out << "All scripts have been reloaded." << endl;
		}
		return e_command_result::kProcessed;
	}
コード例 #3
0
ファイル: MapVote.cpp プロジェクト: ChadSki/Phasor
	e_command_result sv_mapvote_add(void*, 
		commands::CArgParser& args, COutStream& out)
	{
		s_mapvote_entry entry;
		entry.game_info.map = args.ReadString();
		entry.game_info.gametype = args.ReadWideString();
		entry.desc = args.ReadString();

		for (size_t x = 3; x < args.size(); x++)
			entry.game_info.scripts.push_back(args.ReadString());
		
		if (!maploader::ValidateUserInput(entry.game_info, out))
			return e_command_result::kProcessed;
		
		mapvote_list.push_back(entry);
		return e_command_result::kProcessed;
	}