added config command "clear votes"

This commit is contained in:
heinrich5991 2010-10-14 12:11:17 +02:00
parent 0cd8390036
commit 14c0f77c45
2 changed files with 17 additions and 1 deletions

View file

@ -1174,6 +1174,20 @@ void CGameContext::ConAddVote(IConsole::IResult *pResult, void *pUserData, int C
pSelf->Server()->SendPackMsg(&OptionMsg, MSGFLAG_VITAL, -1);
}
void CGameContext::ConClearVotes(IConsole::IResult *pResult, void *pUserData, int ClientID)
{
CGameContext *pSelf = (CGameContext *)pUserData;
pSelf->m_pVoteOptionHeap->Reset();
pSelf->m_pVoteOptionFirst = 0;
pSelf->m_pVoteOptionLast = 0;
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", "cleared vote options");
CNetMsg_Sv_VoteClearOptions ClearOptionsMsg;
pSelf->Server()->SendPackMsg(&ClearOptionsMsg, MSGFLAG_VITAL, -1);
}
void CGameContext::ConVote(IConsole::IResult *pResult, void *pUserData, int ClientID)
{
CGameContext *pSelf = (CGameContext *)pUserData;
@ -2319,6 +2333,8 @@ void CGameContext::OnConsoleInit()
Console()->Register("broadcast", "r", CFGFLAG_SERVER, ConBroadcast, this, "Changes the broadcast message for a moment", 3);
Console()->Register("say", "r", CFGFLAG_SERVER, ConSay, this, "Sends a server message to all players", 3);
Console()->Register("set_team", "ii", CFGFLAG_SERVER, ConSetTeam, this, "Changes the team of player i1 to team i2", 2);
Console()->Register("addvote", "r", CFGFLAG_SERVER, ConAddVote, this, "Adds a vote entry to the clients", 4);
Console()->Register("clear_votes", "", CFGFLAG_SERVER, ConClearVotes, this, "Clears the vote list", 4);
Console()->Register("tune", "si", CFGFLAG_SERVER, ConTuneParam, this, "Modifies tune parameter s to value i", 4);
Console()->Register("tune_reset", "", CFGFLAG_SERVER, ConTuneReset, this, "Resets all tuning", 4);
@ -2374,7 +2390,6 @@ void CGameContext::OnConsoleInit()
Console()->Register("right", "?i", CFGFLAG_SERVER, ConGoRight, this, "Makes you or player i move 1 tile right", 1);
Console()->Register("up", "?i", CFGFLAG_SERVER, ConGoUp, this, "Makes you or player i move 1 tile up", 1);
Console()->Register("down", "?i", CFGFLAG_SERVER, ConGoDown, this, "Makes you or player i move 1 tile down", 1);
Console()->Register("addvote", "r", CFGFLAG_SERVER, ConAddVote, this, "Adds a vote entry to the clients", 4);
Console()->Register("broadtime", "", CFGFLAG_SERVER, ConBroadTime, this, "Toggles Showing the time string in race", -1);
Console()->Register("cmdlist", "", CFGFLAG_SERVER, ConCmdList, this, "Shows the list of all commands", -1);

View file

@ -106,6 +106,7 @@ class CGameContext : public IGameServer
static void ConGoDown(IConsole::IResult *pResult, void *pUserData, int ClientId);
static void ConAddVote(IConsole::IResult *pResult, void *pUserData, int ClientId);
static void ConClearVotes(IConsole::IResult *pResult, void *pUserData, int ClientId);
static void ConVote(IConsole::IResult *pResult, void *pUserData, int ClientId);
static void ConchainSpecialMotdupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);