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:
sboxbot
2025-11-30 16:29:15 +00:00
committed by GitHub
parent b637389840
commit 705f7ab7f5
3 changed files with 5 additions and 6 deletions

View File

@@ -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 )

View File

@@ -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();

View File

@@ -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();
}