Add sv_team0mode

This commit is contained in:
Dennis Felsing 2024-04-12 00:15:38 +08:00
parent 8dcaee069e
commit e1ab2ea07e
2 changed files with 10 additions and 0 deletions

View file

@ -472,6 +472,7 @@ MACRO_CONFIG_INT(SvSaveSwapGamesDelay, sv_saveswapgames_delay, 30, 0, 10000, CFG
MACRO_CONFIG_INT(SvSaveSwapGamesPenalty, sv_saveswapgames_penalty, 60, 0, 10000, CFGFLAG_SERVER, "Penalty in seconds for saving or swapping position")
MACRO_CONFIG_INT(SvSwapTimeout, sv_swap_timeout, 180, 0, 10000, CFGFLAG_SERVER, "Timeout in seconds before option to swap expires")
MACRO_CONFIG_INT(SvSwap, sv_swap, 1, 0, 1, CFGFLAG_SERVER, "Enable /swap")
MACRO_CONFIG_INT(SvTeam0Mode, sv_team0mode, 0, 0, 1, CFGFLAG_SERVER, "Enables /team0mode")
MACRO_CONFIG_INT(SvUseSql, sv_use_sql, 0, 0, 1, CFGFLAG_SERVER, "Enables MySQL backend instead of SQLite backend (sv_sqlite_file is still used as fallback write server when no MySQL server is reachable)")
MACRO_CONFIG_INT(SvSqlQueriesDelay, sv_sql_queries_delay, 1, 0, 20, CFGFLAG_SERVER, "Delay in seconds between SQL queries of a single player")
MACRO_CONFIG_STR(SvSqliteFile, sv_sqlite_file, 64, "ddnet-server.sqlite", CFGFLAG_SERVER, "File to store ranks in case sv_use_sql is turned off or used as backup sql server")

View file

@ -1134,6 +1134,15 @@ void CGameContext::ConTeam0Mode(IConsole::IResult *pResult, void *pUserData)
return;
}
if(!g_Config.m_SvTeam0Mode)
{
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"chatresp",
"Team mode change is disabled on this server.");
return;
}
int Team = pController->Teams().m_Core.Team(pResult->m_ClientId);
bool Mode = pController->Teams().TeamFlock(Team);