mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
Notify about vote when authed
This commit is contained in:
parent
b05674c48d
commit
567f0aa6d4
|
@ -188,15 +188,20 @@ void CVoting::OnMessage(int MsgType, void *pRawMsg)
|
||||||
if(MsgType == NETMSGTYPE_SV_VOTESET)
|
if(MsgType == NETMSGTYPE_SV_VOTESET)
|
||||||
{
|
{
|
||||||
CNetMsg_Sv_VoteSet *pMsg = (CNetMsg_Sv_VoteSet *)pRawMsg;
|
CNetMsg_Sv_VoteSet *pMsg = (CNetMsg_Sv_VoteSet *)pRawMsg;
|
||||||
|
OnReset();
|
||||||
if(pMsg->m_Timeout)
|
if(pMsg->m_Timeout)
|
||||||
{
|
{
|
||||||
OnReset();
|
|
||||||
str_copy(m_aDescription, pMsg->m_pDescription, sizeof(m_aDescription));
|
str_copy(m_aDescription, pMsg->m_pDescription, sizeof(m_aDescription));
|
||||||
str_copy(m_aReason, pMsg->m_pReason, sizeof(m_aReason));
|
str_copy(m_aReason, pMsg->m_pReason, sizeof(m_aReason));
|
||||||
m_Closetime = time() + time_freq() * pMsg->m_Timeout;
|
m_Closetime = time() + time_freq() * pMsg->m_Timeout;
|
||||||
|
|
||||||
|
if(Client()->RconAuthed())
|
||||||
|
{
|
||||||
|
char aBuf[512];
|
||||||
|
str_format(aBuf, sizeof(aBuf), "%s (%s)", m_aDescription, m_aReason);
|
||||||
|
Client()->Notify("DDNet Vote", aBuf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
OnReset();
|
|
||||||
}
|
}
|
||||||
else if(MsgType == NETMSGTYPE_SV_VOTESTATUS)
|
else if(MsgType == NETMSGTYPE_SV_VOTESTATUS)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue