Disallow game-related commands unless testing is enabled

This commit is contained in:
Andrii 2020-10-11 15:59:57 +02:00 committed by heinrich5991
parent a83b7b0733
commit 26a07c804f
6 changed files with 63 additions and 54 deletions

View file

@ -2650,13 +2650,6 @@ int CServer::Run()
return ErrorShutdown(); return ErrorShutdown();
} }
void CServer::ConTestingCommands(CConsole::IResult *pResult, void *pUser)
{
char aBuf[128];
str_format(aBuf, sizeof(aBuf), "Value: %d", g_Config.m_SvTestingCommands);
((CConsole *)pUser)->Print(CConsole::OUTPUT_LEVEL_STANDARD, "console", aBuf);
}
void CServer::ConRescue(CConsole::IResult *pResult, void *pUser) void CServer::ConRescue(CConsole::IResult *pResult, void *pUser)
{ {
char aBuf[128]; char aBuf[128];
@ -3531,7 +3524,6 @@ int main(int argc, const char **argv) // ignore_convention
if(argc > 1) // ignore_convention if(argc > 1) // ignore_convention
pConsole->ParseArguments(argc - 1, &argv[1]); // ignore_convention pConsole->ParseArguments(argc - 1, &argv[1]); // ignore_convention
pConsole->Register("sv_test_cmds", "", CFGFLAG_SERVER, CServer::ConTestingCommands, pConsole, "Turns testing commands aka cheats on/off (setting only works in initial config)");
pConsole->Register("sv_rescue", "", CFGFLAG_SERVER, CServer::ConRescue, pConsole, "Allow /rescue command so players can teleport themselves out of freeze (setting only works in initial config)"); pConsole->Register("sv_rescue", "", CFGFLAG_SERVER, CServer::ConRescue, pConsole, "Allow /rescue command so players can teleport themselves out of freeze (setting only works in initial config)");
pEngine->InitLogfile(); pEngine->InitLogfile();

View file

@ -31,14 +31,15 @@ enum
CFGFLAG_STORE = 1 << 3, CFGFLAG_STORE = 1 << 3,
CFGFLAG_MASTER = 1 << 4, CFGFLAG_MASTER = 1 << 4,
CFGFLAG_ECON = 1 << 5, CFGFLAG_ECON = 1 << 5,
// DDRace
CMDFLAG_TEST = 1 << 6, // DDRace
CFGFLAG_NOMAPCFG = 1 << 6,
CFGFLAG_CHAT = 1 << 7, CFGFLAG_CHAT = 1 << 7,
CFGFLAG_GAME = 1 << 8, CFGFLAG_GAME = 1 << 8,
CFGFLAG_NONTEEHISTORIC = 1 << 9, CFGFLAG_NONTEEHISTORIC = 1 << 9,
CFGFLAG_COLLIGHT = 1 << 10, CFGFLAG_COLLIGHT = 1 << 10,
CFGFLAG_COLALPHA = 1 << 11, CFGFLAG_COLALPHA = 1 << 11,
CFGFLAG_READONLY = 1 << 12,
}; };
#endif #endif

View file

