Why this:: KeyNotFoundException: The given key was not present in the dictionary.

KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[Bolt.NetworkId,EntityProxy].get_Item (NetworkId key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
EntityChannel.ReadUpdate (Bolt.Packet packet)
EntityChannel.Read (Bolt.Packet packet)
BoltConnection.PacketReceived (UdpKit.UdpPacket udpPacket)
UnityEngine.Debug:LogException(Exception)
BoltLog:Exception(Exception)
BoltConnection:PacketReceived(UdpPacket)
BoltCore:Udp_PacketReceived(UdpEvent)
BoltCore:PollNetwork()
BoltCore:Poll()
BoltPoll:FixedUpdate()
My game and networking code were all working last time I used Unity. I was prompted that 5.3.6 was out (I was on 5.3.5) so I updated it.

Now I get this error when a client joins a server.

Just after it I also get:
exception thrown while unpacking data from [EndPoint 127.0.0.1:51234 | 9151314447111866402], disconnecting
UnityEngine.Debug:LogError(Object)
Unity:BoltLog.IWriter.Error(String)
BoltLog:Error(String)
BoltLog:Error(String, Object)
BoltConnection:PacketReceived(UdpPacket)
BoltCore:Udp_PacketReceived(UdpEvent)
BoltCore:PollNetwork()
BoltCore:Poll()
BoltPoll:FixedUpdate()
Any idea's? Anything I can do to debug this? I've tried recompiling the prefabs. I've tried reinstalling Bolt.

Best Answers

Answers

  • I can do - is there some settings cache that might need resetting?!

    I've DM'd you a zip of the project.

    Thanks so much for looking into this!
  • Hmm... interesting. I've reviewed the commits since it worked and the old file that's changed with the "dll" in the name is Assets/bolt/assemblies/bolt.user.dll.mdb - but being binary, bitbucket obviously can't "diff" it.

    That seems to be the file that's changed every time I compile the states.

    I have already done an Assets > Bolt > Install again to be sure nothing has gone wonky there. By "remake the states" do you mean delete and make them again?
  • Which Bolt DLL's are you expecting to see/find? (I wonder if they are excluded by gitignore?!)

  • $ find . -name 'bolt.dll'
    ./Assets/bolt/assemblies/bolt.dll

    $ find . -name 'bolt.user.dll'
    ./Assets/bolt/assemblies/bolt.user.dll
    Looks like DLL's are being ignored from Git...

    $ git ls-files . --ignored --exclude-standard --others | grep '.dll'
    Assets/bolt/assemblies/bolt.dll
    Assets/bolt/assemblies/bolt.user.dll
    Assets/bolt/assemblies/editor/bolt.compiler.dll
    Assets/bolt/assemblies/editor/bolt.editor.dll
    Assets/bolt/assemblies/editor/protobuf-net.dll
    Assets/bolt/assemblies/udpkit/udpkit.common.dll
    Assets/bolt/assemblies/udpkit/udpkit.dll
    Assets/bolt/assemblies/upnp/Mono.Nat.dll
    ...
    ...
    Those DLL's exist..
  • Ahh I have a .gitignore in my home folder which is setup to ignore "compile" stuff like DLLs, EXE and .o files...
  • That's correct - I have just sent you a new one. My git config was not committing DLL and SO files. I've allowed them now.

    I did have them locally. Just not in the repo.
  • oh good. hah.

    Maybe I need to checkout the whole project again...

    Or maybe it's because I'm trying to launch using Bolt Scenes?!
  • Yup - it works if I compile a binary and run two things manually... (never thought to try this).

    If I fire up the Bolt Scenes and run it through there, the client crashes when it connects.

    Also, with Bolt Scenes, I have to do Play As Server directly on the Game scene, I cant launch the main menu. (This is likely a bug in my code, I imagine).
  • Ahhhh ok. Maybe that's the mistake I'm making here.

    Thanks so much for your help, @stanchion !