| 245 | } |
| 246 | |
| 247 | void AdminCache::OnSourceModStartup(bool late) |
| 248 | { |
| 249 | RegisterAuthIdentType("steam"); |
| 250 | RegisterAuthIdentType("name"); |
| 251 | RegisterAuthIdentType("ip"); |
| 252 | |
| 253 | NameFlag("reservation", Admin_Reservation); |
| 254 | NameFlag("kick", Admin_Kick); |
| 255 | NameFlag("generic", Admin_Generic); |
| 256 | NameFlag("ban", Admin_Ban); |
| 257 | NameFlag("unban", Admin_Unban); |
| 258 | NameFlag("slay", Admin_Slay); |
| 259 | NameFlag("changemap", Admin_Changemap); |
| 260 | NameFlag("cvars", Admin_Convars); |
| 261 | NameFlag("config", Admin_Config); |
| 262 | NameFlag("chat", Admin_Chat); |
| 263 | NameFlag("vote", Admin_Vote); |
| 264 | NameFlag("password", Admin_Password); |
| 265 | NameFlag("rcon", Admin_RCON); |
| 266 | NameFlag("cheats", Admin_Cheats); |
| 267 | NameFlag("root", Admin_Root); |
| 268 | NameFlag("custom1", Admin_Custom1); |
| 269 | NameFlag("custom2", Admin_Custom2); |
| 270 | NameFlag("custom3", Admin_Custom3); |
| 271 | NameFlag("custom4", Admin_Custom4); |
| 272 | NameFlag("custom5", Admin_Custom5); |
| 273 | NameFlag("custom6", Admin_Custom6); |
| 274 | |
| 275 | auto sm_dump_admcache = [this] (int client, const ICommandArgs *args) -> bool { |
| 276 | char buffer[PLATFORM_MAX_PATH]; |
| 277 | g_pSM->BuildPath(Path_SM, buffer, sizeof(buffer), "data/admin_cache_dump.txt"); |
| 278 | |
| 279 | if (!DumpCache(buffer)) { |
| 280 | bridge->ConsolePrint("Could not open file for writing: %s", buffer); |
| 281 | return true; |
| 282 | } |
| 283 | |
| 284 | bridge->ConsolePrint("Admin cache dumped to: %s", buffer); |
| 285 | return true; |
| 286 | }; |
| 287 | |
| 288 | bridge->DefineCommand("sm_dump_admcache", "Dumps the admin cache for debugging", sm_dump_admcache); |
| 289 | } |
| 290 | |
| 291 | void AdminCache::OnSourceModAllInitialized() |
| 292 | { |
nothing calls this directly
no test coverage detected