LordTylus / SE-Torch-Plugin-ALE-Biggest-Grids-Broadcast

https://torchapi.com/plugins/item/b3e6b485-3196-457e-9f12-46a6445ff887
Apache License 2.0
2 stars 1 forks source link

PlayerUtils.GetLastSeenDate() Null Reference Error #15

Closed kippandrew closed 3 years ago

kippandrew commented 3 years ago
[ERROR]  Command: Command '!sendmixgps <Boolean biggest> <Boolean furthest> [Boolean abandoned] [Boolean biggestBlocks] ' from 'ALE Grid Broadcaster' threw an exception. Args: false, true, true, false17:
[ERROR]  Command: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.   at 
ALE_Core.Utils.PlayerUtils.GetLastSeenDate(MyIdentity identity) in F:\SE\Space Engineers\ALE-Biggest-Grids-Broadcast\ALE-Core\ALE-Core\Utils\PlayerUtils.cs:line 80   at 
ALE_Biggest_Grids_Broadcast.GridDetection.AbandonedGridDetectionStrategy.CheckGroupsDays(HashSetReader`1 nodes, Boolean checkFaction, DateTime today) in F:\SE\Space Engineers\ALE-Biggest-Grids-Broadcast\ALE-Biggest-Grids-Broadcast\GridDetection\AbandonedGridDetectionStrategy.cs:line 51   at 
ALE_Biggest_Grids_Broadcast.GridDetection.AbandonedGridDetectionStrategy.FindGrids(GridsBroadcastConfig config, Boolean connected) in F:\SE\Space Engineers\ALE-Biggest-Grids-Broadcast\ALE-Biggest-Grids-Broadcast\GridDetection\AbandonedGridDetectionStrategy.cs:line 36   at 
ALE_Biggest_Grids_Broadcast.Commands.FindGrids(IGridDetectionStrategy gridDetectionStrategy, Int32 min, Int32 distance, Boolean ignoreOffline, Boolean ignoreNpcs, Int64 seconds) in F:\SE\Space Engineers\ALE-Biggest-Grids-Broadcast\ALE-Biggest-Grids-Broadcast\Commands.cs:line 98   at 
ALE_Biggest_Grids_Broadcast.Commands.SendGridsInternal(Boolean biggest, Boolean furthest, Boolean abandoned, Boolean biggestBlocks) in F:\SE\Space Engineers\ALE-Biggest-Grids-Broadcast\ALE-Biggest-Grids-Broadcast\Commands.cs:line 75   at ALE_Biggest_Grids_Broadcast.Commands.SendGrids(Boolean biggest, Boolean furthest, Boolean abandoned, Boolean biggestBlocks) in F:\SE\Space Engineers\ALE-Biggest-Grids-Broadcast\ALE-Biggest-Grids-Broadcast\Commands.cs:line 68

Looks like a player's Last Seen Date might be null. But I'm not sure where this comes from. Any thoughts?

LordTylus commented 3 years ago

The last seen date seems fine. My assumption is the identity is null. - Meaning the owner of the grid is a no longer existing playerid.

I assume this hapoed due to the use of identity deletion like sandbox clean or identity purge.

Or keens own identity purge. Likely other plugins will have problems with that grid as well.

I can just skip the grid in this case I guess.

kippandrew commented 3 years ago

Any suggestions for how to identify the grid?

LordTylus commented 3 years ago

Sadly couldnt reproduce it with your world as it somewhat fixed itself.

but I fixed the most likely scenario where this could happen in v1.0.6.4