mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
UpdateServer checks if should sync in general
This commit is contained in:
parent
4612bc2e17
commit
adde49a423
@ -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
|
||||||
UpdateServerBaseline();
|
if (syncDirection == SyncDirection.ServerToClient || IsClientWithAuthority)
|
||||||
UpdateServerDelta();
|
{
|
||||||
|
UpdateServerBaseline();
|
||||||
|
UpdateServerDelta();
|
||||||
|
}
|
||||||
|
|
||||||
// interpolate remote clients
|
// interpolate remote clients
|
||||||
UpdateServerInterpolation();
|
UpdateServerInterpolation();
|
||||||
|
Loading…
Reference in New Issue
Block a user