示例#1
0
文件: IPBan.cpp 项目: dsyalex/FLHook
	static void ReloadLoginIDBans()
	{
		// init variables
		char szDataPath[MAX_PATH];
		GetUserDataPath(szDataPath);
		string scAcctPath = string(szDataPath) + "\\Accts\\MultiPlayer\\loginidbans.ini";
		if (set_iPluginDebug)
			ConPrint(L"NOTICE: Loading Login ID bans from %s\n",stows(scAcctPath).c_str());

		INI_Reader ini;
		set_lstLoginIDBans.clear();
		if (ini.open(scAcctPath.c_str(), false))
		{
			while (ini.read_header())
			{
				while (ini.read_value())
				{
					set_lstLoginIDBans.push_back(Trim(ini.get_name_ptr()));
					if (set_iPluginDebug)
						ConPrint(L"NOTICE: Adding Login ID ban %s\n", stows(ini.get_name_ptr()).c_str());
				}
			}
			ini.close();
		}
		ConPrint(L"ID Bans [%u]\n",set_lstLoginIDBans.size());
	}
示例#2
0
/// Load the flhook section from the character file
void __stdcall CharacterSelect(struct CHARACTER_ID const &charid, unsigned int client)
{
	returncode = DEFAULT_RETURNCODE;

	string path = scAcctPath + GetAccountDir(client) + "\\" + charid.szCharFilename;

	//ConPrint(L"CharacterSelect=%s\n", stows(path).c_str());

	clients[client].charfilename = charid.szCharFilename;
	clients[client].lines.clear();

	// Read the flhook section so that we can rewrite after the save so that it isn't lost
	INI_Reader ini;
	if (ini.open(path.c_str(), false))
	{
		while (ini.read_header())
		{
			if (ini.is_header("flhook"))
			{
				wstring tag;
				while (ini.read_value())
				{
					clients[client].lines[ini.get_name_ptr()] = ini.get_value_string();
				}
			}
		}
		ini.close();
	}
}