Group CNetMsg_Sv_VoteOptionListAdd

This commit is contained in:
heinrich5991 2023-12-23 15:42:43 +01:00
parent c12835bc39
commit f81828e78e
2 changed files with 15 additions and 0 deletions

View file

@ -572,4 +572,7 @@ Messages = [
NetMessageEx("Sv_CommandInfoRemove", "commandinfo-remove@netmsg.ddnet.org", [ NetMessageEx("Sv_CommandInfoRemove", "commandinfo-remove@netmsg.ddnet.org", [
NetStringStrict("m_pName") 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", []),
] ]

View file

@ -1432,10 +1432,22 @@ void CGameContext::ProgressVoteOptions(int ClientID)
} }
// send msg // send msg
if(pPl->m_SendVoteIndex == 0)
{
CNetMsg_Sv_VoteOptionGroupStart StartMsg;
Server()->SendPackMsg(&StartMsg, MSGFLAG_VITAL, ClientID);
}
OptionMsg.m_NumOptions = NumVotesToSend; OptionMsg.m_NumOptions = NumVotesToSend;
Server()->SendPackMsg(&OptionMsg, MSGFLAG_VITAL, ClientID); Server()->SendPackMsg(&OptionMsg, MSGFLAG_VITAL, ClientID);
pPl->m_SendVoteIndex += NumVotesToSend; 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) void CGameContext::OnClientEnter(int ClientID)