Increased minimum midround sync timeout to 10 s, an extra check to make sure the server doesn't write position updates during midround syncing (because the entities may not exist client-side yet)
This commit is contained in:
@@ -963,8 +963,9 @@ namespace Barotrauma.Networking
|
||||
|
||||
WriteChatMessages(outmsg, c);
|
||||
|
||||
//write as many position updates as the message can fit
|
||||
while (outmsg.LengthBytes < config.MaximumTransmissionUnit - 20 &&
|
||||
//write as many position updates as the message can fit (only after midround syncing is done)
|
||||
while (!c.NeedsMidRoundSync &&
|
||||
outmsg.LengthBytes < config.MaximumTransmissionUnit - 20 &&
|
||||
c.PendingPositionUpdates.Count > 0)
|
||||
{
|
||||
var entity = c.PendingPositionUpdates.Dequeue();
|
||||
|
||||
@@ -305,7 +305,7 @@ namespace Barotrauma.Networking
|
||||
else
|
||||
{
|
||||
double midRoundSyncTimeOut = uniqueEvents.Count / MaxEventsPerWrite * server.UpdateInterval.TotalSeconds;
|
||||
midRoundSyncTimeOut = Math.Max(5.0f, midRoundSyncTimeOut * 2.0f);
|
||||
midRoundSyncTimeOut = Math.Max(10.0f, midRoundSyncTimeOut * 2.0f);
|
||||
|
||||
client.UnreceivedEntityEventCount = (UInt16)uniqueEvents.Count;
|
||||
client.FirstNewEventID = 0;
|
||||
|
||||
Reference in New Issue
Block a user