-
Notifications
You must be signed in to change notification settings - Fork 9
Uncaught exception crash in PlayerRegistry.GetPlayer #11
Copy link
Copy link
Closed
Description
PlayerRegistry.GetPlayer can cause a crash if a player key is missing from the dictionary.
In this case it seemed to happen in a disconnect race condition:
Unhandled exception. System.Collections.Generic.KeyNotFoundException: The given key 'ziuMSceapEuNN7wRGQXrZg' was not present in the dictionary.
at System.Collections.Concurrent.ConcurrentDictionary`2.ThrowKeyNotFoundException(TKey key)
at System.Collections.Concurrent.ConcurrentDictionary`2.get_Item(TKey key)
at BeatTogether.DedicatedServer.Kernel.PlayerRegistry.GetPlayer(String userId) in E:\Projects\BeatTogether.DedicatedServer\BeatTogether.DedicatedServer.Kernel\PlayerRegistry.cs:line 40
at BeatTogether.DedicatedServer.Kernel.DedicatedInstance.OnDisconnect(EndPoint endPoint, DisconnectReason reason) in E:\Projects\BeatTogether.DedicatedServer\BeatTogether.DedicatedServer.Kernel\DedicatedInstance.cs:line 406
at BeatTogether.LiteNetLib.LiteNetServer.HandleDisconnect(EndPoint endPoint, DisconnectReason reason)
at BeatTogether.LiteNetLib.Handlers.DisconnectPacketHandler.Handle(EndPoint endPoint, DisconnectHeader packet, SpanBufferReader& reader)
at BeatTogether.LiteNetLib.LiteNetServer.HandlePacket(EndPoint endPoint, ReadOnlySpan`1 buffer)
at BeatTogether.LiteNetLib.LiteNetServer.ReceivePacket(EndPoint endPoint, ReadOnlySpan`1 buffer)
at BeatTogether.LiteNetLib.LiteNetServer.OnReceived(EndPoint endPoint, ReadOnlySpan`1 buffer)
at NetCoreServer.UdpServer.ProcessReceiveFrom(SocketAsyncEventArgs e)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pNativeOverlapped)
[process exited with code 3762504530]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels