Ejemplo n.º 1
0
void AdminCache::OnSimillimumStartup(bool late)
{
	RegisterAuthIdentType("steam");
	RegisterAuthIdentType("name");
	RegisterAuthIdentType("ip");

	NameFlag("reservation", Admin_Reservation);
	NameFlag("kick", Admin_Kick);
	NameFlag("generic", Admin_Generic);
	NameFlag("ban", Admin_Ban);
	NameFlag("unban", Admin_Unban);
	NameFlag("slay", Admin_Slay);
	NameFlag("changemap", Admin_Changemap);
	NameFlag("cvars", Admin_Convars);
	NameFlag("config", Admin_Config);
	NameFlag("chat", Admin_Chat);
	NameFlag("vote", Admin_Vote);
	NameFlag("password", Admin_Password);
	NameFlag("rcon", Admin_RCON);
	NameFlag("cheats", Admin_Cheats);
	NameFlag("root", Admin_Root);
	NameFlag("custom1", Admin_Custom1);
	NameFlag("custom2", Admin_Custom2);
	NameFlag("custom3", Admin_Custom3);
	NameFlag("custom4", Admin_Custom4);
	NameFlag("custom5", Admin_Custom5);
	NameFlag("custom6", Admin_Custom6);
}
Ejemplo n.º 2
0
void AdminCache::OnSourceModStartup(bool late)
{
	RegisterAuthIdentType("steam");
	RegisterAuthIdentType("name");
	RegisterAuthIdentType("ip");

	NameFlag("reservation", Admin_Reservation);
	NameFlag("kick", Admin_Kick);
	NameFlag("generic", Admin_Generic);
	NameFlag("ban", Admin_Ban);
	NameFlag("unban", Admin_Unban);
	NameFlag("slay", Admin_Slay);
	NameFlag("changemap", Admin_Changemap);
	NameFlag("cvars", Admin_Convars);
	NameFlag("config", Admin_Config);
	NameFlag("chat", Admin_Chat);
	NameFlag("vote", Admin_Vote);
	NameFlag("password", Admin_Password);
	NameFlag("rcon", Admin_RCON);
	NameFlag("cheats", Admin_Cheats);
	NameFlag("root", Admin_Root);
	NameFlag("custom1", Admin_Custom1);
	NameFlag("custom2", Admin_Custom2);
	NameFlag("custom3", Admin_Custom3);
	NameFlag("custom4", Admin_Custom4);
	NameFlag("custom5", Admin_Custom5);
	NameFlag("custom6", Admin_Custom6);

	auto sm_dump_admcache = [this] (int client, const ICommandArgs *args) -> bool {
		char buffer[PLATFORM_MAX_PATH];
		g_pSM->BuildPath(Path_SM, buffer, sizeof(buffer), "data/admin_cache_dump.txt");

		if (!DumpCache(buffer)) {
			bridge->ConsolePrint("Could not open file for writing: %s", buffer);
			return true;
		}

		bridge->ConsolePrint("Admin cache dumped to: %s", buffer);
		return true;
	};

	bridge->DefineCommand("sm_dump_admcache", "Dumps the admin cache for debugging", sm_dump_admcache);
}