Why this
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Why this:: KeyNotFoundException: The given key was not present in the dictionary.
njt1982
2016-07-24 23:28:48
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.
Comments
I've tested Bolt on 5.3.6 and don't have any problems. Can you send your project to [email protected] so we can take a look?
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!
It looks like all your Bolt dll were deleted somehow, I recommend reverting your source control to before this happened or reimporting Bolt and remaking your states etc
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?!)
bolt.dll, bolt.user.dll are missing in that folder
$ 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...
They're not in the zip file you sent me
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.
New zip works perfect, have no problems playing multiplayer
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).
Debug start works fine for me on your game.
If you do play as server for the menu, Bolt will already be running when your menu tries to launch Bolt.
Ahhhh ok. Maybe that's the mistake I'm making here.
Thanks so much for your help, @stanchion !
Back to top