Skip to content

Commit

Permalink
fix: Default ping for VPN cases as well as exception handling on navg…
Browse files Browse the repository at this point in the history
…raph generation
  • Loading branch information
nt153133 committed Mar 17, 2024
1 parent 48d57c9 commit b67cc4d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Helpers/Navigation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Queue<NavGraph.INode>> GenerateNodes(uint ZoneId, Vector3 xyz)
internal static async Task<Queue<NavGraph.INode>?> 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<bool> GetTo(Location location)
Expand Down
7 changes: 7 additions & 0 deletions Helpers/Ping/PingChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b67cc4d

Please sign in to comment.