From f81828e78e42108e7ee4edba83ef0b0451400025 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Sat, 23 Dec 2023 15:42:43 +0100 Subject: [PATCH] Group `CNetMsg_Sv_VoteOptionListAdd` --- datasrc/network.py | 3 +++ src/game/server/gamecontext.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/datasrc/network.py b/datasrc/network.py index 7ad2c0244..08739f0e3 100644 --- a/datasrc/network.py +++ b/datasrc/network.py @@ -572,4 +572,7 @@ Messages = [ NetMessageEx("Sv_CommandInfoRemove", "commandinfo-remove@netmsg.ddnet.org", [ NetStringStrict("m_pName") ]), + + NetMessageEx("Sv_VoteOptionGroupStart", "sv-vote-option-group-start@netmsg.ddnet.org", []), + NetMessageEx("Sv_VoteOptionGroupEnd", "sv-vote-option-group-end@netmsg.ddnet.org", []), ] diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 8bb560595..5ee861283 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -1432,10 +1432,22 @@ void CGameContext::ProgressVoteOptions(int ClientID) } // send msg + if(pPl->m_SendVoteIndex == 0) + { + CNetMsg_Sv_VoteOptionGroupStart StartMsg; + Server()->SendPackMsg(&StartMsg, MSGFLAG_VITAL, ClientID); + } + OptionMsg.m_NumOptions = NumVotesToSend; Server()->SendPackMsg(&OptionMsg, MSGFLAG_VITAL, ClientID); pPl->m_SendVoteIndex += NumVotesToSend; + + if(pPl->m_SendVoteIndex == m_NumVoteOptions) + { + CNetMsg_Sv_VoteOptionGroupEnd EndMsg; + Server()->SendPackMsg(&EndMsg, MSGFLAG_VITAL, ClientID); + } } void CGameContext::OnClientEnter(int ClientID)