| 4379 | #endif |
| 4380 | |
| 4381 | void CServer::RegisterCommands() |
| 4382 | { |
| 4383 | m_pConsole = Kernel()->RequestInterface<IConsole>(); |
| 4384 | m_pGameServer = Kernel()->RequestInterface<IGameServer>(); |
| 4385 | m_pStorage = Kernel()->RequestInterface<IStorage>(); |
| 4386 | m_pAntibot = Kernel()->RequestInterface<IEngineAntibot>(); |
| 4387 | |
| 4388 | Kernel()->RegisterInterface(static_cast<IHttp *>(&m_Http), false); |
| 4389 | |
| 4390 | // register console commands |
| 4391 | Console()->Register("kick", "i[id] ?r[reason]", CFGFLAG_SERVER, ConKick, this, "Kick player with specified id for any reason"); |
| 4392 | Console()->Register("status", "?r[name]", CFGFLAG_SERVER, ConStatus, this, "List players containing name or all players"); |
| 4393 | Console()->Register("shutdown", "?r[reason]", CFGFLAG_SERVER, ConShutdown, this, "Shut down"); |
| 4394 | Console()->Register("logout", "", CFGFLAG_SERVER, ConLogout, this, "Logout of rcon"); |
| 4395 | Console()->Register("show_ips", "?i[show]", CFGFLAG_SERVER, ConShowIps, this, "Show IP addresses in rcon commands (1 = on, 0 = off)"); |
| 4396 | Console()->Register("hide_auth_status", "?i[hide]", CFGFLAG_SERVER, ConHideAuthStatus, this, "Opt out of spectator count and hide auth status to non-authed players (1 = hidden, 0 = shown)"); |
| 4397 | Console()->Register("force_high_bandwidth_on_spectate", "?i[enable]", CFGFLAG_SERVER, ConForceHighBandwidthOnSpectate, this, "Force high bandwidth mode when spectating (1 = on, 0 = off)"); |
| 4398 | |
| 4399 | Console()->Register("record", "?s[file]", CFGFLAG_SERVER | CFGFLAG_STORE, ConRecord, this, "Record to a file"); |
| 4400 | Console()->Register("stoprecord", "", CFGFLAG_SERVER, ConStopRecord, this, "Stop recording"); |
| 4401 | |
| 4402 | Console()->Register("reload", "", CFGFLAG_SERVER, ConMapReload, this, "Reload the map"); |
| 4403 | |
| 4404 | Console()->Register("add_sqlserver", "s['r'|'w'] s[Database] s[Prefix] s[User] s[Password] s[IP] i[Port] ?i[SetUpDatabase ?]", CFGFLAG_SERVER | CFGFLAG_NONTEEHISTORIC, ConAddSqlServer, this, "add a sqlserver"); |
| 4405 | Console()->Register("dump_sqlservers", "s['r'|'w']", CFGFLAG_SERVER, ConDumpSqlServers, this, "dumps all sqlservers readservers = r, writeservers = w"); |
| 4406 | |
| 4407 | Console()->Register("auth_add", "s[ident] s[level] r[pw]", CFGFLAG_SERVER | CFGFLAG_NONTEEHISTORIC, ConAuthAdd, this, "Add a rcon key"); |
| 4408 | Console()->Register("auth_add_p", "s[ident] s[level] s[hash] s[salt]", CFGFLAG_SERVER | CFGFLAG_NONTEEHISTORIC, ConAuthAddHashed, this, "Add a prehashed rcon key"); |
| 4409 | Console()->Register("auth_change", "s[ident] s[level] r[pw]", CFGFLAG_SERVER | CFGFLAG_NONTEEHISTORIC, ConAuthUpdate, this, "Update a rcon key"); |
| 4410 | Console()->Register("auth_change_p", "s[ident] s[level] s[hash] s[salt]", CFGFLAG_SERVER | CFGFLAG_NONTEEHISTORIC, ConAuthUpdateHashed, this, "Update a rcon key with prehashed data"); |
| 4411 | Console()->Register("auth_remove", "s[ident]", CFGFLAG_SERVER | CFGFLAG_NONTEEHISTORIC, ConAuthRemove, this, "Remove a rcon key"); |
| 4412 | Console()->Register("auth_list", "", CFGFLAG_SERVER, ConAuthList, this, "List all rcon keys"); |
| 4413 | |
| 4414 | Console()->Register("reload_announcement", "", CFGFLAG_SERVER, ConReloadAnnouncement, this, "Reload the announcements"); |
| 4415 | Console()->Register("reload_maplist", "", CFGFLAG_SERVER, ConReloadMaplist, this, "Reload the maplist"); |
| 4416 | |
| 4417 | RustVersionRegister(*Console()); |
| 4418 | |
| 4419 | Console()->Chain("sv_name", ConchainSpecialInfoupdate, this); |
| 4420 | Console()->Chain("password", ConchainSpecialInfoupdate, this); |
| 4421 | Console()->Chain("sv_reserved_slots", ConchainSpecialInfoupdate, this); |
| 4422 | Console()->Chain("sv_spectator_slots", ConchainSpecialInfoupdate, this); |
| 4423 | |
| 4424 | Console()->Chain("sv_max_clients_per_ip", ConchainMaxclientsperipUpdate, this); |
| 4425 | Console()->Chain("access_level", ConchainCommandAccessUpdate, this); |
| 4426 | |
| 4427 | Console()->Chain("sv_rcon_password", ConchainRconPasswordChange, this); |
| 4428 | Console()->Chain("sv_rcon_mod_password", ConchainRconModPasswordChange, this); |
| 4429 | Console()->Chain("sv_rcon_helper_password", ConchainRconHelperPasswordChange, this); |
| 4430 | Console()->Chain("sv_map", ConchainMapUpdate, this); |
| 4431 | Console()->Chain("sv_sixup", ConchainSixupUpdate, this); |
| 4432 | Console()->Chain("sv_register_community_token", ConchainRegisterCommunityTokenRedact, nullptr); |
| 4433 | |
| 4434 | Console()->Chain("loglevel", ConchainLoglevel, this); |
| 4435 | Console()->Chain("stdout_output_level", ConchainStdoutOutputLevel, this); |
| 4436 | |
| 4437 | Console()->Chain("sv_announcement_filename", ConchainAnnouncementFilename, this); |
| 4438 |
no test coverage detected