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