This commit is contained in:
Ivan Filipenkov 2023-08-18 17:54:00 +03:00
parent 8c1ab9b12e
commit 6550f1273d
2 changed files with 3 additions and 1 deletions

View file

@ -220,6 +220,7 @@ namespace DangerousD.GameCore
public void NetworkSync(List<NetworkTask> networkTasks)
{
DebugHUD.Log("networksync");
foreach (NetworkTask networkTask in networkTasks)
{
switch (networkTask.operation)

View file

@ -134,8 +134,9 @@ namespace DangerousD.GameCore
{
if (AppManager.Instance.NetworkTasks.Count > 0)
{
if (gameTime.ElapsedGameTime.Milliseconds - _lastUpdate > 1000)
if (gameTime.TotalGameTime.Milliseconds - _lastUpdate > 1000)
{
AppManager.Instance.DebugHUD.Log("sending");
AppManager.Instance.NetworkManager.SendMsg(AppManager.Instance.NetworkTasks.ToList());
AppManager.Instance.NetworkTasks.Clear();
_lastUpdate = gameTime.ElapsedGameTime.Milliseconds;