mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge pull request #8007 from heinrich5991/pr_ddnet_vital_ping
Respond to pings sent as vital messages with vital pongs
This commit is contained in:
commit
2258cbca57
|
@ -1509,7 +1509,8 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
|
|||
else if(Msg == NETMSG_PING)
|
||||
{
|
||||
CMsgPacker MsgP(NETMSG_PING_REPLY, true);
|
||||
SendMsg(Conn, &MsgP, MSGFLAG_FLUSH);
|
||||
int Vital = (pPacket->m_Flags & NET_CHUNKFLAG_VITAL) != 0 ? MSGFLAG_VITAL : 0;
|
||||
SendMsg(Conn, &MsgP, MSGFLAG_FLUSH | Vital);
|
||||
}
|
||||
else if(Msg == NETMSG_PINGEX)
|
||||
{
|
||||
|
@ -1520,7 +1521,8 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
|
|||
}
|
||||
CMsgPacker MsgP(NETMSG_PONGEX, true);
|
||||
MsgP.AddRaw(pID, sizeof(*pID));
|
||||
SendMsg(Conn, &MsgP, MSGFLAG_FLUSH);
|
||||
int Vital = (pPacket->m_Flags & NET_CHUNKFLAG_VITAL) != 0 ? MSGFLAG_VITAL : 0;
|
||||
SendMsg(Conn, &MsgP, MSGFLAG_FLUSH | Vital);
|
||||
}
|
||||
else if(Conn == CONN_MAIN && Msg == NETMSG_PONGEX)
|
||||
{
|
||||
|
|
|
@ -1817,7 +1817,8 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
|||
else if(Msg == NETMSG_PING)
|
||||
{
|
||||
CMsgPacker Msgp(NETMSG_PING_REPLY, true);
|
||||
SendMsg(&Msgp, MSGFLAG_FLUSH, ClientID);
|
||||
int Vital = (pPacket->m_Flags & NET_CHUNKFLAG_VITAL) != 0 ? MSGFLAG_VITAL : 0;
|
||||
SendMsg(&Msgp, MSGFLAG_FLUSH | Vital, ClientID);
|
||||
}
|
||||
else if(Msg == NETMSG_PINGEX)
|
||||
{
|
||||
|
@ -1828,7 +1829,8 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
|||
}
|
||||
CMsgPacker Msgp(NETMSG_PONGEX, true);
|
||||
Msgp.AddRaw(pID, sizeof(*pID));
|
||||
SendMsg(&Msgp, MSGFLAG_FLUSH, ClientID);
|
||||
int Vital = (pPacket->m_Flags & NET_CHUNKFLAG_VITAL) != 0 ? MSGFLAG_VITAL : 0;
|
||||
SendMsg(&Msgp, MSGFLAG_FLUSH | Vital, ClientID);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue