diff --git a/src/game/ddracecommands.h b/src/game/ddracecommands.h index 8e5639ed3..cf59dab29 100644 --- a/src/game/ddracecommands.h +++ b/src/game/ddracecommands.h @@ -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") diff --git a/src/game/server/ddracechat.cpp b/src/game/server/ddracechat.cpp index 51392ba18..0e48c3708 100644 --- a/src/game/server/ddracechat.cpp +++ b/src/game/server/ddracechat.cpp @@ -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; diff --git a/src/game/server/ddracechat.h b/src/game/server/ddracechat.h index 07f7f04d8..ce41e4982 100644 --- a/src/game/server/ddracechat.h +++ b/src/game/server/ddracechat.h @@ -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 ' 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)") diff --git a/src/game/server/ddracecommands.cpp b/src/game/server/ddracecommands.cpp index 12b9d9615..0f396120b 100644 --- a/src/game/server/ddracecommands.cpp +++ b/src/game/server/ddracecommands.cpp @@ -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;