From 0cbcdd027a3a7c13862a56938ab37def2ad3587b Mon Sep 17 00:00:00 2001 From: GreYFoX Date: Wed, 16 Mar 2011 16:27:30 +0200 Subject: [PATCH] Removed Helper made Moderators able to moderate only Enumerated levels http://ddrace.info/forum/showthread.php?t=528 or modify the server and change the game type to something other than DDRace thank you --- src/banmaster/banmaster.cpp | 6 +- src/engine/client/client.cpp | 52 +-- src/engine/console.h | 9 + src/engine/server/server.cpp | 121 +++---- src/engine/shared/config_variables.h | 318 +++++++++--------- src/game/client/components/binds.cpp | 8 +- src/game/client/components/camera.cpp | 6 +- src/game/client/components/chat.cpp | 8 +- src/game/client/components/console.cpp | 14 +- src/game/client/components/controls.cpp | 24 +- src/game/client/components/emoticon.cpp | 6 +- src/game/client/components/ghost.cpp | 2 +- src/game/client/components/menus_settings.cpp | 4 +- src/game/client/components/scoreboard.cpp | 2 +- src/game/client/components/voting.cpp | 4 +- src/game/client/gameclient.cpp | 32 +- src/game/ddracecommands.h | 107 +++--- src/game/server/gamecontext.cpp | 26 +- src/mastersrv/mastersrv.cpp | 2 +- 19 files changed, 374 insertions(+), 377 deletions(-) diff --git a/src/banmaster/banmaster.cpp b/src/banmaster/banmaster.cpp index ab326b20f..64371e80b 100644 --- a/src/banmaster/banmaster.cpp +++ b/src/banmaster/banmaster.cpp @@ -174,9 +174,9 @@ int main(int argc, const char **argv) // ignore_convention m_pConsole = CreateConsole(CFGFLAG_BANMASTER); m_pConsole->RegisterPrintCallback(StandardOutput, 0); - m_pConsole->Register("ban", "s?r", CFGFLAG_BANMASTER, ConBan, 0, "Bans the specified ip", 0); - m_pConsole->Register("unban_all", "", CFGFLAG_BANMASTER, ConUnbanAll, 0, "Unbans all ips", 0); - m_pConsole->Register("bind", "s", CFGFLAG_BANMASTER, ConSetBindAddr, 0, "Binds to the specified address", 0); + m_pConsole->Register("ban", "s?r", CFGFLAG_BANMASTER, ConBan, 0, "Bans the specified ip", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("unban_all", "", CFGFLAG_BANMASTER, ConUnbanAll, 0, "Unbans all ips", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("bind", "s", CFGFLAG_BANMASTER, ConSetBindAddr, 0, "Binds to the specified address", IConsole::CONSOLELEVEL_USER); { bool RegisterFail = false; diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 2d7429bbc..b1ecc5c24 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -2221,36 +2221,36 @@ void CClient::RegisterCommands() { m_pConsole = Kernel()->RequestInterface(); // register server dummy commands for tab completion - m_pConsole->Register("kick", "i?r", CFGFLAG_SERVER, 0, 0, "Kick player with specified id for any reason", 0); - m_pConsole->Register("ban", "s?ir", CFGFLAG_SERVER, 0, 0, "Ban player with ip/id for x minutes for any reason", 0); - m_pConsole->Register("unban", "s", CFGFLAG_SERVER, 0, 0, "Unban ip", 0); - m_pConsole->Register("bans", "", CFGFLAG_SERVER, 0, 0, "Show banlist", 0); - m_pConsole->Register("status", "", CFGFLAG_SERVER, 0, 0, "List players", 0); - m_pConsole->Register("shutdown", "", CFGFLAG_SERVER, 0, 0, "Shut down", 0); - m_pConsole->Register("record", "?s", CFGFLAG_SERVER, 0, 0, "Record to a file", 0); - m_pConsole->Register("stoprecord", "", CFGFLAG_SERVER, 0, 0, "Stop recording", 0); - m_pConsole->Register("reload", "", CFGFLAG_SERVER, 0, 0, "Reload the map", 0); + m_pConsole->Register("kick", "i?r", CFGFLAG_SERVER, 0, 0, "Kick player with specified id for any reason", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("ban", "s?ir", CFGFLAG_SERVER, 0, 0, "Ban player with ip/id for x minutes for any reason", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("unban", "s", CFGFLAG_SERVER, 0, 0, "Unban ip", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("bans", "", CFGFLAG_SERVER, 0, 0, "Show banlist", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("status", "", CFGFLAG_SERVER, 0, 0, "List players", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("shutdown", "", CFGFLAG_SERVER, 0, 0, "Shut down", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("record", "?s", CFGFLAG_SERVER, 0, 0, "Record to a file", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("stoprecord", "", CFGFLAG_SERVER, 0, 0, "Stop recording", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("reload", "", CFGFLAG_SERVER, 0, 0, "Reload the map", IConsole::CONSOLELEVEL_USER); - m_pConsole->Register("quit", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Quit, this, "Quit Teeworlds", -1); - m_pConsole->Register("exit", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Quit, this, "Quit Teeworlds", -1); - m_pConsole->Register("minimize", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Minimize, this, "Minimize Teeworlds", -1); - m_pConsole->Register("connect", "s", CFGFLAG_CLIENT, Con_Connect, this, "Connect to the specified host/ip", -1); - m_pConsole->Register("disconnect", "", CFGFLAG_CLIENT, Con_Disconnect, this, "Disconnect from the server", -1); - m_pConsole->Register("ping", "", CFGFLAG_CLIENT, Con_Ping, this, "Ping the current server", -1); - m_pConsole->Register("screenshot", "", CFGFLAG_CLIENT, Con_Screenshot, this, "Take a screenshot", -1); - m_pConsole->Register("rcon", "r", CFGFLAG_CLIENT, Con_Rcon, this, "Send specified command to rcon", -1); - m_pConsole->Register("rcon_auth", "s", CFGFLAG_CLIENT, Con_RconAuth, this, "Authenticate to rcon", -1); - m_pConsole->Register("play", "r", CFGFLAG_CLIENT, Con_Play, this, "Play the file specified", -1); - m_pConsole->Register("record", "?s", CFGFLAG_CLIENT, Con_Record, this, "Record to the file", -1); - m_pConsole->Register("stoprecord", "", CFGFLAG_CLIENT, Con_StopRecord, this, "Stop recording", -1); + m_pConsole->Register("quit", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Quit, this, "Quit Teeworlds", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("exit", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Quit, this, "Quit Teeworlds", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("minimize", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Minimize, this, "Minimize Teeworlds", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("connect", "s", CFGFLAG_CLIENT, Con_Connect, this, "Connect to the specified host/ip", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("disconnect", "", CFGFLAG_CLIENT, Con_Disconnect, this, "Disconnect from the server", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("ping", "", CFGFLAG_CLIENT, Con_Ping, this, "Ping the current server", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("screenshot", "", CFGFLAG_CLIENT, Con_Screenshot, this, "Take a screenshot", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("rcon", "r", CFGFLAG_CLIENT, Con_Rcon, this, "Send specified command to rcon", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("rcon_auth", "s", CFGFLAG_CLIENT, Con_RconAuth, this, "Authenticate to rcon", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("play", "r", CFGFLAG_CLIENT, Con_Play, this, "Play the file specified", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("record", "?s", CFGFLAG_CLIENT, Con_Record, this, "Record to the file", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("stoprecord", "", CFGFLAG_CLIENT, Con_StopRecord, this, "Stop recording", IConsole::CONSOLELEVEL_USER); - m_pConsole->Register("add_favorite", "s", CFGFLAG_CLIENT, Con_AddFavorite, this, "Add a server as a favorite", -1); + m_pConsole->Register("add_favorite", "s", CFGFLAG_CLIENT, Con_AddFavorite, this, "Add a server as a favorite", IConsole::CONSOLELEVEL_USER); // DDRace - m_pConsole->Register("login", "?s", CFGFLAG_SERVER, 0, 0, "Allows you access to rcon if no password is given, or changes your level if a password is given", -1); - m_pConsole->Register("auth", "?s", CFGFLAG_SERVER, 0, 0, "Allows you access to rcon if no password is given, or changes your level if a password is given", -1); - m_pConsole->Register("vote", "r", CFGFLAG_SERVER, 0, 0, "Forces the current vote to result in r (Yes/No)", 3); - m_pConsole->Register("cmdlist", "", CFGFLAG_SERVER, 0, 0, "Shows the list of all commands", 0); + m_pConsole->Register("login", "?s", CFGFLAG_SERVER, 0, 0, "Allows you access to rcon if no password is given, or changes your level if a password is given", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("auth", "?s", CFGFLAG_SERVER, 0, 0, "Allows you access to rcon if no password is given, or changes your level if a password is given", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("vote", "r", CFGFLAG_SERVER, 0, 0, "Forces the current vote to result in r (Yes/No)", IConsole::CONSOLELEVEL_USER); + m_pConsole->Register("cmdlist", "", CFGFLAG_SERVER, 0, 0, "Shows the list of all commands", IConsole::CONSOLELEVEL_USER); #define CONSOLE_COMMAND(name, params, flags, callback, userdata, help, level) m_pConsole->Register(name, params, flags, 0, 0, help, level); #include diff --git a/src/engine/console.h b/src/engine/console.h index 7e0a82de5..3aa764f39 100644 --- a/src/engine/console.h +++ b/src/engine/console.h @@ -77,6 +77,15 @@ public: virtual void RegisterCompareClientsCallback(FCompareClientsCallback pfnCallback, void *pUserData) = 0; virtual void RegisterClientOnlineCallback(FClientOnlineCallback pfnCallback, void *pUserData) = 0; + + //DDRace + enum + { + CONSOLELEVEL_USER=0, + CONSOLELEVEL_MODERATOR, + CONSOLELEVEL_ADMIN, + CONSOLELEVEL_SUPERADMIN + }; }; extern IConsole *CreateConsole(int FlagMask); diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index a9b3d62b2..4b74675bc 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -1265,17 +1265,17 @@ int CServer::Run() // load map if(LoadMap(g_Config.m_SvMap)) { - Console()->ExecuteLine("tune_reset", 4, -1); - Console()->ExecuteLine("tune gun_speed 1400", 4, -1); - Console()->ExecuteLine("tune shotgun_curvature 0", 4, -1); - Console()->ExecuteLine("tune shotgun_speed 500", 4, -1); - Console()->ExecuteLine("tune shotgun_speeddiff 0", 4, -1); - Console()->ExecuteLine("tune gun_curvature 0", 4, -1); - Console()->ExecuteLine("sv_hit 1",4,-1); - Console()->ExecuteLine("sv_npc 0",4,-1); - Console()->ExecuteLine("sv_phook 1",4,-1); - Console()->ExecuteLine("sv_endless_drag 0",4,-1); - Console()->ExecuteLine("sv_old_laser 0",4,-1); + Console()->ExecuteLine("tune_reset", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + Console()->ExecuteLine("tune gun_speed 1400", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + Console()->ExecuteLine("tune shotgun_curvature 0", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + Console()->ExecuteLine("tune shotgun_speed 500", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + Console()->ExecuteLine("tune shotgun_speeddiff 0", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + Console()->ExecuteLine("tune gun_curvature 0", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + Console()->ExecuteLine("sv_hit 1", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + Console()->ExecuteLine("sv_npc 0", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + Console()->ExecuteLine("sv_phook 1", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + Console()->ExecuteLine("sv_endless_drag 0", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + Console()->ExecuteLine("sv_old_laser 0", IConsole::CONSOLELEVEL_SUPERADMIN, -1); // new map loaded GameServer()->OnShutdown(); @@ -1596,31 +1596,31 @@ void CServer::RegisterCommands() { m_pConsole = Kernel()->RequestInterface(); - Console()->Register("kick", "v?t", CFGFLAG_SERVER, ConKick, this, "", 2); - Console()->Register("ban", "s?ir", CFGFLAG_SERVER|CFGFLAG_STORE, ConBan, this, "", 2); - Console()->Register("unban", "s", CFGFLAG_SERVER|CFGFLAG_STORE, ConUnban, this, "", 2); - Console()->Register("bans", "", CFGFLAG_SERVER|CFGFLAG_STORE, ConBans, this, "", 2); - Console()->Register("status", "", CFGFLAG_SERVER, ConStatus, this, "", 1); - Console()->Register("shutdown", "", CFGFLAG_SERVER, ConShutdown, this, "", 3); + Console()->Register("kick", "v?t", CFGFLAG_SERVER, ConKick, this, "", IConsole::CONSOLELEVEL_MODERATOR); + Console()->Register("ban", "s?ir", CFGFLAG_SERVER|CFGFLAG_STORE, ConBan, this, "", IConsole::CONSOLELEVEL_MODERATOR); + Console()->Register("unban", "s", CFGFLAG_SERVER|CFGFLAG_STORE, ConUnban, this, "", IConsole::CONSOLELEVEL_MODERATOR); + Console()->Register("bans", "", CFGFLAG_SERVER|CFGFLAG_STORE, ConBans, this, "", IConsole::CONSOLELEVEL_MODERATOR); + Console()->Register("status", "", CFGFLAG_SERVER, ConStatus, this, "", IConsole::CONSOLELEVEL_MODERATOR); + Console()->Register("shutdown", "", CFGFLAG_SERVER, ConShutdown, this, "", IConsole::CONSOLELEVEL_ADMIN); - Console()->Register("record", "?s", CFGFLAG_SERVER|CFGFLAG_STORE, ConRecord, this, "", 3); - Console()->Register("stoprecord", "", CFGFLAG_SERVER, ConStopRecord, this, "", 3); + Console()->Register("record", "?s", CFGFLAG_SERVER|CFGFLAG_STORE, ConRecord, this, "", IConsole::CONSOLELEVEL_ADMIN); + Console()->Register("stoprecord", "", CFGFLAG_SERVER, ConStopRecord, this, "", IConsole::CONSOLELEVEL_ADMIN); - Console()->Register("add_banmaster", "s", CFGFLAG_SERVER, ConAddBanmaster, this, "", 4); - Console()->Register("banmasters", "", CFGFLAG_SERVER, ConBanmasters, this, "", 3); - Console()->Register("clear_banmasters", "", CFGFLAG_SERVER, ConClearBanmasters, this, "", 4); + Console()->Register("add_banmaster", "s", CFGFLAG_SERVER, ConAddBanmaster, this, "", IConsole::CONSOLELEVEL_ADMIN); + Console()->Register("banmasters", "", CFGFLAG_SERVER, ConBanmasters, this, "", IConsole::CONSOLELEVEL_ADMIN); + Console()->Register("clear_banmasters", "", CFGFLAG_SERVER, ConClearBanmasters, this, "", IConsole::CONSOLELEVEL_ADMIN); - Console()->Register("reload", "", CFGFLAG_SERVER, ConMapReload, this, "", 3); + Console()->Register("reload", "", CFGFLAG_SERVER, ConMapReload, this, "", IConsole::CONSOLELEVEL_ADMIN); Console()->Chain("sv_name", ConchainSpecialInfoupdate, this); Console()->Chain("password", ConchainSpecialInfoupdate, this); Console()->Chain("sv_max_clients_per_ip", ConchainMaxclientsperipUpdate, this); - Console()->Register("login", "?s", CFGFLAG_SERVER, ConLogin, this, "Allows you access to rcon if no password is given, or changes your level if a password is given", -1); - Console()->Register("auth", "?s", CFGFLAG_SERVER, ConLogin, this, "Allows you access to rcon if no password is given, or changes your level if a password is given", -1); + Console()->Register("login", "?s", CFGFLAG_SERVER, ConLogin, this, "Allows you access to rcon if no password is given, or changes your level if a password is given", IConsole::CONSOLELEVEL_USER); + Console()->Register("auth", "?s", CFGFLAG_SERVER, ConLogin, this, "Allows you access to rcon if no password is given, or changes your level if a password is given", IConsole::CONSOLELEVEL_USER); - Console()->Register("cmdlist", "?i", CFGFLAG_SERVER, ConCmdList, this, "Shows you the commands available for your remote console access. Specify the level if you want to see other level's commands", -1); + Console()->Register("cmdlist", "?i", CFGFLAG_SERVER, ConCmdList, this, "Shows you the commands available for your remote console access. Specify the level if you want to see other level's commands", IConsole::CONSOLELEVEL_USER); } @@ -1704,17 +1704,17 @@ int main(int argc, const char **argv) // ignore_convention pServer->RegisterCommands(); pGameServer->OnConsoleInit(); - pConsole->ExecuteLine("tune_reset", 4, -1); - pConsole->ExecuteLine("tune gun_speed 1400", 4, -1); - pConsole->ExecuteLine("tune shotgun_curvature 0", 4, -1); - pConsole->ExecuteLine("tune shotgun_speed 500", 4, -1); - pConsole->ExecuteLine("tune shotgun_speeddiff 0", 4, -1); - pConsole->ExecuteLine("tune gun_curvature 0", 4, -1); - pConsole->ExecuteLine("sv_hit 1",4,-1); - pConsole->ExecuteLine("sv_npc 0",4,-1); - pConsole->ExecuteLine("sv_phook 1",4,-1); - pConsole->ExecuteLine("sv_endless_drag 0",4,-1); - pConsole->ExecuteLine("sv_old_laser 0",4,-1); + pConsole->ExecuteLine("tune_reset", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + pConsole->ExecuteLine("tune gun_speed 1400", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + pConsole->ExecuteLine("tune shotgun_curvature 0", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + pConsole->ExecuteLine("tune shotgun_speed 500", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + pConsole->ExecuteLine("tune shotgun_speeddiff 0", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + pConsole->ExecuteLine("tune gun_curvature 0", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + pConsole->ExecuteLine("sv_hit 1", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + pConsole->ExecuteLine("sv_npc 0", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + pConsole->ExecuteLine("sv_phook 1", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + pConsole->ExecuteLine("sv_endless_drag 0", IConsole::CONSOLELEVEL_SUPERADMIN, -1); + pConsole->ExecuteLine("sv_old_laser 0", IConsole::CONSOLELEVEL_SUPERADMIN, -1); // execute autoexec file pConsole->ExecuteFile("autoexec.cfg", 0, 0, 0, 0, 4); @@ -1744,15 +1744,8 @@ int main(int argc, const char **argv) // ignore_convention void CServer::SetRconLevel(int ClientID, int Level) { - if(Level < 0) - { - dbg_msg("server", "%s set to level 0. ClientID=%x ip=%d.%d.%d.%d",ClientName(ClientID), ClientID, m_aClients[ClientID].m_Addr.ip[0], m_aClients[ClientID].m_Addr.ip[1], m_aClients[ClientID].m_Addr.ip[2], m_aClients[ClientID].m_Addr.ip[3]); - CMsgPacker Msg(NETMSG_RCON_AUTH_STATUS); - Msg.AddInt(0); - SendMsgEx(&Msg, MSGFLAG_VITAL, ClientID, true); - m_aClients[ClientID].m_Authed = 0; - } - else + Level = clamp(Level, (int)IConsole::CONSOLELEVEL_USER, (int)IConsole::CONSOLELEVEL_ADMIN); + if(Level > IConsole::CONSOLELEVEL_USER) { dbg_msg("server", "%s set to level %d. ClientID=%x ip=%d.%d.%d.%d",ClientName(ClientID), Level, ClientID, m_aClients[ClientID].m_Addr.ip[0], m_aClients[ClientID].m_Addr.ip[1], m_aClients[ClientID].m_Addr.ip[2], m_aClients[ClientID].m_Addr.ip[3]); CMsgPacker Msg(NETMSG_RCON_AUTH_STATUS); @@ -1763,10 +1756,10 @@ void CServer::SetRconLevel(int ClientID, int Level) } } -void CServer::CheckPass(int ClientID, const char *pPw) +void CServer::CheckPass(int ClientID, const char *pPassword) { - if(pPw[0] != 0) + if(pPassword[0] != 0) { if(g_Config.m_SvRconPasswordHelper[0] == 0 && g_Config.m_SvRconPasswordModer[0] == 0 && @@ -1786,26 +1779,22 @@ void CServer::CheckPass(int ClientID, const char *pPw) SendRconLine(ClientID, "Authentication successful. Remote console access granted."); dbg_msg("server", "ClientID=%d authed", ClientID); }*/ - int level = -1; - if(str_comp(pPw, g_Config.m_SvRconPasswordHelper) == 0) + int Level = IConsole::CONSOLELEVEL_USER; + if(str_comp(pPassword, g_Config.m_SvRconPasswordModer) == 0) { - level = 1; + Level = IConsole::CONSOLELEVEL_MODERATOR; } - else if(str_comp(pPw, g_Config.m_SvRconPasswordModer) == 0) + else if(str_comp(pPassword, g_Config.m_SvRconPasswordAdmin) == 0) { - level = 2; + Level = IConsole::CONSOLELEVEL_ADMIN; } - else if(str_comp(pPw, g_Config.m_SvRconPasswordAdmin) == 0) - { - level = 3; - } - if(level != -1) + if(Level > IConsole::CONSOLELEVEL_USER) { char buf[128]="Authentication successful. Remote console access granted for ClientID=%d with level=%d"; - SetRconLevel(ClientID,level); - str_format(buf,sizeof(buf),buf,ClientID,level); + SetRconLevel(ClientID, Level); + str_format(buf,sizeof(buf),buf,ClientID,Level); SendRconLine(ClientID, buf); - dbg_msg("server", "'%s' ClientID=%d authed with Level=%d", ClientName(ClientID), ClientID, level); + dbg_msg("server", "'%s' ClientID=%d authed with Level=%d", ClientName(ClientID), ClientID, Level); } else if(g_Config.m_SvRconMaxTries) { @@ -1840,18 +1829,18 @@ void CServer::CheckPass(int ClientID, const char *pPw) }*/ else { - char buf[128]="Authentication successful. Remote console access granted for ClientID=%d with level=%d"; + char aBuf[128]="Authentication successful. Remote console access granted for ClientID=%d with level=%d"; SetRconLevel(ClientID,0); - str_format(buf,sizeof(buf),buf,ClientID,0); - SendRconLine(ClientID, buf); + str_format(aBuf, sizeof(aBuf), aBuf, ClientID, 0); + SendRconLine(ClientID, aBuf); dbg_msg("server", "'%s' ClientID=%d authed with Level=%d", ClientName(ClientID), ClientID, 0); } } -char *CServer::GetAnnouncementLine(char const *FileName) +char *CServer::GetAnnouncementLine(char const *pFileName) { - IOHANDLE File = m_pStorage->OpenFile(FileName, IOFLAG_READ, IStorage::TYPE_ALL); + IOHANDLE File = m_pStorage->OpenFile(pFileName, IOFLAG_READ, IStorage::TYPE_ALL); if(File) { std::vector v; diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index 3417585f9..b81514fcf 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -8,203 +8,203 @@ #include "././game/variables.h" -MACRO_CONFIG_STR(PlayerName, player_name, 24, "nameless tee", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Name of the player", -1) -MACRO_CONFIG_STR(ClanName, clan_name, 32, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "(not used)", -1) -MACRO_CONFIG_STR(Password, password, 32, "", CFGFLAG_CLIENT|CFGFLAG_SERVER, "Password to the server", 3) -MACRO_CONFIG_STR(Logfile, logfile, 128, "", CFGFLAG_SAVE|CFGFLAG_CLIENT|CFGFLAG_SERVER, "Filename to log all output to", 3) -MACRO_CONFIG_INT(ConsoleOutputLevel, console_output_level, 0, 0, 2, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Adjusts the amount of information in the console", 3) +MACRO_CONFIG_STR(PlayerName, player_name, 24, "nameless tee", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Name of the player", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_STR(ClanName, clan_name, 32, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "(not used)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_STR(Password, password, 32, "", CFGFLAG_CLIENT|CFGFLAG_SERVER, "Password to the server", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(Logfile, logfile, 128, "", CFGFLAG_SAVE|CFGFLAG_CLIENT|CFGFLAG_SERVER, "Filename to log all output to", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(ConsoleOutputLevel, console_output_level, 0, 0, 2, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Adjusts the amount of information in the console", IConsole::CONSOLELEVEL_ADMIN) -MACRO_CONFIG_INT(ClCpuThrottle, cl_cpu_throttle, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", -1) -MACRO_CONFIG_INT(ClEditor, cl_editor, 0, 0, 1, CFGFLAG_CLIENT, "", -1) +MACRO_CONFIG_INT(ClCpuThrottle, cl_cpu_throttle, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(ClEditor, cl_editor, 0, 0, 1, CFGFLAG_CLIENT, "", IConsole::CONSOLELEVEL_USER) -MACRO_CONFIG_INT(ClAutoDemoRecord, cl_auto_demo_record, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Automatically record demos", -1) -MACRO_CONFIG_INT(ClAutoDemoMax, cl_auto_demo_max, 10, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Maximum number of automatically recorded demos (0 = no limit)", -1) -MACRO_CONFIG_INT(ClAutoScreenshot, cl_auto_screenshot, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Automatically take game over screenshot", -1) -MACRO_CONFIG_INT(ClAutoScreenshotMax, cl_auto_screenshot_max, 10, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Maximum number of automatically created screenshots (0 = no limit)", -1) +MACRO_CONFIG_INT(ClAutoDemoRecord, cl_auto_demo_record, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Automatically record demos", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(ClAutoDemoMax, cl_auto_demo_max, 10, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Maximum number of automatically recorded demos (0 = no limit)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(ClAutoScreenshot, cl_auto_screenshot, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Automatically take game over screenshot", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(ClAutoScreenshotMax, cl_auto_screenshot_max, 10, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Maximum number of automatically created screenshots (0 = no limit)", IConsole::CONSOLELEVEL_USER) -MACRO_CONFIG_INT(ClEventthread, cl_eventthread, 0, 0, 1, CFGFLAG_CLIENT, "Enables the usage of a thread to pump the events", -1) +MACRO_CONFIG_INT(ClEventthread, cl_eventthread, 0, 0, 1, CFGFLAG_CLIENT, "Enables the usage of a thread to pump the events", IConsole::CONSOLELEVEL_USER) -MACRO_CONFIG_INT(InpGrab, inp_grab, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Use forceful input grabbing method", -1) +MACRO_CONFIG_INT(InpGrab, inp_grab, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Use forceful input grabbing method", IConsole::CONSOLELEVEL_USER) -MACRO_CONFIG_STR(BrFilterString, br_filter_string, 25, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering string", -1) +MACRO_CONFIG_STR(BrFilterString, br_filter_string, 25, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering string", IConsole::CONSOLELEVEL_USER) -MACRO_CONFIG_INT(BrFilterFull, br_filter_full, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out full server in browser", -1) -MACRO_CONFIG_INT(BrFilterEmpty, br_filter_empty, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out empty server in browser", -1) -MACRO_CONFIG_INT(BrFilterPw, br_filter_pw, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out password protected servers in browser", -1) -MACRO_CONFIG_INT(BrFilterPing, br_filter_ping, 999, 0, 999, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Ping to filter by in the server browser", -1) -MACRO_CONFIG_STR(BrFilterGametype, br_filter_gametype, 128, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Game types to filter", -1) -MACRO_CONFIG_INT(BrFilterPure, br_filter_pure, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out non-standard servers in browser", -1) -MACRO_CONFIG_INT(BrFilterPureMap, br_filter_pure_map, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out non-standard maps in browser", -1) -MACRO_CONFIG_INT(BrFilterCompatversion, br_filter_compatversion, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out non-compatible servers in browser", -1) +MACRO_CONFIG_INT(BrFilterFull, br_filter_full, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out full server in browser", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterEmpty, br_filter_empty, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out empty server in browser", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterPw, br_filter_pw, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out password protected servers in browser", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterPing, br_filter_ping, 999, 0, 999, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Ping to filter by in the server browser", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_STR(BrFilterGametype, br_filter_gametype, 128, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Game types to filter", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterPure, br_filter_pure, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out non-standard servers in browser", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterPureMap, br_filter_pure_map, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out non-standard maps in browser", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterCompatversion, br_filter_compatversion, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out non-compatible servers in browser", IConsole::CONSOLELEVEL_USER) -MACRO_CONFIG_INT(BrSort, br_sort, 0, 0, 256, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", -1) -MACRO_CONFIG_INT(BrSortOrder, br_sort_order, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", -1) -MACRO_CONFIG_INT(BrMaxRequests, br_max_requests, 25, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Number of requests to use when refreshing server browser", -1) +MACRO_CONFIG_INT(BrSort, br_sort, 0, 0, 256, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrSortOrder, br_sort_order, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrMaxRequests, br_max_requests, 25, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Number of requests to use when refreshing server browser", IConsole::CONSOLELEVEL_USER) -MACRO_CONFIG_INT(SndBufferSize, snd_buffer_size, 512, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound buffer size", -1) -MACRO_CONFIG_INT(SndRate, snd_rate, 48000, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound mixing rate", -1) -MACRO_CONFIG_INT(SndEnable, snd_enable, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound enable", -1) -MACRO_CONFIG_INT(SndVolume, snd_volume, 100, 0, 100, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound volume", -1) -MACRO_CONFIG_INT(SndDevice, snd_device, -1, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "(deprecated) Sound device to use", -1) +MACRO_CONFIG_INT(SndBufferSize, snd_buffer_size, 512, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound buffer size", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(SndRate, snd_rate, 48000, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound mixing rate", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(SndEnable, snd_enable, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound enable", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(SndVolume, snd_volume, 100, 0, 100, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound volume", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(SndDevice, snd_device, -1, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "(deprecated) Sound device to use", IConsole::CONSOLELEVEL_USER) -MACRO_CONFIG_INT(SndNonactiveMute, snd_nonactive_mute, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", -1) +MACRO_CONFIG_INT(SndNonactiveMute, snd_nonactive_mute, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", IConsole::CONSOLELEVEL_USER) -MACRO_CONFIG_INT(GfxScreenWidth, gfx_screen_width, 800, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Screen resolution width", -1) -MACRO_CONFIG_INT(GfxScreenHeight, gfx_screen_height, 600, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Screen resolution height", -1) -MACRO_CONFIG_INT(GfxFullscreen, gfx_fullscreen, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Fullscreen", -1) -MACRO_CONFIG_INT(GfxAlphabits, gfx_alphabits, 0, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Alpha bits for framebuffer (fullscreen only)", -1) -MACRO_CONFIG_INT(GfxColorDepth, gfx_color_depth, 24, 16, 24, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Colors bits for framebuffer (fullscreen only)", -1) -MACRO_CONFIG_INT(GfxClear, gfx_clear, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Clear screen before rendering", -1) -MACRO_CONFIG_INT(GfxVsync, gfx_vsync, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Vertical sync", -1) -MACRO_CONFIG_INT(GfxDisplayAllModes, gfx_display_all_modes, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", -1) -MACRO_CONFIG_INT(GfxTextureCompression, gfx_texture_compression, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Use texture compression", -1) -MACRO_CONFIG_INT(GfxHighDetail, gfx_high_detail, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "High detail", -1) -MACRO_CONFIG_INT(GfxTextureQuality, gfx_texture_quality, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", -1) -MACRO_CONFIG_INT(GfxFsaaSamples, gfx_fsaa_samples, 0, 0, 16, CFGFLAG_SAVE|CFGFLAG_CLIENT, "FSAA Samples", -1) -MACRO_CONFIG_INT(GfxRefreshRate, gfx_refresh_rate, 0, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Screen refresh rate", -1) -MACRO_CONFIG_INT(GfxFinish, gfx_finish, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", -1) +MACRO_CONFIG_INT(GfxScreenWidth, gfx_screen_width, 800, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Screen resolution width", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(GfxScreenHeight, gfx_screen_height, 600, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Screen resolution height", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(GfxFullscreen, gfx_fullscreen, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Fullscreen", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(GfxAlphabits, gfx_alphabits, 0, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Alpha bits for framebuffer (fullscreen only)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(GfxColorDepth, gfx_color_depth, 24, 16, 24, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Colors bits for framebuffer (fullscreen only)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(GfxClear, gfx_clear, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Clear screen before rendering", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(GfxVsync, gfx_vsync, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Vertical sync", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(GfxDisplayAllModes, gfx_display_all_modes, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(GfxTextureCompression, gfx_texture_compression, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Use texture compression", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(GfxHighDetail, gfx_high_detail, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "High detail", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(GfxTextureQuality, gfx_texture_quality, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(GfxFsaaSamples, gfx_fsaa_samples, 0, 0, 16, CFGFLAG_SAVE|CFGFLAG_CLIENT, "FSAA Samples", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(GfxRefreshRate, gfx_refresh_rate, 0, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Screen refresh rate", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(GfxFinish, gfx_finish, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "", IConsole::CONSOLELEVEL_USER) -MACRO_CONFIG_INT(InpMousesens, inp_mousesens, 100, 5, 100000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Mouse sensitivity", -1) +MACRO_CONFIG_INT(InpMousesens, inp_mousesens, 100, 5, 100000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Mouse sensitivity", IConsole::CONSOLELEVEL_USER) -MACRO_CONFIG_STR(SvName, sv_name, 128, "DDRace Test Trunk 0.5 Server", CFGFLAG_SERVER, "Server name", 3) -MACRO_CONFIG_STR(SvBindaddr, sv_bindaddr, 128, "", CFGFLAG_SERVER, "Address to bind the server to", 3) -MACRO_CONFIG_INT(SvPort, sv_port, 8303, 0, 0, CFGFLAG_SERVER, "Port to use for the server", 3) -MACRO_CONFIG_INT(SvExternalPort, sv_external_port, 0, 0, 0, CFGFLAG_SERVER, "External port to report to the master servers", 3) -MACRO_CONFIG_STR(SvMap, sv_map, 128, "Test", CFGFLAG_SERVER, "Map to use on the server", 3) -MACRO_CONFIG_INT(SvMaxClients, sv_max_clients, 16, 1, MAX_CLIENTS, CFGFLAG_SERVER, "Maximum number of clients that are allowed on a server", 3) -MACRO_CONFIG_INT(SvMaxClientsPerIP, sv_max_clients_per_ip, 2, 1, MAX_CLIENTS, CFGFLAG_SERVER, "Maximum number of clients with the same IP that can connect to the server", 3) -MACRO_CONFIG_INT(SvHighBandwidth, sv_high_bandwidth, 0, 0, 1, CFGFLAG_SERVER, "Use high bandwidth mode. Doubles the bandwidth required for the server. LAN use only", 3) -MACRO_CONFIG_INT(SvRegister, sv_register, 1, 0, 1, CFGFLAG_SERVER, "Register server with master server for public listing", 3) +MACRO_CONFIG_STR(SvName, sv_name, 128, "DDRace Test Trunk 0.5 Server", CFGFLAG_SERVER, "Server name", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvBindaddr, sv_bindaddr, 128, "", CFGFLAG_SERVER, "Address to bind the server to", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvPort, sv_port, 8303, 0, 0, CFGFLAG_SERVER, "Port to use for the server", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvExternalPort, sv_external_port, 0, 0, 0, CFGFLAG_SERVER, "External port to report to the master servers", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvMap, sv_map, 128, "Test", CFGFLAG_SERVER, "Map to use on the server", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvMaxClients, sv_max_clients, 16, 1, MAX_CLIENTS, CFGFLAG_SERVER, "Maximum number of clients that are allowed on a server", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvMaxClientsPerIP, sv_max_clients_per_ip, 2, 1, MAX_CLIENTS, CFGFLAG_SERVER, "Maximum number of clients with the same IP that can connect to the server", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvHighBandwidth, sv_high_bandwidth, 0, 0, 1, CFGFLAG_SERVER, "Use high bandwidth mode. Doubles the bandwidth required for the server. LAN use only", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvRegister, sv_register, 1, 0, 1, CFGFLAG_SERVER, "Register server with master server for public listing", IConsole::CONSOLELEVEL_ADMIN) //MACRO_CONFIG_STR(SvRconPassword, sv_rcon_password, 32, "", CFGFLAG_SERVER, "Remote console password") -MACRO_CONFIG_INT(SvRconMaxTries, sv_rcon_max_tries, 20, 0, 100, CFGFLAG_SERVER, "Maximum number of tries for remote console authentication", 3) -MACRO_CONFIG_INT(SvRconBantime, sv_rcon_bantime, 5, 0, 1440, CFGFLAG_SERVER, "The time a client gets banned if remote console authentication fails. 0 makes it just use kick", 3) +MACRO_CONFIG_INT(SvRconMaxTries, sv_rcon_max_tries, 20, 0, 100, CFGFLAG_SERVER, "Maximum number of tries for remote console authentication", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvRconBantime, sv_rcon_bantime, 5, 0, 1440, CFGFLAG_SERVER, "The time a client gets banned if remote console authentication fails. 0 makes it just use kick", IConsole::CONSOLELEVEL_ADMIN) -MACRO_CONFIG_INT(Debug, debug, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Debug mode", 3) -MACRO_CONFIG_INT(DbgStress, dbg_stress, 0, 0, 0, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Stress systems", 3) -MACRO_CONFIG_INT(DbgStressNetwork, dbg_stress_network, 0, 0, 0, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Stress network", 3) -MACRO_CONFIG_INT(DbgPref, dbg_pref, 0, 0, 1, CFGFLAG_SERVER, "Performance outputs", 3) -MACRO_CONFIG_INT(DbgGraphs, dbg_graphs, 0, 0, 1, CFGFLAG_CLIENT, "Performance graphs", -1) -MACRO_CONFIG_INT(DbgHitch, dbg_hitch, 0, 0, 0, CFGFLAG_SERVER, "Hitch warnings", 3) -MACRO_CONFIG_STR(DbgStressServer, dbg_stress_server, 32, "localhost", CFGFLAG_CLIENT, "Server to stress", -1) -MACRO_CONFIG_INT(DbgResizable, dbg_resizable, 0, 0, 0, CFGFLAG_CLIENT, "Enables window resizing", -1) +MACRO_CONFIG_INT(Debug, debug, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Debug mode", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(DbgStress, dbg_stress, 0, 0, 0, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Stress systems", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(DbgStressNetwork, dbg_stress_network, 0, 0, 0, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Stress network", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(DbgPref, dbg_pref, 0, 0, 1, CFGFLAG_SERVER, "Performance outputs", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(DbgGraphs, dbg_graphs, 0, 0, 1, CFGFLAG_CLIENT, "Performance graphs", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(DbgHitch, dbg_hitch, 0, 0, 0, CFGFLAG_SERVER, "Hitch warnings", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(DbgStressServer, dbg_stress_server, 32, "localhost", CFGFLAG_CLIENT, "Server to stress", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(DbgResizable, dbg_resizable, 0, 0, 0, CFGFLAG_CLIENT, "Enables window resizing", IConsole::CONSOLELEVEL_USER) //DDRace -MACRO_CONFIG_STR(SvWelcome, sv_welcome, 64, "", CFGFLAG_SERVER, "Message that will be displayed to players who join the server", 3) -MACRO_CONFIG_STR(SvBroadcast, sv_broadcast, 64, "DDRace.info Trunk 0.5", CFGFLAG_SERVER, "The broadcasting message", 3) -MACRO_CONFIG_INT(SvReservedSlots, sv_reserved_slots, 0, 0, 16, CFGFLAG_SERVER, "The number of slots that are reserved for special players", 3) -MACRO_CONFIG_STR(SvReservedSlotsPass, sv_reserved_slots_pass, 32, "", CFGFLAG_SERVER, "The password that is required to use a reserved slot", 3) -MACRO_CONFIG_STR(SvRconPasswordAdmin, sv_admin_pass, 32, "", CFGFLAG_SERVER, "Remote console administrator password", 4) -MACRO_CONFIG_STR(SvRconPasswordModer, sv_mod_pass, 32, "", CFGFLAG_SERVER, "Remote console moderator password", 4) -MACRO_CONFIG_STR(SvRconPasswordHelper, sv_helper_pass, 32, "", CFGFLAG_SERVER, "Remote console helper password", 4) -MACRO_CONFIG_INT(SvHit, sv_hit, 1, 0, 1, CFGFLAG_SERVER, "Whether players can hammer/grenade/laser eachother or not", 4) -MACRO_CONFIG_INT(SvEndlessDrag, sv_endless_drag, 0, 0, 1, CFGFLAG_SERVER, "Turns endless hooking on/off", 4) +MACRO_CONFIG_STR(SvWelcome, sv_welcome, 64, "", CFGFLAG_SERVER, "Message that will be displayed to players who join the server", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvBroadcast, sv_broadcast, 64, "DDRace.info Trunk 0.5", CFGFLAG_SERVER, "The broadcasting message", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvReservedSlots, sv_reserved_slots, 0, 0, 16, CFGFLAG_SERVER, "The number of slots that are reserved for special players", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvReservedSlotsPass, sv_reserved_slots_pass, 32, "", CFGFLAG_SERVER, "The password that is required to use a reserved slot", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvRconPasswordAdmin, sv_admin_pass, 32, "", CFGFLAG_SERVER, "Remote console administrator password", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvRconPasswordModer, sv_mod_pass, 32, "", CFGFLAG_SERVER, "Remote console moderator password", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvRconPasswordHelper, sv_helper_pass, 32, "", CFGFLAG_SERVER, "Remote console helper password", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvHit, sv_hit, 1, 0, 1, CFGFLAG_SERVER, "Whether players can hammer/grenade/laser eachother or not", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvEndlessDrag, sv_endless_drag, 0, 0, 1, CFGFLAG_SERVER, "Turns endless hooking on/off", IConsole::CONSOLELEVEL_ADMIN) -MACRO_CONFIG_INT(SvMapTest, sv_map_test, 0, 0, 1, CFGFLAG_SERVER, "Whether this server is just for map testing", 3) +MACRO_CONFIG_INT(SvMapTest, sv_map_test, 0, 0, 1, CFGFLAG_SERVER, "Whether this server is just for map testing", IConsole::CONSOLELEVEL_ADMIN) #ifndef CONF_DEBUG -MACRO_CONFIG_INT(SvServerTest, sv_server_test, 0, 0, 0, CFGFLAG_SERVER, "Whether this server is for testing the mod (only available for debug compilation)", 4) +MACRO_CONFIG_INT(SvServerTest, sv_server_test, 0, 0, 0, CFGFLAG_SERVER, "Whether this server is for testing the mod (only available for debug compilation)", IConsole::CONSOLELEVEL_ADMIN) #else -MACRO_CONFIG_INT(SvServerTest, sv_server_test, 1, 0, 1, CFGFLAG_SERVER, "Whether this server is for testing the mod (only available for debug compilation)", 4) +MACRO_CONFIG_INT(SvServerTest, sv_server_test, 1, 0, 1, CFGFLAG_SERVER, "Whether this server is for testing the mod (only available for debug compilation)", IConsole::CONSOLELEVEL_ADMIN) #endif -MACRO_CONFIG_INT(SvCheats, sv_cheats, 0, 0, 1, CFGFLAG_SERVER, "Turns cheats on/off", 4) -MACRO_CONFIG_INT(SvFreezeDelay, sv_freeze_delay, 3, 1, 30, CFGFLAG_SERVER, "How many seconds the players will remain frozen (applies to all except delayed freeze in switch layer & deepfreeze)", 4) -MACRO_CONFIG_INT(ClDDRaceCheats, cl_race_cheats, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Enable Cheats Such as Zoom",0) -MACRO_CONFIG_INT(ClDDRaceBinds, cl_race_binds, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Enable Default DDrace builds when pressing the reset binds button",0) -MACRO_CONFIG_INT(SvCheatTime, sv_cheattime, 0, 0, 1, CFGFLAG_SERVER, "Whether the time of players will be stopped on cheating or not", 4) -MACRO_CONFIG_INT(SvEndlessSuperHook, sv_endless_super_hook, 0, 0, 1, CFGFLAG_SERVER, "Endless hook for super players on/off", 4) +MACRO_CONFIG_INT(SvCheats, sv_cheats, 0, 0, 1, CFGFLAG_SERVER, "Turns cheats on/off", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvFreezeDelay, sv_freeze_delay, 3, 1, 30, CFGFLAG_SERVER, "How many seconds the players will remain frozen (applies to all except delayed freeze in switch layer & deepfreeze)", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(ClDDRaceCheats, cl_race_cheats, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Enable Cheats Such as Zoom",IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(ClDDRaceBinds, cl_race_binds, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Enable Default DDrace builds when pressing the reset binds button",IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(SvCheatTime, sv_cheattime, 0, 0, 1, CFGFLAG_SERVER, "Whether the time of players will be stopped on cheating or not", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvEndlessSuperHook, sv_endless_super_hook, 0, 0, 1, CFGFLAG_SERVER, "Endless hook for super players on/off", IConsole::CONSOLELEVEL_ADMIN) -//MACRO_CONFIG_INT(SvAllowColorChange, sv_allow_color_change, 1, 0, 1, CFGFLAG_SERVER, "Whether color change is allowed (to block rainbow mod)", 3) -MACRO_CONFIG_INT(SvHideScore, sv_hide_score, 0, 0, 1, CFGFLAG_SERVER, "Whether players scores will be announced or not", 4) -MACRO_CONFIG_INT(SvTimer, sv_timer, 0, 0, 1, CFGFLAG_SERVER, "Whether timer commands are allowed or not", 3) -MACRO_CONFIG_INT(SvPauseable, sv_pauseable, 1, 0, 1, CFGFLAG_SERVER, "Whether players can pause their char or not", 3) -MACRO_CONFIG_INT(SvPauseTime, sv_pause_time, 0, 0, 1, CFGFLAG_SERVER, "Whether '/pause' and 'sv_max_dc_restore' pauses the time of player or not", 3) -MACRO_CONFIG_INT(SvPauseFrequency, sv_pause_frequency, 5, 0, 9999, CFGFLAG_SERVER, "The minimum allowed delay between pauses", 3) +//MACRO_CONFIG_INT(SvAllowColorChange, sv_allow_color_change, 1, 0, 1, CFGFLAG_SERVER, "Whether color change is allowed (to block rainbow mod)", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvHideScore, sv_hide_score, 0, 0, 1, CFGFLAG_SERVER, "Whether players scores will be announced or not", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvTimer, sv_timer, 0, 0, 1, CFGFLAG_SERVER, "Whether timer commands are allowed or not", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvPauseable, sv_pauseable, 1, 0, 1, CFGFLAG_SERVER, "Whether players can pause their char or not", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvPauseTime, sv_pause_time, 0, 0, 1, CFGFLAG_SERVER, "Whether '/pause' and 'sv_max_dc_restore' pauses the time of player or not", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvPauseFrequency, sv_pause_frequency, 5, 0, 9999, CFGFLAG_SERVER, "The minimum allowed delay between pauses", IConsole::CONSOLELEVEL_ADMIN) -MACRO_CONFIG_INT(SvEmotionalTees, sv_emotional_tees, 1, 0, 1, CFGFLAG_SERVER, "Whether eye change of tees is enabled or not", 3) -MACRO_CONFIG_INT(SvEmoticonDelay, sv_emoticon_delay, 3, 0, 9999, CFGFLAG_SERVER, "The time in seconds between over-head emoticons", 3) +MACRO_CONFIG_INT(SvEmotionalTees, sv_emotional_tees, 1, 0, 1, CFGFLAG_SERVER, "Whether eye change of tees is enabled or not", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvEmoticonDelay, sv_emoticon_delay, 3, 0, 9999, CFGFLAG_SERVER, "The time in seconds between over-head emoticons", IConsole::CONSOLELEVEL_ADMIN) -MACRO_CONFIG_INT(SvChatDelay, sv_chat_delay, 1, 0, 9999, CFGFLAG_SERVER, "The time in seconds between chat messages", 3) -MACRO_CONFIG_INT(SvTeamChangeDelay, sv_team_change_delay, 3, 0, 9999, CFGFLAG_SERVER, "The time in seconds between team changes (spectator/in game)", 3) -MACRO_CONFIG_INT(SvInfoChangeDelay, sv_info_change_delay, 5, 0, 9999, CFGFLAG_SERVER, "The time in seconds between info changes (name/skin/color), to avoid ranbow mod set this to a very high time", 3) -MACRO_CONFIG_INT(SvVoteMapTimeDelay, sv_vote_map_delay,0,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between map votes", 3) -MACRO_CONFIG_INT(SvVoteDelay, sv_vote_delay, 3, 0, 9999, CFGFLAG_SERVER, "The time in seconds between any vote", 3) -MACRO_CONFIG_INT(SvVoteKickTimeDelay, sv_vote_kick_delay, 0, 0, 9999, CFGFLAG_SERVER, "The minimum time in seconds between kick votes", 3) -MACRO_CONFIG_INT(SvVoteYesPercentage, sv_vote_yes_percentage, 50, 1, 100, CFGFLAG_SERVER, "The percent of people that need to agree or deny for the vote to succeed/fail", 4) -MACRO_CONFIG_INT(SvVoteMajority, sv_vote_majority, 0, 0, 1, CFGFLAG_SERVER, "Whether No. of Yes is compared to No. of No votes or to number of total Players ( Default is 0 Y compare N)", 4) -MACRO_CONFIG_INT(SvSpectatorVotes, sv_spectator_votes, 1, 0, 1, CFGFLAG_SERVER, "Choose if spectators are allowed to start votes", 3) -MACRO_CONFIG_INT(SvKillDelay, sv_kill_delay,3,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between kills", 3) -MACRO_CONFIG_INT(SvSuicidePenalty, sv_suicide_penalty,0,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between kill or /kills and respawn", 3) +MACRO_CONFIG_INT(SvChatDelay, sv_chat_delay, 1, 0, 9999, CFGFLAG_SERVER, "The time in seconds between chat messages", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvTeamChangeDelay, sv_team_change_delay, 3, 0, 9999, CFGFLAG_SERVER, "The time in seconds between team changes (spectator/in game)", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvInfoChangeDelay, sv_info_change_delay, 5, 0, 9999, CFGFLAG_SERVER, "The time in seconds between info changes (name/skin/color), to avoid ranbow mod set this to a very high time", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvVoteMapTimeDelay, sv_vote_map_delay,0,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between map votes", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvVoteDelay, sv_vote_delay, 3, 0, 9999, CFGFLAG_SERVER, "The time in seconds between any vote", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvVoteKickTimeDelay, sv_vote_kick_delay, 0, 0, 9999, CFGFLAG_SERVER, "The minimum time in seconds between kick votes", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvVoteYesPercentage, sv_vote_yes_percentage, 50, 1, 100, CFGFLAG_SERVER, "The percent of people that need to agree or deny for the vote to succeed/fail", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvVoteMajority, sv_vote_majority, 0, 0, 1, CFGFLAG_SERVER, "Whether No. of Yes is compared to No. of No votes or to number of total Players ( Default is 0 Y compare N)", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvSpectatorVotes, sv_spectator_votes, 1, 0, 1, CFGFLAG_SERVER, "Choose if spectators are allowed to start votes", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvKillDelay, sv_kill_delay,3,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between kills", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvSuicidePenalty, sv_suicide_penalty,0,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between kill or /kills and respawn", IConsole::CONSOLELEVEL_ADMIN) -MACRO_CONFIG_INT(SvShotgunBulletSound, sv_shotgun_bullet_sound, 0, 0, 1, CFGFLAG_SERVER, "Crazy shotgun bullet sound on/off", 3) +MACRO_CONFIG_INT(SvShotgunBulletSound, sv_shotgun_bullet_sound, 0, 0, 1, CFGFLAG_SERVER, "Crazy shotgun bullet sound on/off", IConsole::CONSOLELEVEL_ADMIN) -MACRO_CONFIG_INT(SvCheckpointSave, sv_checkpoint_save, 1, 0, 1, CFGFLAG_SERVER, "Whether to save checkpoint times to the score file", 3) -MACRO_CONFIG_STR(SvScoreFolder, sv_score_folder, 32, "records", CFGFLAG_SERVER, "Folder to save score files to", 3) +MACRO_CONFIG_INT(SvCheckpointSave, sv_checkpoint_save, 1, 0, 1, CFGFLAG_SERVER, "Whether to save checkpoint times to the score file", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvScoreFolder, sv_score_folder, 32, "records", CFGFLAG_SERVER, "Folder to save score files to", IConsole::CONSOLELEVEL_ADMIN) #if defined(CONF_SQL) -MACRO_CONFIG_INT(SvUseSQL, sv_use_sql, 0, 0, 1, CFGFLAG_SERVER, "Enables SQL DB instead of record file", 4) -MACRO_CONFIG_STR(SvSqlUser, sv_sql_user, 32, "nameless", CFGFLAG_SERVER, "SQL User", 4) -MACRO_CONFIG_STR(SvSqlPw, sv_sql_pw, 32, "tee", CFGFLAG_SERVER, "SQL Password", 4) -MACRO_CONFIG_STR(SvSqlIp, sv_sql_ip, 32, "127.0.0.1", CFGFLAG_SERVER, "SQL Database IP", 4) -MACRO_CONFIG_INT(SvSqlPort, sv_sql_port, 3306, 0, 65535, CFGFLAG_SERVER, "SQL Database port", 4) -MACRO_CONFIG_STR(SvSqlDatabase, sv_sql_database, 16, "teeworlds", CFGFLAG_SERVER, "SQL Database name", 4) -MACRO_CONFIG_STR(SvSqlPrefix, sv_sql_prefix, 16, "record", CFGFLAG_SERVER, "SQL Database table prefix", 4) +MACRO_CONFIG_INT(SvUseSQL, sv_use_sql, 0, 0, 1, CFGFLAG_SERVER, "Enables SQL DB instead of record file", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvSqlUser, sv_sql_user, 32, "nameless", CFGFLAG_SERVER, "SQL User", IConsole::CONSOLELEVEL_SUPERADMIN) +MACRO_CONFIG_STR(SvSqlPw, sv_sql_pw, 32, "tee", CFGFLAG_SERVER, "SQL Password", IConsole::CONSOLELEVEL_SUPERADMIN) +MACRO_CONFIG_STR(SvSqlIp, sv_sql_ip, 32, "127.0.0.1", CFGFLAG_SERVER, "SQL Database IP", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvSqlPort, sv_sql_port, 3306, 0, 65535, CFGFLAG_SERVER, "SQL Database port", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvSqlDatabase, sv_sql_database, 16, "teeworlds", CFGFLAG_SERVER, "SQL Database name", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvSqlPrefix, sv_sql_prefix, 16, "record", CFGFLAG_SERVER, "SQL Database table prefix", IConsole::CONSOLELEVEL_ADMIN) #endif -MACRO_CONFIG_INT(SvDDRaceRules, sv_ddrace_rules, 1, 0, 1, CFGFLAG_SERVER, "Whether the default mod rules are displayed or not", 4) -MACRO_CONFIG_STR(SvRulesLine1, sv_rules_line1, 40, "", CFGFLAG_SERVER, "Rules line 1", 4) -MACRO_CONFIG_STR(SvRulesLine2, sv_rules_line2, 40, "", CFGFLAG_SERVER, "Rules line 2", 4) -MACRO_CONFIG_STR(SvRulesLine3, sv_rules_line3, 40, "", CFGFLAG_SERVER, "Rules line 3", 4) -MACRO_CONFIG_STR(SvRulesLine4, sv_rules_line4, 40, "", CFGFLAG_SERVER, "Rules line 4", 4) -MACRO_CONFIG_STR(SvRulesLine5, sv_rules_line5, 40, "", CFGFLAG_SERVER, "Rules line 5", 4) -MACRO_CONFIG_STR(SvRulesLine6, sv_rules_line6, 40, "", CFGFLAG_SERVER, "Rules line 6", 4) -MACRO_CONFIG_STR(SvRulesLine7, sv_rules_line7, 40, "", CFGFLAG_SERVER, "Rules line 7", 4) -MACRO_CONFIG_STR(SvRulesLine8, sv_rules_line8, 40, "", CFGFLAG_SERVER, "Rules line 8", 4) -MACRO_CONFIG_STR(SvRulesLine9, sv_rules_line9, 40, "", CFGFLAG_SERVER, "Rules line 9", 4) -MACRO_CONFIG_STR(SvRulesLine10, sv_rules_line10, 40, "", CFGFLAG_SERVER, "Rules line 10", 4) -//MACRO_CONFIG_INT(SvReconnectTime, sv_reconnect_time,5,0,9999,CFGFLAG_SERVER, "The time in seconds between leaves and joins of clients with the same ip", 3) +MACRO_CONFIG_INT(SvDDRaceRules, sv_ddrace_rules, 1, 0, 1, CFGFLAG_SERVER, "Whether the default mod rules are displayed or not", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvRulesLine1, sv_rules_line1, 40, "", CFGFLAG_SERVER, "Rules line 1", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvRulesLine2, sv_rules_line2, 40, "", CFGFLAG_SERVER, "Rules line 2", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvRulesLine3, sv_rules_line3, 40, "", CFGFLAG_SERVER, "Rules line 3", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvRulesLine4, sv_rules_line4, 40, "", CFGFLAG_SERVER, "Rules line 4", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvRulesLine5, sv_rules_line5, 40, "", CFGFLAG_SERVER, "Rules line 5", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvRulesLine6, sv_rules_line6, 40, "", CFGFLAG_SERVER, "Rules line 6", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvRulesLine7, sv_rules_line7, 40, "", CFGFLAG_SERVER, "Rules line 7", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvRulesLine8, sv_rules_line8, 40, "", CFGFLAG_SERVER, "Rules line 8", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvRulesLine9, sv_rules_line9, 40, "", CFGFLAG_SERVER, "Rules line 9", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_STR(SvRulesLine10, sv_rules_line10, 40, "", CFGFLAG_SERVER, "Rules line 10", IConsole::CONSOLELEVEL_ADMIN) +//MACRO_CONFIG_INT(SvReconnectTime, sv_reconnect_time,5,0,9999,CFGFLAG_SERVER, "The time in seconds between leaves and joins of clients with the same ip", IConsole::CONSOLELEVEL_ADMIN) -MACRO_CONFIG_INT(SvTeam, sv_team, 1, 0, 2, CFGFLAG_SERVER, "Teams configuration (0 = off, 1 = on but optional, 2 = must play only with teams)", 4) +MACRO_CONFIG_INT(SvTeam, sv_team, 1, 0, 2, CFGFLAG_SERVER, "Teams configuration (0 = off, 1 = on but optional, 2 = must play only with teams)", IConsole::CONSOLELEVEL_ADMIN) -MACRO_CONFIG_STR(SvAnnouncementFileName, sv_announcement_filename, 24, "announcement.txt", CFGFLAG_SERVER, "file which will have the announcement, each one at a line", 3) -MACRO_CONFIG_INT(SvAnnouncementInterval, sv_announcement_interval, 30, 15, 9999, CFGFLAG_SERVER, "time(minutes) in which the announcement will be displayed from the announcement file", 3) -MACRO_CONFIG_INT(SvAnnouncementRandom, sv_announcement_random, 1, 0, 1, CFGFLAG_SERVER, "Whether announcements are sequential or random", 3) +MACRO_CONFIG_STR(SvAnnouncementFileName, sv_announcement_filename, 24, "announcement.txt", CFGFLAG_SERVER, "file which will have the announcement, each one at a line", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvAnnouncementInterval, sv_announcement_interval, 30, 15, 9999, CFGFLAG_SERVER, "time(minutes) in which the announcement will be displayed from the announcement file", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvAnnouncementRandom, sv_announcement_random, 1, 0, 1, CFGFLAG_SERVER, "Whether announcements are sequential or random", IConsole::CONSOLELEVEL_ADMIN) -MACRO_CONFIG_INT(SvOldLaser, sv_old_laser, 0, 0, 1, CFGFLAG_SERVER, "Whether lasers can hit you if you shot them and that they pull you towards the bounce origin (0 for DDRace Beta) or lasers can't hit you if you shot them, and they pull others towards the shooter", 4) -MACRO_CONFIG_INT(SvSlashMe, sv_slash_me, 0, 0, 1, CFGFLAG_SERVER, "Whether /me is active on the server or not", 4) +MACRO_CONFIG_INT(SvOldLaser, sv_old_laser, 0, 0, 1, CFGFLAG_SERVER, "Whether lasers can hit you if you shot them and that they pull you towards the bounce origin (0 for DDRace Beta) or lasers can't hit you if you shot them, and they pull others towards the shooter", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvSlashMe, sv_slash_me, 0, 0, 1, CFGFLAG_SERVER, "Whether /me is active on the server or not", IConsole::CONSOLELEVEL_ADMIN) -MACRO_CONFIG_INT(ConnTimeout, conn_timeout, 15, 5, 100, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Network timeout", 4) +MACRO_CONFIG_INT(ConnTimeout, conn_timeout, 15, 5, 100, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Network timeout", IConsole::CONSOLELEVEL_ADMIN) -MACRO_CONFIG_INT(DbgMsg, dbg_msg, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Display or not debug messages", 3) -MACRO_CONFIG_INT(ClShowIDs, cl_show_ids, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Whether to show client ids in scoreboard", -1) -MACRO_CONFIG_INT(BrFilterGametypeStrict, br_filter_gametype_strict, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter game type strict", -1) -MACRO_CONFIG_INT(BrFilterCheats, br_filter_cheats, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering cheats (default: 0 don't care, 1 must be Off, 2 must be On)", -1) -MACRO_CONFIG_INT(BrFilterCheatTime, br_filter_cheat_time, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering cheats with time (default: 0 don't care, 1 must be Off, 2 must be On)", -1) -MACRO_CONFIG_INT(BrFilterTeams, br_filter_teams, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering teams (default: 0 don't care, 1 must be Off, 2 must be On)", -1) -MACRO_CONFIG_INT(BrFilterTeamsStrict, br_filter_teams_strict, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering teams strictness (default: 0 don't care, 1 must be Off, 2 must be On)", -1) -MACRO_CONFIG_INT(BrFilterPause, br_filter_pause, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering Pause (default: 0 don't care, 1 must be Off, 2 must be On)", -1) -MACRO_CONFIG_INT(BrFilterPauseTime, br_filter_pause_time, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering teams Pause with time (default: 0 don't care, 1 must be Off, 2 must be On)", -1) -MACRO_CONFIG_INT(BrFilterPlayerCollision, br_filter_player_collision, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering player collision (default: 0 don't care, 1 must be Off, 2 must be On)", -1) -MACRO_CONFIG_INT(BrFilterPlayerHooking, br_filter_player_hooking, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering player hooking (default: 0 don't care, 1 must be Off, 2 must be On)", -1) -MACRO_CONFIG_INT(BrFilterPlayerHitting, br_filter_player_hitting, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering player hitting (default: 0 don't care, 1 must be Off, 2 must be On)", -1) -MACRO_CONFIG_INT(BrFilterEndlessHooking, br_filter_endless_hooking, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering player endless hooking (default: 0 don't care, 1 must be Off, 2 must be On)", -1) -MACRO_CONFIG_INT(BrFilterTestMap, br_filter_test_map, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering Test Maps (default: 0 don't care, 1 must be Off, 2 must be On)", -1) -MACRO_CONFIG_INT(BrFilterTestServer, br_filter_test_server, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering Test Servers (default: 0 don't care, 1 must be Off, 2 must be On)", -1) +MACRO_CONFIG_INT(DbgMsg, dbg_msg, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Display or not debug messages", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(ClShowIDs, cl_show_ids, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Whether to show client ids in scoreboard", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterGametypeStrict, br_filter_gametype_strict, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter game type strict", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterCheats, br_filter_cheats, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering cheats (default: 0 don't care, 1 must be Off, 2 must be On)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterCheatTime, br_filter_cheat_time, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering cheats with time (default: 0 don't care, 1 must be Off, 2 must be On)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterTeams, br_filter_teams, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering teams (default: 0 don't care, 1 must be Off, 2 must be On)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterTeamsStrict, br_filter_teams_strict, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering teams strictness (default: 0 don't care, 1 must be Off, 2 must be On)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterPause, br_filter_pause, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering Pause (default: 0 don't care, 1 must be Off, 2 must be On)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterPauseTime, br_filter_pause_time, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering teams Pause with time (default: 0 don't care, 1 must be Off, 2 must be On)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterPlayerCollision, br_filter_player_collision, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering player collision (default: 0 don't care, 1 must be Off, 2 must be On)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterPlayerHooking, br_filter_player_hooking, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering player hooking (default: 0 don't care, 1 must be Off, 2 must be On)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterPlayerHitting, br_filter_player_hitting, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering player hitting (default: 0 don't care, 1 must be Off, 2 must be On)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterEndlessHooking, br_filter_endless_hooking, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering player endless hooking (default: 0 don't care, 1 must be Off, 2 must be On)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterTestMap, br_filter_test_map, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering Test Maps (default: 0 don't care, 1 must be Off, 2 must be On)", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(BrFilterTestServer, br_filter_test_server, 0, 0, 2, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering Test Servers (default: 0 don't care, 1 must be Off, 2 must be On)", IConsole::CONSOLELEVEL_USER) -MACRO_CONFIG_INT(ClAutoRaceRecord, cl_auto_race_record, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Save the best demo of each race", -1) -MACRO_CONFIG_INT(ClDemoName, cl_demo_name, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Save the player name within the demo", -1) -MACRO_CONFIG_INT(ClRaceGhost, cl_race_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Enable ghost", -1) -MACRO_CONFIG_INT(ClRaceShowGhost, cl_race_show_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ghost", -1) -MACRO_CONFIG_INT(ClRaceSaveGhost, cl_race_save_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Save ghost", -1) -MACRO_CONFIG_INT(SvGlobalBantime, sv_global_ban_time, 60, 0, 1440, CFGFLAG_SERVER, "The time a client gets banned if the ban server reports it. 0 to disable", 4) -MACRO_CONFIG_INT(ClDDRaceScoreBoard, cl_ddrace_scoreboard, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Enable DDRace Scoreboard ", -1) +MACRO_CONFIG_INT(ClAutoRaceRecord, cl_auto_race_record, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Save the best demo of each race", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(ClDemoName, cl_demo_name, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Save the player name within the demo", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(ClRaceGhost, cl_race_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Enable ghost", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(ClRaceShowGhost, cl_race_show_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ghost", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(ClRaceSaveGhost, cl_race_save_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Save ghost", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(SvGlobalBantime, sv_global_ban_time, 60, 0, 1440, CFGFLAG_SERVER, "The time a client gets banned if the ban server reports it. 0 to disable", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(ClDDRaceScoreBoard, cl_ddrace_scoreboard, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Enable DDRace Scoreboard ", IConsole::CONSOLELEVEL_USER) // these might need some fine tuning -MACRO_CONFIG_INT(SvChatPenalty, sv_chat_penalty, 250, 50, 1000, CFGFLAG_SERVER, "chat score will be increased by this on every message, and decremented by 1 on every tick.", 3) -MACRO_CONFIG_INT(SvChatThreshold, sv_chat_threshold, 1000, 50, 10000 , CFGFLAG_SERVER, "if chats core exceeds this, the player will be muted for sv_spam_mute_duration seconds", 3) -MACRO_CONFIG_INT(SvSpamMuteDuration, sv_spam_mute_duration, 60, 0, 3600 , CFGFLAG_SERVER, "how many seconds to mute, if player triggers mute on spam. 0 = off", 3) -MACRO_CONFIG_INT(SvResetPickus, sv_reset_pickups, 0, 0, 1, CFGFLAG_SERVER, "Whether the weapons are reset on passing the start tile or not", 4) -MACRO_CONFIG_INT(ClShowOthers, cl_show_others, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show players in other teams", -1) -MACRO_CONFIG_INT(ClShowEntities, cl_show_entities, 0, 0, 1, CFGFLAG_CLIENT, "Cheat to show game tiles", -1) +MACRO_CONFIG_INT(SvChatPenalty, sv_chat_penalty, 250, 50, 1000, CFGFLAG_SERVER, "chat score will be increased by this on every message, and decremented by 1 on every tick.", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvChatThreshold, sv_chat_threshold, 1000, 50, 10000 , CFGFLAG_SERVER, "if chats core exceeds this, the player will be muted for sv_spam_mute_duration seconds", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvSpamMuteDuration, sv_spam_mute_duration, 60, 0, 3600 , CFGFLAG_SERVER, "how many seconds to mute, if player triggers mute on spam. 0 = off", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(SvResetPickus, sv_reset_pickups, 0, 0, 1, CFGFLAG_SERVER, "Whether the weapons are reset on passing the start tile or not", IConsole::CONSOLELEVEL_ADMIN) +MACRO_CONFIG_INT(ClShowOthers, cl_show_others, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show players in other teams", IConsole::CONSOLELEVEL_USER) +MACRO_CONFIG_INT(ClShowEntities, cl_show_entities, 0, 0, 1, CFGFLAG_CLIENT, "Cheat to show game tiles", IConsole::CONSOLELEVEL_USER) #endif diff --git a/src/game/client/components/binds.cpp b/src/game/client/components/binds.cpp index bc4b7ec72..518b351a8 100644 --- a/src/game/client/components/binds.cpp +++ b/src/game/client/components/binds.cpp @@ -137,10 +137,10 @@ void CBinds::OnConsoleInit() if(pConfig) pConfig->RegisterCallback(ConfigSaveCallback, this); - Console()->Register("bind", "sr", CFGFLAG_CLIENT, ConBind, this, "Bind key to execute the command", 0); - Console()->Register("unbind", "s", CFGFLAG_CLIENT, ConUnbind, this, "Unbind key", 0); - Console()->Register("unbindall", "", CFGFLAG_CLIENT, ConUnbindAll, this, "Unbind all keys", 0); - Console()->Register("dump_binds", "", CFGFLAG_CLIENT, ConDumpBinds, this, "Dump binds", 0); + Console()->Register("bind", "sr", CFGFLAG_CLIENT, ConBind, this, "Bind key to execute the command", IConsole::CONSOLELEVEL_USER); + Console()->Register("unbind", "s", CFGFLAG_CLIENT, ConUnbind, this, "Unbind key", IConsole::CONSOLELEVEL_USER); + Console()->Register("unbindall", "", CFGFLAG_CLIENT, ConUnbindAll, this, "Unbind all keys", IConsole::CONSOLELEVEL_USER); + Console()->Register("dump_binds", "", CFGFLAG_CLIENT, ConDumpBinds, this, "Dump binds", IConsole::CONSOLELEVEL_USER); // default bindings SetDefaults(); diff --git a/src/game/client/components/camera.cpp b/src/game/client/components/camera.cpp index eccbf0080..3d884ef20 100644 --- a/src/game/client/components/camera.cpp +++ b/src/game/client/components/camera.cpp @@ -54,9 +54,9 @@ void CCamera::OnRender() void CCamera::OnConsoleInit() { - Console()->Register("zoom+", "", CFGFLAG_CLIENT, ConZoomPlus, this, "Zoom increase", 0); - Console()->Register("zoom-", "", CFGFLAG_CLIENT, ConZoomMinus, this, "Zoom decrease", 0); - Console()->Register("zoom", "", CFGFLAG_CLIENT, ConZoomReset, this, "Zoom reset", 0); + Console()->Register("zoom+", "", CFGFLAG_CLIENT, ConZoomPlus, this, "Zoom increase", IConsole::CONSOLELEVEL_USER); + Console()->Register("zoom-", "", CFGFLAG_CLIENT, ConZoomMinus, this, "Zoom decrease", IConsole::CONSOLELEVEL_USER); + Console()->Register("zoom", "", CFGFLAG_CLIENT, ConZoomReset, this, "Zoom reset", IConsole::CONSOLELEVEL_USER); } const float ZoomStep = 0.75f; diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index 7215c65d1..e9d96e066 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -87,10 +87,10 @@ void CChat::ConShowChat(IConsole::IResult *pResult, void *pUserData, int ClientI void CChat::OnConsoleInit() { - Console()->Register("say", "r", CFGFLAG_CLIENT, ConSay, this, "Say in chat", 0); - Console()->Register("say_team", "r", CFGFLAG_CLIENT, ConSayTeam, this, "Say in team chat", 0); - Console()->Register("chat", "s", CFGFLAG_CLIENT, ConChat, this, "Enable chat with all/team mode", 0); - Console()->Register("+show_chat", "", CFGFLAG_CLIENT, ConShowChat, this, "Show chat", 0); + Console()->Register("say", "r", CFGFLAG_CLIENT, ConSay, this, "Say in chat", IConsole::CONSOLELEVEL_USER); + Console()->Register("say_team", "r", CFGFLAG_CLIENT, ConSayTeam, this, "Say in team chat", IConsole::CONSOLELEVEL_USER); + Console()->Register("chat", "s", CFGFLAG_CLIENT, ConChat, this, "Enable chat with all/team mode", IConsole::CONSOLELEVEL_USER); + Console()->Register("+show_chat", "", CFGFLAG_CLIENT, ConShowChat, this, "Show chat", IConsole::CONSOLELEVEL_USER); } bool CChat::OnInput(IInput::CEvent e) diff --git a/src/game/client/components/console.cpp b/src/game/client/components/console.cpp index b27d80da4..d5f567b4a 100644 --- a/src/game/client/components/console.cpp +++ b/src/game/client/components/console.cpp @@ -75,7 +75,7 @@ void CGameConsole::CInstance::ClearHistory() void CGameConsole::CInstance::ExecuteLine(const char *pLine) { if(m_Type == CGameConsole::CONSOLETYPE_LOCAL) - m_pGameConsole->m_pConsole->ExecuteLine(pLine, 4, -1); + m_pGameConsole->m_pConsole->ExecuteLine(pLine, 4, IConsole::CONSOLELEVEL_USER); else { if(m_pGameConsole->Client()->RconAuthed()) @@ -669,12 +669,12 @@ void CGameConsole::OnConsoleInit() // Console()->RegisterPrintCallback(ClientConsolePrintCallback, this); - Console()->Register("toggle_local_console", "", CFGFLAG_CLIENT, ConToggleLocalConsole, this, "Toggle local console", 0); - Console()->Register("toggle_remote_console", "", CFGFLAG_CLIENT, ConToggleRemoteConsole, this, "Toggle remote console", 0); - Console()->Register("clear_local_console", "", CFGFLAG_CLIENT, ConClearLocalConsole, this, "Clear local console", 0); - Console()->Register("clear_remote_console", "", CFGFLAG_CLIENT, ConClearRemoteConsole, this, "Clear remote console", 0); - Console()->Register("dump_local_console", "", CFGFLAG_CLIENT, ConDumpLocalConsole, this, "Dump local console", 0); - Console()->Register("dump_remote_console", "", CFGFLAG_CLIENT, ConDumpRemoteConsole, this, "Dump remote console", 0); + Console()->Register("toggle_local_console", "", CFGFLAG_CLIENT, ConToggleLocalConsole, this, "Toggle local console", IConsole::CONSOLELEVEL_USER); + Console()->Register("toggle_remote_console", "", CFGFLAG_CLIENT, ConToggleRemoteConsole, this, "Toggle remote console", IConsole::CONSOLELEVEL_USER); + Console()->Register("clear_local_console", "", CFGFLAG_CLIENT, ConClearLocalConsole, this, "Clear local console", IConsole::CONSOLELEVEL_USER); + Console()->Register("clear_remote_console", "", CFGFLAG_CLIENT, ConClearRemoteConsole, this, "Clear remote console", IConsole::CONSOLELEVEL_USER); + Console()->Register("dump_local_console", "", CFGFLAG_CLIENT, ConDumpLocalConsole, this, "Dump local console", IConsole::CONSOLELEVEL_USER); + Console()->Register("dump_remote_console", "", CFGFLAG_CLIENT, ConDumpRemoteConsole, this, "Dump remote console", IConsole::CONSOLELEVEL_USER); } void CGameConsole::OnStateChange(int NewState, int OldState) diff --git a/src/game/client/components/controls.cpp b/src/game/client/components/controls.cpp index afda66769..7f9bc6259 100644 --- a/src/game/client/components/controls.cpp +++ b/src/game/client/components/controls.cpp @@ -81,20 +81,20 @@ static void ConKeyInputNextPrevWeapon(IConsole::IResult *pResult, void *pUserDat void CControls::OnConsoleInit() { // game commands - Console()->Register("+left", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputDirectionLeft, "Move left", 0); - Console()->Register("+right", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputDirectionRight, "Move right", 0); - Console()->Register("+jump", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputData.m_Jump, "Jump", 0); - Console()->Register("+hook", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputData.m_Hook, "Hook", 0); - Console()->Register("+fire", "", CFGFLAG_CLIENT, ConKeyInputCounter, &m_InputData.m_Fire, "Fire", 0); + Console()->Register("+left", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputDirectionLeft, "Move left", IConsole::CONSOLELEVEL_USER); + Console()->Register("+right", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputDirectionRight, "Move right", IConsole::CONSOLELEVEL_USER); + Console()->Register("+jump", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputData.m_Jump, "Jump", IConsole::CONSOLELEVEL_USER); + Console()->Register("+hook", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputData.m_Hook, "Hook", IConsole::CONSOLELEVEL_USER); + Console()->Register("+fire", "", CFGFLAG_CLIENT, ConKeyInputCounter, &m_InputData.m_Fire, "Fire", IConsole::CONSOLELEVEL_USER); - { static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 1}; Console()->Register("+weapon1", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to hammer", 0); } - { static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 2}; Console()->Register("+weapon2", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to gun", 0); } - { static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 3}; Console()->Register("+weapon3", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to shotgun", 0); } - { static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 4}; Console()->Register("+weapon4", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to grenade", 0); } - { static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 5}; Console()->Register("+weapon5", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to rifle", 0); } + { static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 1}; Console()->Register("+weapon1", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to hammer", IConsole::CONSOLELEVEL_USER); } + { static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 2}; Console()->Register("+weapon2", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to gun", IConsole::CONSOLELEVEL_USER); } + { static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 3}; Console()->Register("+weapon3", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to shotgun", IConsole::CONSOLELEVEL_USER); } + { static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 4}; Console()->Register("+weapon4", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to grenade", IConsole::CONSOLELEVEL_USER); } + { static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 5}; Console()->Register("+weapon5", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to rifle", IConsole::CONSOLELEVEL_USER); } - { static CInputSet s_Set = {this, &m_InputData.m_NextWeapon, 0}; Console()->Register("+nextweapon", "", CFGFLAG_CLIENT, ConKeyInputNextPrevWeapon, (void *)&s_Set, "Switch to next weapon", 0); } - { static CInputSet s_Set = {this, &m_InputData.m_PrevWeapon, 0}; Console()->Register("+prevweapon", "", CFGFLAG_CLIENT, ConKeyInputNextPrevWeapon, (void *)&s_Set, "Switch to previous weapon", 0); } + { static CInputSet s_Set = {this, &m_InputData.m_NextWeapon, 0}; Console()->Register("+nextweapon", "", CFGFLAG_CLIENT, ConKeyInputNextPrevWeapon, (void *)&s_Set, "Switch to next weapon", IConsole::CONSOLELEVEL_USER); } + { static CInputSet s_Set = {this, &m_InputData.m_PrevWeapon, 0}; Console()->Register("+prevweapon", "", CFGFLAG_CLIENT, ConKeyInputNextPrevWeapon, (void *)&s_Set, "Switch to previous weapon", IConsole::CONSOLELEVEL_USER); } } void CControls::OnMessage(int Msg, void *pRawMsg) diff --git a/src/game/client/components/emoticon.cpp b/src/game/client/components/emoticon.cpp index 6bc78a43b..421b528ea 100644 --- a/src/game/client/components/emoticon.cpp +++ b/src/game/client/components/emoticon.cpp @@ -30,8 +30,8 @@ void CEmoticon::ConEmote(IConsole::IResult *pResult, void *pUserData, int Client void CEmoticon::OnConsoleInit() { - Console()->Register("+emote", "", CFGFLAG_CLIENT, ConKeyEmoticon, this, "Open emote selector", 0); - Console()->Register("emote", "i", CFGFLAG_CLIENT, ConEmote, this, "Use emote", 0); + Console()->Register("+emote", "", CFGFLAG_CLIENT, ConKeyEmoticon, this, "Open emote selector", IConsole::CONSOLELEVEL_USER); + Console()->Register("emote", "i", CFGFLAG_CLIENT, ConEmote, this, "Use emote", IConsole::CONSOLELEVEL_USER); } void CEmoticon::OnReset() @@ -167,4 +167,4 @@ void CEmoticon::Emote(int Emoticon) CNetMsg_Cl_Emoticon Msg; Msg.m_Emoticon = Emoticon; Client()->SendPackMsg(&Msg, MSGFLAG_VITAL); -} \ No newline at end of file +} diff --git a/src/game/client/components/ghost.cpp b/src/game/client/components/ghost.cpp index eecbcc448..13b4363f6 100644 --- a/src/game/client/components/ghost.cpp +++ b/src/game/client/components/ghost.cpp @@ -528,7 +528,7 @@ void CGhost::ConGPlay(IConsole::IResult *pResult, void *pUserData, int ClientID) void CGhost::OnConsoleInit() { - Console()->Register("gplay","", CFGFLAG_CLIENT, ConGPlay, this, "", -1); + Console()->Register("gplay","", CFGFLAG_CLIENT, ConGPlay, this, "", IConsole::CONSOLELEVEL_USER); } void CGhost::OnMessage(int MsgType, void *pRawMsg) diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 879452ab6..3a3950ec8 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -740,9 +740,9 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView) { g_Config.m_ClShowOthers ^= 1; if(g_Config.m_ClShowOthers) - Console()->ExecuteLine("rcon showothers 1", 4, -1); + Console()->ExecuteLine("rcon showothers 1", 4, IConsole::CONSOLELEVEL_USER); else - Console()->ExecuteLine("rcon showothers 0", 4, -1); + Console()->ExecuteLine("rcon showothers 0", 4, IConsole::CONSOLELEVEL_USER); } } diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index 5514c03b2..142e3f3a2 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -43,7 +43,7 @@ void CScoreboard::OnRelease() void CScoreboard::OnConsoleInit() { - Console()->Register("+scoreboard", "", CFGFLAG_CLIENT, ConKeyScoreboard, this, "Show scoreboard", 0); + Console()->Register("+scoreboard", "", CFGFLAG_CLIENT, ConKeyScoreboard, this, "Show scoreboard", IConsole::CONSOLELEVEL_USER); } void CScoreboard::RenderGoals(float x, float y, float w) diff --git a/src/game/client/components/voting.cpp b/src/game/client/components/voting.cpp index 263764d5b..2b6d29a57 100644 --- a/src/game/client/components/voting.cpp +++ b/src/game/client/components/voting.cpp @@ -115,8 +115,8 @@ void CVoting::OnReset() void CVoting::OnConsoleInit() { - Console()->Register("callvote", "sr", CFGFLAG_CLIENT, ConCallvote, this, "Call vote", 0); - Console()->Register("vote", "r", CFGFLAG_CLIENT, ConVote, this, "Vote yes/no", 0); + Console()->Register("callvote", "sr", CFGFLAG_CLIENT, ConCallvote, this, "Call vote", IConsole::CONSOLELEVEL_USER); + Console()->Register("vote", "r", CFGFLAG_CLIENT, ConVote, this, "Vote yes/no", IConsole::CONSOLELEVEL_USER); } void CVoting::OnMessage(int MsgType, void *pRawMsg) diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 29c32d31b..9c2d0a7b7 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -195,22 +195,22 @@ void CGameClient::OnConsoleInit() m_Input.Add(m_pBinds); // add the some console commands - Console()->Register("team", "i", CFGFLAG_CLIENT, ConTeam, this, "Switch team", 0); - Console()->Register("kill", "", CFGFLAG_CLIENT, ConKill, this, "Kill yourself", 0); + Console()->Register("team", "i", CFGFLAG_CLIENT, ConTeam, this, "Switch team", IConsole::CONSOLELEVEL_USER); + Console()->Register("kill", "", CFGFLAG_CLIENT, ConKill, this, "Kill yourself", IConsole::CONSOLELEVEL_USER); // register server dummy commands for tab completion - Console()->Register("tune", "si", CFGFLAG_SERVER, ConServerDummy, 0, "Tune variable to value", 0); - Console()->Register("tune_reset", "", CFGFLAG_SERVER, ConServerDummy, 0, "Reset tuning", 0); - Console()->Register("tune_dump", "", CFGFLAG_SERVER, ConServerDummy, 0, "Dump tuning", 0); - Console()->Register("change_map", "?r", CFGFLAG_SERVER, ConServerDummy, 0, "Change map", 0); - Console()->Register("restart", "?i", CFGFLAG_SERVER, ConServerDummy, 0, "Restart in x seconds", 0); - Console()->Register("broadcast", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Broadcast message", 0); - Console()->Register("say", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Say in chat", 0); - Console()->Register("set_team", "vi", CFGFLAG_SERVER, ConServerDummy, 0, "Set team of player to team", 0); - Console()->Register("set_team_all", "i", CFGFLAG_SERVER, 0, 0, "Set team of all players to team", 0); - Console()->Register("addvote", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Add a voting option", 0); - Console()->Register("clear_votes", "", CFGFLAG_SERVER, ConServerDummy, 0, "Clears the voting options", 0); - Console()->Register("vote", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Force a vote to yes/no", 0); + Console()->Register("tune", "si", CFGFLAG_SERVER, ConServerDummy, 0, "Tune variable to value", IConsole::CONSOLELEVEL_USER); + Console()->Register("tune_reset", "", CFGFLAG_SERVER, ConServerDummy, 0, "Reset tuning", IConsole::CONSOLELEVEL_USER); + Console()->Register("tune_dump", "", CFGFLAG_SERVER, ConServerDummy, 0, "Dump tuning", IConsole::CONSOLELEVEL_USER); + Console()->Register("change_map", "?r", CFGFLAG_SERVER, ConServerDummy, 0, "Change map", IConsole::CONSOLELEVEL_USER); + Console()->Register("restart", "?i", CFGFLAG_SERVER, ConServerDummy, 0, "Restart in x seconds", IConsole::CONSOLELEVEL_USER); + Console()->Register("broadcast", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Broadcast message", IConsole::CONSOLELEVEL_USER); + Console()->Register("say", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Say in chat", IConsole::CONSOLELEVEL_USER); + Console()->Register("set_team", "vi", CFGFLAG_SERVER, ConServerDummy, 0, "Set team of player to team", IConsole::CONSOLELEVEL_USER); + Console()->Register("set_team_all", "i", CFGFLAG_SERVER, 0, 0, "Set team of all players to team", IConsole::CONSOLELEVEL_USER); + Console()->Register("addvote", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Add a voting option", IConsole::CONSOLELEVEL_USER); + Console()->Register("clear_votes", "", CFGFLAG_SERVER, ConServerDummy, 0, "Clears the voting options", IConsole::CONSOLELEVEL_USER); + Console()->Register("vote", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Force a vote to yes/no", IConsole::CONSOLELEVEL_USER); // propagate pointers @@ -901,9 +901,9 @@ void CGameClient::OnNewSnapshot() m_DDRaceMsgSent = true; if(g_Config.m_ClShowOthers) - Console()->ExecuteLine("rcon showothers 1", 4, -1); + Console()->ExecuteLine("rcon showothers 1", 4, IConsole::CONSOLELEVEL_USER); else - Console()->ExecuteLine("rcon showothers 0", 4, -1); + Console()->ExecuteLine("rcon showothers 0", 4, IConsole::CONSOLELEVEL_USER); } } diff --git a/src/game/ddracecommands.h b/src/game/ddracecommands.h index 17bed517c..3360abeaa 100644 --- a/src/game/ddracecommands.h +++ b/src/game/ddracecommands.h @@ -7,64 +7,63 @@ #define CONSOLE_COMMAND(name, params, flags, callback, userdata, help, level) #endif -CONSOLE_COMMAND("kill", "?v", CFGFLAG_SERVER, ConKillPlayer, this, "Kills player v and announces the kill", 2) -CONSOLE_COMMAND("logout", "?v", CFGFLAG_SERVER, ConLogOut, this, "Logs player v out from the console", -1) -CONSOLE_COMMAND("helper", "v", CFGFLAG_SERVER, ConSetlvl1, this, "Authenticates player v to the level of 1", 2) -CONSOLE_COMMAND("moder", "v", CFGFLAG_SERVER, ConSetlvl2, this, "Authenticates player v to the level of 2", 3) -CONSOLE_COMMAND("admin", "v", CFGFLAG_SERVER, ConSetlvl3, this, "Authenticates player v to the level of 3 (CAUTION: Irreversible, once he is an admin you can't remove his status)", 3) -CONSOLE_COMMAND("invis", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConInvis, this, "Makes player v invisible", 2) -CONSOLE_COMMAND("vis", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConVis, this, "Makes player v visible again", 2) -CONSOLE_COMMAND("timerstop", "v", CFGFLAG_SERVER|CMDFLAG_TIMER, ConTimerStop, this, "Stops the timer of player v", 2) -CONSOLE_COMMAND("timerstart", "v", CFGFLAG_SERVER|CMDFLAG_TIMER, ConTimerStart, this, "Starts the timer of player v", 2) -CONSOLE_COMMAND("timerrestart", "v", CFGFLAG_SERVER|CMDFLAG_TIMER, ConTimerReStart, this, "Sets the timer of player v to 0 and starts it", 2) -CONSOLE_COMMAND("timerzero", "v", CFGFLAG_SERVER|CMDFLAG_TIMER, ConTimerZero, this, "Sets the timer of player v to 0 and stops it", 2) -CONSOLE_COMMAND("tele", "vi", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConTeleport, this, "Teleports player v to player i", 2) -CONSOLE_COMMAND("freeze", "v?i", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConFreeze, this, "Freezes player v for i seconds (infinite by default)", 2) -CONSOLE_COMMAND("unfreeze", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConUnFreeze, this, "Unfreezes player v", 2) -CONSOLE_COMMAND("addweapon", "v?i", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConAddWeapon, this, "Gives weapon with id i to player v (all = -1, hammer = 0, gun = 1, shotgun = 2, grenade = 3, rifle = 4, ninja = 5)", 1) -CONSOLE_COMMAND("removeweapon", "v?i", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConRemoveWeapon, this, "removes weapon with id i from player v (all = -1, hammer = 0, gun = 1, shotgun = 2, grenade = 3, rifle = 4)", 1) -CONSOLE_COMMAND("shotgun", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConShotgun, this, "Gives a shotgun to player v", 2) -CONSOLE_COMMAND("grenade", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConGrenade, this, "Gives a grenade launcher to player v", 2) -CONSOLE_COMMAND("rifle", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConRifle, this, "Gives a rifle to player v", 2) -CONSOLE_COMMAND("weapons", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConWeapons, this, "Gives all weapons to player v", 2) -CONSOLE_COMMAND("unshotgun", "v", CFGFLAG_SERVER|CMDFLAG_HELPERCMD, ConUnShotgun, this, "Takes the shotgun from player v", 2) -CONSOLE_COMMAND("ungrenade", "v", CFGFLAG_SERVER|CMDFLAG_HELPERCMD, ConUnGrenade, this, "Takes the grenade launcher from player v", 2) -CONSOLE_COMMAND("unrifle", "v", CFGFLAG_SERVER|CMDFLAG_HELPERCMD, ConUnRifle, this, "Takes the rifle from player v", 2) -CONSOLE_COMMAND("unweapons", "v", CFGFLAG_SERVER|CMDFLAG_HELPERCMD, ConUnWeapons, this, "Takes all weapons from player v", 2) -CONSOLE_COMMAND("ninja", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConNinja, this, "Makes player v a ninja", 2) -CONSOLE_COMMAND("hammer", "vi", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConHammer, this, "Sets the hammer power of player v to i", 2) -CONSOLE_COMMAND("super", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConSuper, this, "Makes player v super", 2) -CONSOLE_COMMAND("unsuper", "v", CFGFLAG_SERVER|CMDFLAG_HELPERCMD, ConUnSuper, this, "Removes super from player v", 2) -CONSOLE_COMMAND("left", "?v", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConGoLeft, this, "Makes you or player v move 1 tile left", 1) -CONSOLE_COMMAND("right", "?v", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConGoRight, this, "Makes you or player v move 1 tile right", 1) -CONSOLE_COMMAND("up", "?v", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConGoUp, this, "Makes you or player v move 1 tile up", 1) -CONSOLE_COMMAND("down", "?v", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConGoDown, this, "Makes you or player v move 1 tile down", 1) -CONSOLE_COMMAND("move", "vii", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConMove, this, "Moves player i to the tile with x/y-number ii", 1) -CONSOLE_COMMAND("move_raw", "vii", CFGFLAG_SERVER|CMDFLAG_CHEAT|CMDFLAG_HELPERCMD, ConMoveRaw, this, "Moves player i to the point with x/y-coordinates ii", 1) -CONSOLE_COMMAND("credits", "", CFGFLAG_SERVER, ConCredits, this, "Shows the credits of the DDRace mod", -1) -CONSOLE_COMMAND("emote", "?si", CFGFLAG_SERVER, ConEyeEmote, this, "Sets your tee's eye emote", -1) -CONSOLE_COMMAND("broadmsg", "", CFGFLAG_SERVER, ConToggleBroadcast, this, "Toggles showing the server's broadcast message during race on/off", -1) -CONSOLE_COMMAND("eyeemote", "", CFGFLAG_SERVER, ConEyeEmote, this, "Toggles use of standard eye-emotes on/off", -1) -CONSOLE_COMMAND("settings", "?s", CFGFLAG_SERVER, ConSettings, this, "Shows gameplay information for this server", -1) +CONSOLE_COMMAND("kill", "?v", CFGFLAG_SERVER, ConKillPlayer, this, "Kills player v and announces the kill", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("logout", "?v", CFGFLAG_SERVER, ConLogOut, this, "Logs player v out from the console", IConsole::CONSOLELEVEL_USER) +CONSOLE_COMMAND("moder", "v", CFGFLAG_SERVER, ConSetlvl1, this, "Authenticates player v to the level of 1", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("admin", "v", CFGFLAG_SERVER, ConSetlvl2, this, "Authenticates player v to the level of 2", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("invis", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConInvis, this, "Makes player v invisible", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("vis", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConVis, this, "Makes player v visible again", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("timerstop", "v", CFGFLAG_SERVER|CMDFLAG_TIMER|CMDFLAG_CHEAT, ConTimerStop, this, "Stops the timer of player v", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("timerstart", "v", CFGFLAG_SERVER|CMDFLAG_TIMER|CMDFLAG_CHEAT, ConTimerStart, this, "Starts the timer of player v", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("timerrestart", "v", CFGFLAG_SERVER|CMDFLAG_TIMER|CMDFLAG_CHEAT, ConTimerReStart, this, "Sets the timer of player v to 0 and starts it", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("timerzero", "v", CFGFLAG_SERVER|CMDFLAG_TIMER|CMDFLAG_CHEAT, ConTimerZero, this, "Sets the timer of player v to 0 and stops it", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("tele", "vi", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConTeleport, this, "Teleports player v to player i", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("freeze", "v?i", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConFreeze, this, "Freezes player v for i seconds (infinite by default)", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("unfreeze", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConUnFreeze, this, "Unfreezes player v", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("addweapon", "v?i", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConAddWeapon, this, "Gives weapon with id i to player v (all = -1, hammer = 0, gun = 1, shotgun = 2, grenade = 3, rifle = 4, ninja = 5)", 1) +CONSOLE_COMMAND("removeweapon", "v?i", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConRemoveWeapon, this, "removes weapon with id i from player v (all = -1, hammer = 0, gun = 1, shotgun = 2, grenade = 3, rifle = 4)", 1) +CONSOLE_COMMAND("shotgun", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConShotgun, this, "Gives a shotgun to player v", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("grenade", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConGrenade, this, "Gives a grenade launcher to player v", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("rifle", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConRifle, this, "Gives a rifle to player v", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("weapons", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConWeapons, this, "Gives all weapons to player v", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("unshotgun", "v", CFGFLAG_SERVER, ConUnShotgun, this, "Takes the shotgun from player v", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("ungrenade", "v", CFGFLAG_SERVER, ConUnGrenade, this, "Takes the grenade launcher from player v", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("unrifle", "v", CFGFLAG_SERVER, ConUnRifle, this, "Takes the rifle from player v", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("unweapons", "v", CFGFLAG_SERVER, ConUnWeapons, this, "Takes all weapons from player v", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("ninja", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConNinja, this, "Makes player v a ninja", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("hammer", "vi", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConHammer, this, "Sets the hammer power of player v to i", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("super", "v", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConSuper, this, "Makes player v super", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("unsuper", "v", CFGFLAG_SERVER, ConUnSuper, this, "Removes super from player v", IConsole::CONSOLELEVEL_ADMIN) +CONSOLE_COMMAND("left", "?v", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConGoLeft, this, "Makes you or player v move 1 tile left", 1) +CONSOLE_COMMAND("right", "?v", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConGoRight, this, "Makes you or player v move 1 tile right", 1) +CONSOLE_COMMAND("up", "?v", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConGoUp, this, "Makes you or player v move 1 tile up", 1) +CONSOLE_COMMAND("down", "?v", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConGoDown, this, "Makes you or player v move 1 tile down", 1) +CONSOLE_COMMAND("move", "vii", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConMove, this, "Moves player i to the tile with x/y-number ii", 1) +CONSOLE_COMMAND("move_raw", "vii", CFGFLAG_SERVER|CMDFLAG_CHEAT, ConMoveRaw, this, "Moves player i to the point with x/y-coordinates ii", 1) +CONSOLE_COMMAND("credits", "", CFGFLAG_SERVER, ConCredits, this, "Shows the credits of the DDRace mod", IConsole::CONSOLELEVEL_USER) +CONSOLE_COMMAND("emote", "?si", CFGFLAG_SERVER, ConEyeEmote, this, "Sets your tee's eye emote", IConsole::CONSOLELEVEL_USER) +CONSOLE_COMMAND("broadmsg", "", CFGFLAG_SERVER, ConToggleBroadcast, this, "Toggles showing the server's broadcast message during race on/off", IConsole::CONSOLELEVEL_USER) +CONSOLE_COMMAND("eyeemote", "", CFGFLAG_SERVER, ConEyeEmote, this, "Toggles use of standard eye-emotes on/off", IConsole::CONSOLELEVEL_USER) +CONSOLE_COMMAND("settings", "?s", CFGFLAG_SERVER, ConSettings, this, "Shows gameplay information for this server", IConsole::CONSOLELEVEL_USER) CONSOLE_COMMAND("fly", "", CFGFLAG_SERVER, ConToggleFly, this, "Toggles super-fly (holding space) on/off", 1) -CONSOLE_COMMAND("help", "?r", CFGFLAG_SERVER, ConHelp, this, "Shows help to command r, general help if left blank", -1) -CONSOLE_COMMAND("info", "", CFGFLAG_SERVER, ConInfo, this, "Shows info about this server", -1) -CONSOLE_COMMAND("me", "r", CFGFLAG_SERVER, ConMe, this, "Like the famous irc command '/me says hi' will display ' says hi'", -1) -CONSOLE_COMMAND("pause", "", CFGFLAG_SERVER, ConTogglePause, this, "Toggles pause on/off (if activated on server)", -1) -CONSOLE_COMMAND("rank", "?r", CFGFLAG_SERVER, ConRank, this, "Shows the rank of player with name r (your rank by default)", -1) -CONSOLE_COMMAND("rules", "", CFGFLAG_SERVER, ConRules, this, "Shows the server rules", -1) -CONSOLE_COMMAND("team", "?i", CFGFLAG_SERVER, ConJoinTeam, this, "Lets you join team i (shows your team if left blank)", -1) -CONSOLE_COMMAND("top5", "?i", CFGFLAG_SERVER, ConTop5, this, "Shows five ranks of the ladder beginning with rank i (1 by default)", -1) -CONSOLE_COMMAND("showothers", "?i", CFGFLAG_SERVER, ConShowOthers, this, "Whether to showplayers from other teams or not (off by default), optional i = 0 for off else for on", -1) +CONSOLE_COMMAND("help", "?r", CFGFLAG_SERVER, ConHelp, this, "Shows help to command r, general help if left blank", IConsole::CONSOLELEVEL_USER) +CONSOLE_COMMAND("info", "", CFGFLAG_SERVER, ConInfo, this, "Shows info about this server", IConsole::CONSOLELEVEL_USER) +CONSOLE_COMMAND("me", "r", CFGFLAG_SERVER, ConMe, this, "Like the famous irc command '/me says hi' will display ' says hi'", IConsole::CONSOLELEVEL_USER) +CONSOLE_COMMAND("pause", "", CFGFLAG_SERVER, ConTogglePause, this, "Toggles pause on/off (if activated on server)", IConsole::CONSOLELEVEL_USER) +CONSOLE_COMMAND("rank", "?r", CFGFLAG_SERVER, ConRank, this, "Shows the rank of player with name r (your rank by default)", IConsole::CONSOLELEVEL_USER) +CONSOLE_COMMAND("rules", "", CFGFLAG_SERVER, ConRules, this, "Shows the server rules", IConsole::CONSOLELEVEL_USER) +CONSOLE_COMMAND("team", "?i", CFGFLAG_SERVER, ConJoinTeam, this, "Lets you join team i (shows your team if left blank)", IConsole::CONSOLELEVEL_USER) +CONSOLE_COMMAND("top5", "?i", CFGFLAG_SERVER, ConTop5, this, "Shows five ranks of the ladder beginning with rank i (1 by default)", IConsole::CONSOLELEVEL_USER) +CONSOLE_COMMAND("showothers", "?i", CFGFLAG_SERVER, ConShowOthers, this, "Whether to showplayers from other teams or not (off by default), optional i = 0 for off else for on", IConsole::CONSOLELEVEL_USER) -CONSOLE_COMMAND("mute", "", CFGFLAG_SERVER, ConMute, this, "", 2); -CONSOLE_COMMAND("muteid", "vi", CFGFLAG_SERVER, ConMuteID, this, "", 2); -CONSOLE_COMMAND("muteip", "si", CFGFLAG_SERVER, ConMuteIP, this, "", 2); -CONSOLE_COMMAND("unmute", "i", CFGFLAG_SERVER, ConUnmute, this, "", 2); -CONSOLE_COMMAND("mutes", "", CFGFLAG_SERVER, ConMutes, this, "", 2); +CONSOLE_COMMAND("mute", "", CFGFLAG_SERVER, ConMute, this, "", IConsole::CONSOLELEVEL_ADMIN); +CONSOLE_COMMAND("muteid", "vi", CFGFLAG_SERVER, ConMuteID, this, "", IConsole::CONSOLELEVEL_ADMIN); +CONSOLE_COMMAND("muteip", "si", CFGFLAG_SERVER, ConMuteIP, this, "", IConsole::CONSOLELEVEL_ADMIN); +CONSOLE_COMMAND("unmute", "i", CFGFLAG_SERVER, ConUnmute, this, "", IConsole::CONSOLELEVEL_ADMIN); +CONSOLE_COMMAND("mutes", "", CFGFLAG_SERVER, ConMutes, this, "", IConsole::CONSOLELEVEL_ADMIN); #if defined(CONF_SQL) -CONSOLE_COMMAND("times", "?s?i", CFGFLAG_SERVER, ConTimes, this, "/times ?s?i shows last 5 times of the server or of a player beginning with name s starting with time i (i = 1 by default)", -1) +CONSOLE_COMMAND("times", "?s?i", CFGFLAG_SERVER, ConTimes, this, "/times ?s?i shows last 5 times of the server or of a player beginning with name s starting with time i (i = 1 by default)", IConsole::CONSOLELEVEL_USER) #endif #undef CONSOLE_COMMAND diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index c7c7cd867..3ba858f98 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -505,7 +505,7 @@ void CGameContext::OnTick() if(m_VoteEnforce == VOTE_ENFORCE_YES) { - Console()->ExecuteLine(m_aVoteCommand, 4, -1, CServer::SendRconLineAuthed, Server(), SendChatResponseAll, this); + Console()->ExecuteLine(m_aVoteCommand, IConsole::CONSOLELEVEL_SUPERADMIN, -1, CServer::SendRconLineAuthed, Server(), SendChatResponseAll, this); EndVote(); SendChat(-1, CGameContext::CHAT_ALL, "Vote passed"); @@ -1291,20 +1291,20 @@ void CGameContext::OnConsoleInit() m_pServer = Kernel()->RequestInterface(); m_pConsole = Kernel()->RequestInterface(); - Console()->Register("tune", "si", CFGFLAG_SERVER, ConTuneParam, this, "", 4); - Console()->Register("tune_reset", "", CFGFLAG_SERVER, ConTuneReset, this, "", 3); - Console()->Register("tune_dump", "", CFGFLAG_SERVER, ConTuneDump, this, "", 3); + Console()->Register("tune", "si", CFGFLAG_SERVER, ConTuneParam, this, "", IConsole::CONSOLELEVEL_ADMIN); + Console()->Register("tune_reset", "", CFGFLAG_SERVER, ConTuneReset, this, "", IConsole::CONSOLELEVEL_ADMIN); + Console()->Register("tune_dump", "", CFGFLAG_SERVER, ConTuneDump, this, "", IConsole::CONSOLELEVEL_ADMIN); - Console()->Register("change_map", "?r", CFGFLAG_SERVER|CFGFLAG_STORE, ConChangeMap, this, "", 3); - Console()->Register("restart", "?i", CFGFLAG_SERVER|CFGFLAG_STORE, ConRestart, this, "", 3); - Console()->Register("broadcast", "r", CFGFLAG_SERVER, ConBroadcast, this, "", 2); - Console()->Register("say", "r", CFGFLAG_SERVER, ConSay, this, "", 3); - Console()->Register("set_team", "vi", CFGFLAG_SERVER, ConSetTeam, this, "", 2); - Console()->Register("set_team_all", "i", CFGFLAG_SERVER, ConSetTeamAll, this, "", 2); + Console()->Register("change_map", "?r", CFGFLAG_SERVER|CFGFLAG_STORE, ConChangeMap, this, "", IConsole::CONSOLELEVEL_ADMIN); + Console()->Register("restart", "?i", CFGFLAG_SERVER|CFGFLAG_STORE, ConRestart, this, "", IConsole::CONSOLELEVEL_ADMIN); + Console()->Register("broadcast", "r", CFGFLAG_SERVER, ConBroadcast, this, "", IConsole::CONSOLELEVEL_ADMIN); + Console()->Register("say", "r", CFGFLAG_SERVER, ConSay, this, "", IConsole::CONSOLELEVEL_ADMIN); + Console()->Register("set_team", "vi", CFGFLAG_SERVER, ConSetTeam, this, "", IConsole::CONSOLELEVEL_ADMIN); + Console()->Register("set_team_all", "i", CFGFLAG_SERVER, ConSetTeamAll, this, "", IConsole::CONSOLELEVEL_ADMIN); - Console()->Register("addvote", "r", CFGFLAG_SERVER, ConAddVote, this, "", 4); - Console()->Register("clear_votes", "", CFGFLAG_SERVER, ConClearVotes, this, "", 3); - Console()->Register("vote", "s?s", CFGFLAG_SERVER, ConVote, this, "Force the vote to yes or no?, Make the forcing of the vote private?", 3); + Console()->Register("addvote", "r", CFGFLAG_SERVER, ConAddVote, this, "", IConsole::CONSOLELEVEL_ADMIN); + Console()->Register("clear_votes", "", CFGFLAG_SERVER, ConClearVotes, this, "", IConsole::CONSOLELEVEL_ADMIN); + Console()->Register("vote", "s?s", CFGFLAG_SERVER, ConVote, this, "Force the vote to yes or no?, Make the forcing of the vote private?", IConsole::CONSOLELEVEL_ADMIN); #define CONSOLE_COMMAND(name, params, flags, callback, userdata, help, level) m_pConsole->Register(name, params, flags, callback, userdata, help, level); #include "game/ddracecommands.h" diff --git a/src/mastersrv/mastersrv.cpp b/src/mastersrv/mastersrv.cpp index fffc0740f..2e0984019 100644 --- a/src/mastersrv/mastersrv.cpp +++ b/src/mastersrv/mastersrv.cpp @@ -330,7 +330,7 @@ int main(int argc, const char **argv) // ignore_convention IStorage *pStorage = CreateStorage("Teeworlds", argc, argv); m_pConsole = CreateConsole(CFGFLAG_MASTER); - m_pConsole->Register("ban", "s", CFGFLAG_MASTER, ConAddBan, 0, "Ban IP from mastersrv", 0); + m_pConsole->Register("ban", "s", CFGFLAG_MASTER, ConAddBan, 0, "Ban IP from mastersrv", IConsole::CONSOLELEVEL_USER); bool RegisterFail = !pKernel->RegisterInterface(pStorage); RegisterFail |= !pKernel->RegisterInterface(m_pConsole);