Skip to content

Commit

Permalink
After testing. Sending multiple slightly smaller packets over Udp = b…
Browse files Browse the repository at this point in the history
…ad. Keep with the large singular packet (for now).
  • Loading branch information
paulov-t committed Feb 1, 2024
1 parent 9e62f14 commit ff33766
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions Source/Coop/Components/CoopGameComponents/CoopGameComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,19 +297,19 @@ private IEnumerator SendPlayerStatePacket()
//Logger.LogDebug($"{nameof(playerStatesPacket)} is {serialized.Length} in Length");

// Testing the length MTU. If over the traffic limit, then try sending lots of smaller packets
if (serialized.Length >= 1460)
{
#if DEBUG
Logger.LogError($"{nameof(playerStatesPacket)} is {serialized.Length} in Length, this will be network split");
#endif
foreach(var psp in playerStatesPacket.PlayerStates)
{
// wait a little bit for the previous packet to process thru
yield return new WaitForSeconds(0.033f);
GameClient.SendData(serialized);
}
}
else
// if (serialized.Length >= 1460)
// {
//#if DEBUG
// Logger.LogError($"{nameof(playerStatesPacket)} is {serialized.Length} in Length, this will be network split");
//#endif
// foreach(var psp in playerStatesPacket.PlayerStates)
// {
// // wait a little bit for the previous packet to process thru
// yield return new WaitForSeconds(0.033f);
// GameClient.SendData(serialized);
// }
// }
// else
GameClient.SendData(serialized);

LastPlayerStateSent = DateTime.Now;
Expand Down

0 comments on commit ff33766

Please sign in to comment.