UpdateServer checks if should sync in general

This commit is contained in:
mischa 2024-10-15 14:58:54 +02:00
parent 4612bc2e17
commit adde49a423

View File

@ -349,8 +349,7 @@ void UpdateServerDelta()
// authoritative movement done by the host will have to be broadcasted
// here by checking IsClientWithAuthority.
// TODO send same time that NetworkServer sends time snapshot?
if (NetworkTime.localTime >= lastServerSendTime + sendInterval && // CUSTOM CHANGE: allow custom sendRate + sendInterval again
(syncDirection == SyncDirection.ServerToClient || IsClientWithAuthority))
if (NetworkTime.localTime >= lastServerSendTime + sendInterval) // CUSTOM CHANGE: allow custom sendRate + sendInterval again
{
// send snapshot without timestamp.
// receiver gets it from batch timestamp to save bandwidth.
@ -426,8 +425,11 @@ void UpdateServerInterpolation()
void UpdateServer()
{
// broadcasting
if (syncDirection == SyncDirection.ServerToClient || IsClientWithAuthority)
{
UpdateServerBaseline();
UpdateServerDelta();
}
// interpolate remote clients
UpdateServerInterpolation();