Send unreliable traffic as reliable when we have just one channel
This commit is contained in:
parent
2d0badde9a
commit
2ac25bebaa
1 changed files with 8 additions and 0 deletions
|
|
@ -634,6 +634,14 @@ static bool sendMessageEnet(short ptype, short paylen, const void* payload, uint
|
|||
// the peer's supported channel count.
|
||||
if (!IS_SUNSHINE() || channelId >= peer->channelCount) {
|
||||
channelId = 0;
|
||||
|
||||
// Send unreliable traffic as reliable if we only have one channel.
|
||||
// This avoids unwanted sequencing between reliable and unreliable
|
||||
// traffic that can lead to delays.
|
||||
if (flags == 0) {
|
||||
flags |= ENET_PACKET_FLAG_RELIABLE;
|
||||
enetPacket->flags |= ENET_PACKET_FLAG_RELIABLE;
|
||||
}
|
||||
}
|
||||
|
||||
// Queue the packet to be sent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue