Skip to content

Commit

Permalink
sync states during 1 player drasticly lowered
Browse files Browse the repository at this point in the history
  • Loading branch information
cubicgraphics committed May 14, 2024
1 parent e251152 commit f5acdda
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions BeatTogether.DedicatedServer.Kernel/PlayerRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public bool AddPlayer(IPlayer player)
_playersByRemoteEndPoint.TryAdd(player.Endpoint, player);
_playersByConnectionId.TryAdd(player.ConnectionId, player);
_PlayerCount++;
MillisBetweenPoseSyncStatePackets = (long)(0.94 * _PlayerCount + 15);
MillisBetweenScoreSyncStatePackets = (long)(1.5 * _PlayerCount + 20);
MillisBetweenPoseSyncStatePackets = _PlayerCount == 1 ? 1000 : (long)(0.94 * _PlayerCount + 15);
MillisBetweenScoreSyncStatePackets = _PlayerCount == 1 ? 1000 : (long)(1.5 * _PlayerCount + 20);
return true;
}
}
Expand All @@ -93,8 +93,8 @@ public void RemovePlayer(IPlayer player)
_playersByRemoteEndPoint.Remove(player.Endpoint, out _);
_playersByConnectionId.Remove(player.ConnectionId, out _);
_PlayerCount--;
MillisBetweenPoseSyncStatePackets = (long)(0.94 * _PlayerCount + 15);
MillisBetweenScoreSyncStatePackets = (long)(1.5 * _PlayerCount + 20);
MillisBetweenPoseSyncStatePackets = _PlayerCount == 1 ? 1000 : (long)(0.94 * _PlayerCount + 15);
MillisBetweenScoreSyncStatePackets = _PlayerCount == 1 ? 1000 : (long)(1.5 * _PlayerCount + 20);
}
}
}
Expand Down

0 comments on commit f5acdda

Please sign in to comment.