@ -187,7 +187,7 @@ MACRO_CONFIG_INT(SvReservedSlots, sv_reserved_slots, 0, 0, 16, CFGFLAG_SERVER, "
MACRO_CONFIG_STR(SvReservedSlotsPass, sv_reserved_slots_pass, 32, "", CFGFLAG_SERVER, "The password that is required to use a reserved slot") MACRO_CONFIG_STR(SvReservedSlotsPass, sv_reserved_slots_pass, 32, "", CFGFLAG_SERVER, "The password that is required to use a reserved slot")
MACRO_CONFIG_INT(SvHit, sv_hit, 1, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME, "Whether players can hammer/grenade/laser each other or not") MACRO_CONFIG_INT(SvHit, sv_hit, 1, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME, "Whether players can hammer/grenade/laser each other or not")
MACRO_CONFIG_INT(SvEndlessDrag, sv_endless_drag, 0, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME, "Turns endless hooking on/off") MACRO_CONFIG_INT(SvEndlessDrag, sv_endless_drag, 0, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME, "Turns endless hooking on/off")
MACRO_CONFIG_INT(SvTestingCommands, sv_test_cmds, 0, 0, 1, CFGFLAG_SERVER, "Turns testing commands aka cheats on/off (setting only works in initial config)") MACRO_CONFIG_INT(SvTestingCommands, sv_test_cmds, 0, 0, 1, CFGFLAG_SERVER | CFGFLAG_READONLY, "Turns testing commands aka cheats on/off (setting only works in initial config)")
MACRO_CONFIG_INT(SvFreezeDelay, sv_freeze_delay, 3, 1, 30, CFGFLAG_SERVER | CFGFLAG_GAME, "How many seconds the players will remain frozen (applies to all except delayed freeze in switch layer & deepfreeze)") MACRO_CONFIG_INT(SvFreezeDelay, sv_freeze_delay, 3, 1, 30, CFGFLAG_SERVER | CFGFLAG_GAME, "How many seconds the players will remain frozen (applies to all except delayed freeze in switch layer & deepfreeze)")
MACRO_CONFIG_INT(ClDDRaceBindsSet, cl_race_binds_set, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "What level the DDRace binds are set to (this is automated, you don't need to use this)") MACRO_CONFIG_INT(ClDDRaceBindsSet, cl_race_binds_set, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "What level the DDRace binds are set to (this is automated, you don't need to use this)")
MACRO_CONFIG_INT(SvEndlessSuperHook, sv_endless_super_hook, 0, 0, 1, CFGFLAG_SERVER, "Endless hook for super players on/off") MACRO_CONFIG_INT(SvEndlessSuperHook, sv_endless_super_hook, 0, 0, 1, CFGFLAG_SERVER, "Endless hook for super players on/off")
@ -335,7 +335,7 @@ MACRO_CONFIG_INT(SvRankCheats, sv_rank_cheats, 0, 0, 1, CFGFLAG_SERVER, "Enable
MACRO_CONFIG_INT(SvShutdownWhenEmpty, sv_shutdown_when_empty, 0, 0, 1, CFGFLAG_SERVER, "Shutdown server as soon as no one is on it anymore") MACRO_CONFIG_INT(SvShutdownWhenEmpty, sv_shutdown_when_empty, 0, 0, 1, CFGFLAG_SERVER, "Shutdown server as soon as no one is on it anymore")
MACRO_CONFIG_INT(SvReloadWhenEmpty, sv_reload_when_empty, 0, 0, 2, CFGFLAG_SERVER, "Reload map when server is empty (1 = reload once, 2 = reload every time server gets empty)") MACRO_CONFIG_INT(SvReloadWhenEmpty, sv_reload_when_empty, 0, 0, 2, CFGFLAG_SERVER, "Reload map when server is empty (1 = reload once, 2 = reload every time server gets empty)")
MACRO_CONFIG_INT(SvKillProtection, sv_kill_protection, 20, 0, 9999, CFGFLAG_SERVER, "0 - Disable, 1-9999 minutes") MACRO_CONFIG_INT(SvKillProtection, sv_kill_protection, 20, 0, 9999, CFGFLAG_SERVER, "0 - Disable, 1-9999 minutes")
MACRO_CONFIG_INT(SvSoloServer, sv_solo_server, 0, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME, "Set server to solo mode (no player interactions, has to be set before loading the map)") MACRO_CONFIG_INT(SvSoloServer, sv_solo_server, 0, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_READONLY, "Set server to solo mode (no player interactions, has to be set before loading the map)")
MACRO_CONFIG_STR(SvClientSuggestion, sv_client_suggestion, 128, "Get DDNet client from DDNet.tw to use all features on DDNet!", CFGFLAG_SERVER, "Broadcast to display to players without DDNet client") MACRO_CONFIG_STR(SvClientSuggestion, sv_client_suggestion, 128, "Get DDNet client from DDNet.tw to use all features on DDNet!", CFGFLAG_SERVER, "Broadcast to display to players without DDNet client")
MACRO_CONFIG_STR(SvClientSuggestionOld, sv_client_suggestion_old, 128, "Your DDNet client is old, update it on DDNet.tw!", CFGFLAG_SERVER, "Broadcast to display to players with an old version of DDNet client") MACRO_CONFIG_STR(SvClientSuggestionOld, sv_client_suggestion_old, 128, "Your DDNet client is old, update it on DDNet.tw!", CFGFLAG_SERVER, "Broadcast to display to players with an old version of DDNet client")
MACRO_CONFIG_STR(SvClientSuggestionBot, sv_client_suggestion_bot, 128, "Your client has bots and can be remotely controlled!\nPlease use another client like DDNet client from DDNet.tw", CFGFLAG_SERVER, "Broadcast to display to players with a known botting client") MACRO_CONFIG_STR(SvClientSuggestionBot, sv_client_suggestion_bot, 128, "Your client has bots and can be remotely controlled!\nPlease use another client like DDNet client from DDNet.tw", CFGFLAG_SERVER, "Broadcast to display to players with a known botting client")

View file

@ -430,7 +430,7 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, int ClientID, bo
if(pCommand) if(pCommand)
{ {
if(ClientID == IConsole::CLIENT_ID_GAME && !(pCommand->m_Flags & CFGFLAG_GAME)) if(ClientID == IConsole::CLIENT_ID_GAME && (!(pCommand->m_Flags & CFGFLAG_GAME) || pCommand->m_Flags & CFGFLAG_NOMAPCFG))
{ {
if(Stroke) if(Stroke)
{ {
@ -477,8 +477,20 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, int ClientID, bo
} }
else else
{ {
if(pCommand->m_Flags & CMDFLAG_TEST && !g_Config.m_SvTestingCommands) if(ClientID != IConsole::CLIENT_ID_GAME && pCommand->m_Flags & CFGFLAG_GAME)
return; {
if(g_Config.m_SvTestingCommands)
{
m_Cheated = true;
}
else
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "Command '%s' is forbidden. Test commands were disabled on the server.", Result.m_pCommand);
Print(OUTPUT_LEVEL_STANDARD, "console", aBuf);
return;
}
}
if(m_pfnTeeHistorianCommandCallback && !(pCommand->m_Flags & CFGFLAG_NONTEEHISTORIC)) if(m_pfnTeeHistorianCommandCallback && !(pCommand->m_Flags & CFGFLAG_NONTEEHISTORIC))
{ {
@ -500,9 +512,6 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, int ClientID, bo
{ {
pCommand->m_pfnCallback(&Result, pCommand->m_pUserData); pCommand->m_pfnCallback(&Result, pCommand->m_pUserData);
} }
if(pCommand->m_Flags & CMDFLAG_TEST)
m_Cheated = true;
} }
} }
} }
@ -705,6 +714,7 @@ struct CIntVariableData
int m_Min; int m_Min;
int m_Max; int m_Max;
int m_OldValue; int m_OldValue;
bool m_Readonly;
}; };
struct CColVariableData struct CColVariableData
@ -730,6 +740,12 @@ static void IntVariableCommand(IConsole::IResult *pResult, void *pUserData)
if(pResult->NumArguments()) if(pResult->NumArguments())
{ {
if(pData->m_Readonly && pResult->m_ClientID >= 0)
{
pData->m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "console", "This is read only variable");
return;
}
int Val = pResult->GetInteger(0); int Val = pResult->GetInteger(0);
// do clamping // do clamping
@ -954,7 +970,7 @@ CConsole::CConsole(int FlagMask)
// TODO: this should disappear // TODO: this should disappear
#define MACRO_CONFIG_INT(Name, ScriptName, Def, Min, Max, Flags, Desc) \ #define MACRO_CONFIG_INT(Name, ScriptName, Def, Min, Max, Flags, Desc) \
{ \ { \
static CIntVariableData Data = {this, &g_Config.m_##Name, Min, Max, Def}; \ static CIntVariableData Data = {this, &g_Config.m_##Name, Min, Max, Def, static_cast<bool>((Flags)&CFGFLAG_READONLY)}; \
Register(#ScriptName, "?i", Flags, IntVariableCommand, &Data, Desc); \ Register(#ScriptName, "?i", Flags, IntVariableCommand, &Data, Desc); \
} }

View file

@ -7,35 +7,35 @@
#endif #endif
CONSOLE_COMMAND("kill_pl", "v[id]", CFGFLAG_SERVER, ConKillPlayer, this, "Kills player v and announces the kill") CONSOLE_COMMAND("kill_pl", "v[id]", CFGFLAG_SERVER, ConKillPlayer, this, "Kills player v and announces the kill")
CONSOLE_COMMAND("totele", "i[number]", CFGFLAG_SERVER | CMDFLAG_TEST, ConToTeleporter, this, "Teleports you to teleporter v") CONSOLE_COMMAND("totele", "i[number]", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConToTeleporter, this, "Teleports you to teleporter v")
CONSOLE_COMMAND("totelecp", "i[number]", CFGFLAG_SERVER | CMDFLAG_TEST, ConToCheckTeleporter, this, "Teleports you to checkpoint teleporter v") CONSOLE_COMMAND("totelecp", "i[number]", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConToCheckTeleporter, this, "Teleports you to checkpoint teleporter v")
CONSOLE_COMMAND("tele", "?i[id] ?i[id]", CFGFLAG_SERVER | CMDFLAG_TEST, ConTeleport, this, "Teleports player i (or you) to player i (or you to where you look at)") CONSOLE_COMMAND("tele", "?i[id] ?i[id]", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConTeleport, this, "Teleports player i (or you) to player i (or you to where you look at)")
CONSOLE_COMMAND("addweapon", "i[weapon-id]", CFGFLAG_SERVER | CMDFLAG_TEST, ConAddWeapon, this, "Gives weapon with id i to you (all = -1, hammer = 0, gun = 1, shotgun = 2, grenade = 3, laser = 4, ninja = 5)") CONSOLE_COMMAND("addweapon", "i[weapon-id]", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConAddWeapon, this, "Gives weapon with id i to you (all = -1, hammer = 0, gun = 1, shotgun = 2, grenade = 3, laser = 4, ninja = 5)")
CONSOLE_COMMAND("removeweapon", "i[weapon-id]", CFGFLAG_SERVER | CMDFLAG_TEST, ConRemoveWeapon, this, "removes weapon with id i from you (all = -1, hammer = 0, gun = 1, shotgun = 2, grenade = 3, laser = 4, ninja = 5)") CONSOLE_COMMAND("removeweapon", "i[weapon-id]", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConRemoveWeapon, this, "removes weapon with id i from you (all = -1, hammer = 0, gun = 1, shotgun = 2, grenade = 3, laser = 4, ninja = 5)")
CONSOLE_COMMAND("shotgun", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConShotgun, this, "Gives a shotgun to you") CONSOLE_COMMAND("shotgun", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConShotgun, this, "Gives a shotgun to you")
CONSOLE_COMMAND("grenade", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConGrenade, this, "Gives a grenade launcher to you") CONSOLE_COMMAND("grenade", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConGrenade, this, "Gives a grenade launcher to you")
CONSOLE_COMMAND("laser", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConLaser, this, "Gives a laser to you") CONSOLE_COMMAND("laser", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConLaser, this, "Gives a laser to you")
CONSOLE_COMMAND("rifle", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConLaser, this, "Gives a laser to you") CONSOLE_COMMAND("rifle", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConLaser, this, "Gives a laser to you")
CONSOLE_COMMAND("jetpack", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConJetpack, this, "Gives jetpack to you") CONSOLE_COMMAND("jetpack", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConJetpack, this, "Gives jetpack to you")
CONSOLE_COMMAND("weapons", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConWeapons, this, "Gives all weapons to you") CONSOLE_COMMAND("weapons", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConWeapons, this, "Gives all weapons to you")
CONSOLE_COMMAND("unshotgun", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConUnShotgun, this, "Removes the shotgun from you") CONSOLE_COMMAND("unshotgun", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConUnShotgun, this, "Removes the shotgun from you")
CONSOLE_COMMAND("ungrenade", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConUnGrenade, this, "Removes the grenade launcher from you") CONSOLE_COMMAND("ungrenade", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConUnGrenade, this, "Removes the grenade launcher from you")
CONSOLE_COMMAND("unlaser", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConUnLaser, this, "Removes the laser from you") CONSOLE_COMMAND("unlaser", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConUnLaser, this, "Removes the laser from you")
CONSOLE_COMMAND("unrifle", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConUnLaser, this, "Removes the laser from you") CONSOLE_COMMAND("unrifle", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConUnLaser, this, "Removes the laser from you")
CONSOLE_COMMAND("unjetpack", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConUnJetpack, this, "Removes the jetpack from you") CONSOLE_COMMAND("unjetpack", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConUnJetpack, this, "Removes the jetpack from you")
CONSOLE_COMMAND("unweapons", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConUnWeapons, this, "Removes all weapons from you") CONSOLE_COMMAND("unweapons", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConUnWeapons, this, "Removes all weapons from you")
CONSOLE_COMMAND("ninja", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConNinja, this, "Makes you a ninja") CONSOLE_COMMAND("ninja", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConNinja, this, "Makes you a ninja")
CONSOLE_COMMAND("super", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConSuper, this, "Makes you super") CONSOLE_COMMAND("super", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConSuper, this, "Makes you super")
CONSOLE_COMMAND("unsuper", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConUnSuper, this, "Removes super from you") CONSOLE_COMMAND("unsuper", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConUnSuper, this, "Removes super from you")
CONSOLE_COMMAND("unsolo", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConUnSolo, this, "Puts you out of solo part") CONSOLE_COMMAND("unsolo", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConUnSolo, this, "Puts you out of solo part")
CONSOLE_COMMAND("undeep", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConUnDeep, this, "Puts you out of deep freeze") CONSOLE_COMMAND("undeep", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConUnDeep, this, "Puts you out of deep freeze")
CONSOLE_COMMAND("left", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConGoLeft, this, "Makes you move 1 tile left") CONSOLE_COMMAND("left", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConGoLeft, this, "Makes you move 1 tile left")
CONSOLE_COMMAND("right", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConGoRight, this, "Makes you move 1 tile right") CONSOLE_COMMAND("right", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConGoRight, this, "Makes you move 1 tile right")
CONSOLE_COMMAND("up", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConGoUp, this, "Makes you move 1 tile up") CONSOLE_COMMAND("up", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConGoUp, this, "Makes you move 1 tile up")
CONSOLE_COMMAND("down", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConGoDown, this, "Makes you move 1 tile down") CONSOLE_COMMAND("down", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConGoDown, this, "Makes you move 1 tile down")
CONSOLE_COMMAND("move", "i[x] i[y]", CFGFLAG_SERVER | CMDFLAG_TEST, ConMove, this, "Moves to the tile with x/y-number ii") CONSOLE_COMMAND("move", "i[x] i[y]", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConMove, this, "Moves to the tile with x/y-number ii")
CONSOLE_COMMAND("move_raw", "i[x] i[y]", CFGFLAG_SERVER | CMDFLAG_TEST, ConMoveRaw, this, "Moves to the point with x/y-coordinates ii") CONSOLE_COMMAND("move_raw", "i[x] i[y]", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConMoveRaw, this, "Moves to the point with x/y-coordinates ii")
CONSOLE_COMMAND("force_pause", "v[id] i[seconds]", CFGFLAG_SERVER, ConForcePause, this, "Force i to pause for i seconds") CONSOLE_COMMAND("force_pause", "v[id] i[seconds]", CFGFLAG_SERVER, ConForcePause, this, "Force i to pause for i seconds")
CONSOLE_COMMAND("force_unpause", "v[id]", CFGFLAG_SERVER, ConForcePause, this, "Set force-pause timer of i to 0.") CONSOLE_COMMAND("force_unpause", "v[id]", CFGFLAG_SERVER, ConForcePause, this, "Set force-pause timer of i to 0.")
@ -54,6 +54,6 @@ CONSOLE_COMMAND("moderate", "", CFGFLAG_SERVER, ConModerate, this, "Enables/disa
CONSOLE_COMMAND("vote_no", "", CFGFLAG_SERVER, ConVoteNo, this, "Same as \"vote no\"") CONSOLE_COMMAND("vote_no", "", CFGFLAG_SERVER, ConVoteNo, this, "Same as \"vote no\"")
CONSOLE_COMMAND("save_dry", "", CFGFLAG_SERVER, ConDrySave, this, "Dump the current savestring") CONSOLE_COMMAND("save_dry", "", CFGFLAG_SERVER, ConDrySave, this, "Dump the current savestring")
CONSOLE_COMMAND("freezehammer", "v[id]", CFGFLAG_SERVER | CMDFLAG_TEST, ConFreezeHammer, this, "Gives a player Freeze Hammer") CONSOLE_COMMAND("freezehammer", "v[id]", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConFreezeHammer, this, "Gives a player Freeze Hammer")
CONSOLE_COMMAND("unfreezehammer", "v[id]", CFGFLAG_SERVER | CMDFLAG_TEST, ConUnFreezeHammer, this, "Removes Freeze Hammer from a player") CONSOLE_COMMAND("unfreezehammer", "v[id]", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConUnFreezeHammer, this, "Removes Freeze Hammer from a player")
#undef CONSOLE_COMMAND #undef CONSOLE_COMMAND

View file

@ -2950,13 +2950,13 @@ void CGameContext::OnConsoleInit()
Console()->Register("tune", "s[tuning] i[value]", CFGFLAG_SERVER | CFGFLAG_GAME, ConTuneParam, this, "Tune variable to value"); Console()->Register("tune", "s[tuning] i[value]", CFGFLAG_SERVER | CFGFLAG_GAME, ConTuneParam, this, "Tune variable to value");
Console()->Register("toggle_tune", "s[tuning] i[value 1] i[value 2]", CFGFLAG_SERVER | CFGFLAG_GAME, ConToggleTuneParam, this, "Toggle tune variable"); Console()->Register("toggle_tune", "s[tuning] i[value 1] i[value 2]", CFGFLAG_SERVER | CFGFLAG_GAME, ConToggleTuneParam, this, "Toggle tune variable");
Console()->Register("tune_reset", "", CFGFLAG_SERVER, ConTuneReset, this, "Reset tuning"); Console()->Register("tune_reset", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConTuneReset, this, "Reset tuning");
Console()->Register("tune_dump", "", CFGFLAG_SERVER, ConTuneDump, this, "Dump tuning"); Console()->Register("tune_dump", "", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConTuneDump, this, "Dump tuning");
Console()->Register("tune_zone", "i[zone] s[tuning] i[value]", CFGFLAG_SERVER | CFGFLAG_GAME, ConTuneZone, this, "Tune in zone a variable to value"); Console()->Register("tune_zone", "i[zone] s[tuning] i[value]", CFGFLAG_SERVER | CFGFLAG_GAME, ConTuneZone, this, "Tune in zone a variable to value");
Console()->Register("tune_zone_dump", "i[zone]", CFGFLAG_SERVER, ConTuneDumpZone, this, "Dump zone tuning in zone x"); Console()->Register("tune_zone_dump", "i[zone]", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConTuneDumpZone, this, "Dump zone tuning in zone x");
Console()->Register("tune_zone_reset", "?i[zone]", CFGFLAG_SERVER, ConTuneResetZone, this, "reset zone tuning in zone x or in all zones"); Console()->Register("tune_zone_reset", "?i[zone]", CFGFLAG_SERVER | CFGFLAG_GAME | CFGFLAG_NOMAPCFG, ConTuneResetZone, this, "reset zone tuning in zone x or in all zones");
Console()->Register("tune_zone_enter", "i[zone] r[message]", CFGFLAG_SERVER | CFGFLAG_GAME, ConTuneSetZoneMsgEnter, this, "which message to display on zone enter; use 0 for normal area");
Console()->Register("tune_zone_leave", "i[zone] r[message]", CFGFLAG_SERVER | CFGFLAG_GAME, ConTuneSetZoneMsgLeave, this, "which message to display on zone leave; use 0 for normal area"); Console()->Register("tune_zone_leave", "i[zone] r[message]", CFGFLAG_SERVER | CFGFLAG_GAME, ConTuneSetZoneMsgLeave, this, "which message to display on zone leave; use 0 for normal area");
Console()->Register("tune_zone_enter", "i[zone] r[message]", CFGFLAG_SERVER | CFGFLAG_GAME, ConTuneSetZoneMsgEnter, this, "which message to display on zone enter; use 0 for normal area");
Console()->Register("mapbug", "s[mapbug]", CFGFLAG_SERVER | CFGFLAG_GAME, ConMapbug, this, "Enable map compatibility mode using the specified bug (example: grenade-doublexplosion@ddnet.tw)"); Console()->Register("mapbug", "s[mapbug]", CFGFLAG_SERVER | CFGFLAG_GAME, ConMapbug, this, "Enable map compatibility mode using the specified bug (example: grenade-doublexplosion@ddnet.tw)");
Console()->Register("switch_open", "i[switch]", CFGFLAG_SERVER | CFGFLAG_GAME, ConSwitchOpen, this, "Whether a switch is deactivated by default (otherwise activated)"); Console()->Register("switch_open", "i[switch]", CFGFLAG_SERVER | CFGFLAG_GAME, ConSwitchOpen, this, "Whether a switch is deactivated by default (otherwise activated)");
Console()->Register("pause_game", "", CFGFLAG_SERVER, ConPause, this, "Pause/unpause game"); Console()->Register("pause_game", "", CFGFLAG_SERVER, ConPause, this, "Pause/unpause game");