use NetworkTime.localTime where local time was previously implied when using NetworkTime.time on the server. for clarity.

This commit is contained in:
vis2k 2021-06-16 16:58:20 +08:00
parent 7aecc2b19a
commit d07f10b7be
3 changed files with 6 additions and 6 deletions

View File

@ -50,10 +50,10 @@ void Update()
if (!NetworkServer.active) return;
// rebuild all spawned NetworkIdentity's observers every interval
if (NetworkTime.time >= lastRebuildTime + rebuildInterval)
if (NetworkTime.localTime >= lastRebuildTime + rebuildInterval)
{
RebuildAll();
lastRebuildTime = NetworkTime.time;
lastRebuildTime = NetworkTime.localTime;
}
}
}

View File

@ -103,10 +103,10 @@ internal void Update()
// rebuild all spawned entities' observers every 'interval'
// this will call OnRebuildObservers which then returns the
// observers at grid[position] for each entity.
if (NetworkTime.time >= lastRebuildTime + rebuildInterval)
if (NetworkTime.localTime >= lastRebuildTime + rebuildInterval)
{
RebuildAll();
lastRebuildTime = NetworkTime.time;
lastRebuildTime = NetworkTime.localTime;
}
}

View File

@ -291,7 +291,7 @@ void OnLogStatistics()
{
if (ServerActive())
{
string log = "kcp SERVER @ time: " + NetworkTime.time + "\n";
string log = "kcp SERVER @ time: " + NetworkTime.localTime + "\n";
log += $" connections: {server.connections.Count}\n";
log += $" MaxSendRate (avg): {PrettyBytes(GetAverageMaxSendRate())}/s\n";
log += $" MaxRecvRate (avg): {PrettyBytes(GetAverageMaxReceiveRate())}/s\n";
@ -304,7 +304,7 @@ void OnLogStatistics()
if (ClientConnected())
{
string log = "kcp CLIENT @ time: " + NetworkTime.time + "\n";
string log = "kcp CLIENT @ time: " + NetworkTime.localTime + "\n";
log += $" MaxSendRate: {PrettyBytes(client.connection.MaxSendRate)}/s\n";
log += $" MaxRecvRate: {PrettyBytes(client.connection.MaxReceiveRate)}/s\n";
log += $" SendQueue: {client.connection.SendQueueCount}\n";