diff --git a/Helpers/Navigation.cs b/Helpers/Navigation.cs index 4ef3bcfb..787be373 100644 --- a/Helpers/Navigation.cs +++ b/Helpers/Navigation.cs @@ -34,10 +34,18 @@ public static class Navigation public static readonly WaitTimer WaitTimer_0 = new(new TimeSpan(0, 0, 0, 15)); - internal static async Task> GenerateNodes(uint ZoneId, Vector3 xyz) + internal static async Task?> GenerateNodes(uint ZoneId, Vector3 xyz) { Log.Information($"Getpath {ZoneId} {xyz}"); - return await NavGraph.GetPathAsync(ZoneId, xyz); + try + { + return await NavGraph.GetPathAsync(ZoneId, xyz); + } + catch (Exception ex) + { + Log.Error($"NavGraph.GetPathAsync failed with an exception"); + return null; + } } public static async Task GetTo(Location location) diff --git a/Helpers/Ping/PingChecker.cs b/Helpers/Ping/PingChecker.cs index cdd95998..4a9e1b0c 100644 --- a/Helpers/Ping/PingChecker.cs +++ b/Helpers/Ping/PingChecker.cs @@ -66,6 +66,13 @@ public static async Task UpdatePing() } } + if (ip.Equals(IPAddress.Loopback)) + { + CurrentPing = 100; + lastWorld = WorldHelper.CurrentWorldId; + return; + } + CurrentPing = (int)await PingTimeAverage(ip.ToString(), 3); lastWorld = WorldHelper.CurrentWorldId; }