mirror of
https://github.com/Facepunch/sbox-public.git
synced 2025-12-23 22:48:07 -05:00
Fix delayed heartbeat and host stats sending every frame (#3500)
Co-authored-by: Andy <10728824+andy013@users.noreply.github.com>
This commit is contained in:
@@ -408,6 +408,8 @@ public static partial class Networking
|
||||
SteamNetwork.RunCallbacks();
|
||||
System?.Tick();
|
||||
System?.SendTableUpdates();
|
||||
System?.SendHeartbeat();
|
||||
System?.SendHostStats();
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
@@ -419,8 +421,6 @@ public static partial class Networking
|
||||
{
|
||||
try
|
||||
{
|
||||
System?.SendHeartbeat();
|
||||
System?.SendHostStats();
|
||||
System?.SendTableUpdates();
|
||||
}
|
||||
catch ( Exception e )
|
||||
|
||||
@@ -360,6 +360,8 @@ internal partial class NetworkSystem
|
||||
if ( !IsHost ) return;
|
||||
if ( timeSinceSentStats < 1.0f ) return;
|
||||
|
||||
timeSinceSentStats = 0;
|
||||
|
||||
var totalBytesIn = 0f;
|
||||
var totalBytesOut = 0f;
|
||||
var connections = Connection.All.Where( c => c != Connection.Local ).ToArray();
|
||||
|
||||
@@ -416,7 +416,7 @@ internal partial class GameInstanceDll : Engine.IGameInstanceDll
|
||||
}
|
||||
|
||||
//
|
||||
// Recieve incoming network messages
|
||||
// Recieve incoming network messages, send heartbeat and other outgoing messages
|
||||
//
|
||||
Networking.PreFrameTick();
|
||||
|
||||
@@ -437,9 +437,6 @@ internal partial class GameInstanceDll : Engine.IGameInstanceDll
|
||||
RunGameFrame( scene );
|
||||
}
|
||||
|
||||
//
|
||||
// Send heartbeat and other outgoing network messages
|
||||
//
|
||||
Networking.PostFrameTick();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user