Fixed gps key not found crash
This commit is contained in:
@@ -108,6 +108,9 @@ namespace SeamlessClientPlugin
|
|||||||
|
|
||||||
|
|
||||||
public static string Version = "1.2.10";
|
public static string Version = "1.2.10";
|
||||||
|
public static bool Debug = true;
|
||||||
|
|
||||||
|
|
||||||
private bool Initilized = false;
|
private bool Initilized = false;
|
||||||
private bool SentPingResponse = false;
|
private bool SentPingResponse = false;
|
||||||
public const ushort SeamlessClientNetID = 2936;
|
public const ushort SeamlessClientNetID = 2936;
|
||||||
@@ -241,8 +244,8 @@ namespace SeamlessClientPlugin
|
|||||||
|
|
||||||
public static void TryShow(string message)
|
public static void TryShow(string message)
|
||||||
{
|
{
|
||||||
// if (MySession.Static?.LocalHumanPlayer != null)
|
if (MySession.Static?.LocalHumanPlayer != null && Debug)
|
||||||
//MyAPIGateway.Utilities?.ShowMessage("NetworkClient", message);
|
MyAPIGateway.Utilities?.ShowMessage("NetworkClient", message);
|
||||||
|
|
||||||
MyLog.Default?.WriteLineAndConsole($"SeamlessClient: {message}");
|
MyLog.Default?.WriteLineAndConsole($"SeamlessClient: {message}");
|
||||||
}
|
}
|
||||||
|
@@ -470,7 +470,6 @@ namespace SeamlessClientPlugin.SeamlessTransfer
|
|||||||
}catch(Exception ex)
|
}catch(Exception ex)
|
||||||
{
|
{
|
||||||
SeamlessClient.TryShow(ex.ToString());
|
SeamlessClient.TryShow(ex.ToString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -127,7 +127,24 @@ namespace SeamlessClientPlugin.SeamlessTransfer
|
|||||||
if (MyMultiplayer.Static != null)
|
if (MyMultiplayer.Static != null)
|
||||||
{
|
{
|
||||||
MyHud.Chat.UnregisterChat(MyMultiplayer.Static);
|
MyHud.Chat.UnregisterChat(MyMultiplayer.Static);
|
||||||
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//Could throw error when there are no gps points
|
||||||
|
var PCollection = MySession.Static.Gpss[MySession.Static.LocalPlayerId];
|
||||||
|
PCollection?.Clear();
|
||||||
|
SeamlessClient.TryShow(PCollection.Count + "registered GPS points");
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
SeamlessClient.TryShow(ex.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MyHud.GpsMarkers.Clear();
|
||||||
|
|
||||||
|
|
||||||
MyMultiplayer.Static.ReplicationLayer.Disconnect();
|
MyMultiplayer.Static.ReplicationLayer.Disconnect();
|
||||||
MyMultiplayer.Static.ReplicationLayer.Dispose();
|
MyMultiplayer.Static.ReplicationLayer.Dispose();
|
||||||
|
|
||||||
@@ -136,13 +153,10 @@ namespace SeamlessClientPlugin.SeamlessTransfer
|
|||||||
|
|
||||||
//Sync.Clients.Clear();
|
//Sync.Clients.Clear();
|
||||||
|
|
||||||
|
|
||||||
var PCollection = MySession.Static.Gpss[MySession.Static.LocalPlayerId];
|
|
||||||
PCollection.Clear();
|
|
||||||
MyHud.GpsMarkers.Clear();
|
|
||||||
|
|
||||||
|
|
||||||
SeamlessClient.TryShow(PCollection.Count + "registered GPS points");
|
|
||||||
// MyGuiSandbox.UnloadContent();
|
// MyGuiSandbox.UnloadContent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user