diff options
| author | heinrich5991 <heinrich5991@gmail.com> | 2011-01-21 20:46:00 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-01-23 17:53:53 +0100 |
| commit | 43b67aaa57619ae4457458ced00a200340fdb70f (patch) | |
| tree | cdac67372c5499bec4debcef51d3196c83840fc3 /src/game/server/gamecontext.cpp | |
| parent | fbe1f9cedfc0a64993651f22df452c17aad54c42 (diff) | |
| download | zcatch-43b67aaa57619ae4457458ced00a200340fdb70f.tar.gz zcatch-43b67aaa57619ae4457458ced00a200340fdb70f.zip | |
added server command to clear the votes. this fixes #47 partially
Diffstat (limited to 'src/game/server/gamecontext.cpp')
| -rw-r--r-- | src/game/server/gamecontext.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 063e3a00..d0e13f47 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -968,6 +968,18 @@ void CGameContext::ConAddVote(IConsole::IResult *pResult, void *pUserData) pSelf->Server()->SendPackMsg(&OptionMsg, MSGFLAG_VITAL, -1); } +void CGameContext::ConClearVotes(IConsole::IResult *pResult, void *pUserData) +{ + CGameContext *pSelf = (CGameContext *)pUserData; + + pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", "cleared votes"); + CNetMsg_Sv_VoteClearOptions VoteClearOptionsMsg; + pSelf->Server()->SendPackMsg(&VoteClearOptionsMsg, MSGFLAG_VITAL, -1); + pSelf->m_pVoteOptionHeap->Reset(); + pSelf->m_pVoteOptionFirst = 0; + pSelf->m_pVoteOptionLast = 0; +} + void CGameContext::ConVote(IConsole::IResult *pResult, void *pUserData) { CGameContext *pSelf = (CGameContext *)pUserData; @@ -1011,6 +1023,7 @@ void CGameContext::OnConsoleInit() Console()->Register("set_team_all", "i", CFGFLAG_SERVER, ConSetTeamAll, this, ""); Console()->Register("addvote", "r", CFGFLAG_SERVER, ConAddVote, this, ""); + Console()->Register("clear_votes", "", CFGFLAG_SERVER, ConClearVotes, this, ""); Console()->Register("vote", "r", CFGFLAG_SERVER, ConVote, this, ""); Console()->Chain("sv_motd", ConchainSpecialMotdupdate, this); |