2030: Move /list to ddracechat r=def- a=fokkonaut



Co-authored-by: fokkonaut <35420825+fokkonaut@users.noreply.github.com>
This commit is contained in:
bors[bot] 2020-01-06 21:39:19 +00:00 committed by GitHub
commit 7d7b51011d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 15 deletions

View file

@ -37,7 +37,6 @@ CONSOLE_COMMAND("move_raw", "i[x] i[y]", CFGFLAG_SERVER|CMDFLAG_TEST, ConMoveRaw
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("list", "?s[filter]", CFGFLAG_CHAT, ConList, this, "List connected players with optional case-insensitive substring matching filter")
CONSOLE_COMMAND("set_team_ddr", "v[id] ?i[team]", CFGFLAG_SERVER, ConSetDDRTeam, this, "Set ddrace team of a player")
CONSOLE_COMMAND("uninvite", "v[id] ?i[team]", CFGFLAG_SERVER, ConUninvite, this, "Uninvite player from team")

View file

@ -63,6 +63,19 @@ void CGameContext::ConInfo(IConsole::IResult *pResult, void *pUserData)
"Or visit DDNet.tw");
}
void CGameContext::ConList(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
int ClientID = pResult->m_ClientID;
if(!CheckClientID(ClientID)) return;
char zerochar = 0;
if(pResult->NumArguments() > 0)
pSelf->List(ClientID, pResult->GetString(0));
else
pSelf->List(ClientID, &zerochar);
}
void CGameContext::ConHelp(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *) pUserData;

View file

@ -13,6 +13,7 @@ CHAT_COMMAND("eyeemote", "?s['on'|'off'|'toggle']", CFGFLAG_CHAT|CFGFLAG_SERVER,
CHAT_COMMAND("settings", "?s[configname]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSettings, this, "Shows gameplay information for this server")
CHAT_COMMAND("help", "?r[command]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConHelp, this, "Shows help to command r, general help if left blank")
CHAT_COMMAND("info", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConInfo, this, "Shows info about this server")
CHAT_COMMAND("list", "?s[filter]", CFGFLAG_CHAT, ConList, this, "List connected players with optional case-insensitive substring matching filter")
CHAT_COMMAND("me", "r[message]", CFGFLAG_CHAT|CFGFLAG_SERVER|CFGFLAG_NONTEEHISTORIC, ConMe, this, "Like the famous irc command '/me says hi' will display '<yourname> says hi'")
CHAT_COMMAND("w", "s[player name] r[message]", CFGFLAG_CHAT|CFGFLAG_SERVER|CFGFLAG_NONTEEHISTORIC, ConWhisper, this, "Whisper something to someone (private message)")
CHAT_COMMAND("whisper", "s[player name] r[message]", CFGFLAG_CHAT|CFGFLAG_SERVER|CFGFLAG_NONTEEHISTORIC, ConWhisper, this, "Whisper something to someone (private message)")

View file

@ -639,20 +639,6 @@ void CGameContext::ConModerate(IConsole::IResult *pResult, void *pUserData)
pSelf->SendChatTarget(pResult->m_ClientID, "Active moderator mode disabled for you.");
}
void CGameContext::ConList(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
int ClientID = pResult->m_ClientID;
if(!CheckClientID(ClientID)) return;
char zerochar = 0;
if(pResult->NumArguments() > 0)
pSelf->List(ClientID, pResult->GetString(0));
else
pSelf->List(ClientID, &zerochar);
}
void CGameContext::ConSetDDRTeam(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;