From 8c1ab9b12e105a1ee9e351fe9ac57ee5638cf4e3 Mon Sep 17 00:00:00 2001 From: Ivan Filipenkov Date: Fri, 18 Aug 2023 17:49:49 +0300 Subject: [PATCH 1/2] fix bind ip --- DangerousD/GameCore/Managers/AppManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DangerousD/GameCore/Managers/AppManager.cs b/DangerousD/GameCore/Managers/AppManager.cs index aedb493..c5f79c4 100644 --- a/DangerousD/GameCore/Managers/AppManager.cs +++ b/DangerousD/GameCore/Managers/AppManager.cs @@ -23,7 +23,7 @@ namespace DangerousD.GameCore public class AppManager : Game { public static AppManager Instance { get; private set; } - public string IpAddress { get; private set; } = "127.0.0.1"; + public string IpAddress { get; private set; } = "0.0.0.0"; private GraphicsDeviceManager _graphics; private SpriteBatch _spriteBatch; public GameState gameState { get; private set; } From 6550f1273d60777c03db8e8e457a83b19028435b Mon Sep 17 00:00:00 2001 From: Ivan Filipenkov Date: Fri, 18 Aug 2023 17:54:00 +0300 Subject: [PATCH 2/2] test --- DangerousD/GameCore/Managers/AppManager.cs | 1 + DangerousD/GameCore/Managers/GameManager.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DangerousD/GameCore/Managers/AppManager.cs b/DangerousD/GameCore/Managers/AppManager.cs index c5f79c4..399b866 100644 --- a/DangerousD/GameCore/Managers/AppManager.cs +++ b/DangerousD/GameCore/Managers/AppManager.cs @@ -220,6 +220,7 @@ namespace DangerousD.GameCore public void NetworkSync(List networkTasks) { + DebugHUD.Log("networksync"); foreach (NetworkTask networkTask in networkTasks) { switch (networkTask.operation) diff --git a/DangerousD/GameCore/Managers/GameManager.cs b/DangerousD/GameCore/Managers/GameManager.cs index 0c23c12..8608e77 100644 --- a/DangerousD/GameCore/Managers/GameManager.cs +++ b/DangerousD/GameCore/Managers/GameManager.cs @@ -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;