Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An attempt to move a despawned player causes a KeyNotFoundException #226

Open
ChrisGora opened this issue Mar 5, 2020 · 1 comment
Open
Labels
bug Something isn't working

Comments

@ChrisGora
Copy link
Contributor

Round 1 ended. 
Eliminated Players: 2 
Next num players 2. 
Continuing the game... 
Server: Destroyed player 2 due to disconnect (via elimination). 

KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <c79628fadf574d3a8feae0871fad28ef>:0 
  at Game.Entity.World.MovePlayer (System.Int32 playerID, Game.Entity.PlayerPosition playerPosition) [0x00006] in <10a9877c3a124d70a99c1d723d0d632c>:0 
  at Network.Events.ClientLocationUpdateEvent.UpdateLocation (Game.Entity.World world, System.Int32 playerID) [0x00008] in <10a9877c3a124d70a99c1d723d0d632c>:0 
  at Network.Server.Handle (Network.Events.ClientLocationUpdateEvent ev, Unity.Networking.Transport.NetworkConnection srcConnection) [0x0000e] in <10a9877c3a124d70a99c1d723d0d632c>:0 
  at Network.Events.ClientLocationUpdateEvent.Handle (Network.Server server, Unity.Networking.Transport.NetworkConnection connection) [0x00000] in <10a9877c3a124d70a99c1d723d0d632c>:0 
  at Network.Server.HandleEvent (Unity.Networking.Transport.NetworkConnection connection, Unity.Networking.Transport.NetworkEndPoint endpoint, Network.EventType eventType, Unity.Networking.Transport.DataStreamReader reader, Unity.Networking.Transport.DataStreamReader+Context& readerContext) [0x0006e] in <10a9877c3a124d70a99c1d723d0d632c>:0 
  at Network.Server.HandleNetworkEvents () [0x0018d] in <10a9877c3a124d70a99c1d723d0d632c>:0 
  at Game.Main.ServerGameLoop.Update () [0x00000] in <10a9877c3a124d70a99c1d723d0d632c>:0 
  at Game.Main.Game.Update () [0x000e4] in <10a9877c3a124d70a99c1d723d0d632c>:0 
@ChrisGora ChrisGora added the bug Something isn't working label Mar 5, 2020
@RileyEv
Copy link
Member

RileyEv commented Mar 5, 2020

Oh I think me and jack may have found this. The error depends on who actually disconnects. If its what I'm thinking of its to do with sending on fixed update a packet that was prepared in update and part way through that update the player is removed from the world

@ChrisGora ChrisGora assigned ghost Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants