The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

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).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

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

stanchion
2016-07-25 03:55:35

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?

njt1982
2016-07-25 08:13:36

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!

stanchion
2016-07-25 08:27:45

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

njt1982
2016-07-25 09:47:34

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?

njt1982
2016-07-25 09:48:09

Which Bolt DLL's are you expecting to see/find? (I wonder if they are excluded by gitignore?!)

stanchion
2016-07-25 09:49:28

bolt.dll, bolt.user.dll are missing in that folder

njt1982
2016-07-25 09:58:17

  
$ 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..

njt1982
2016-07-25 09:59:07

Ahh I have a .gitignore in my home folder which is setup to ignore "compile" stuff like DLLs, EXE and .o files...

stanchion
2016-07-25 10:00:22

They're not in the zip file you sent me

njt1982
2016-07-25 10:04:07

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.

stanchion
2016-07-25 10:27:51

New zip works perfect, have no problems playing multiplayer

njt1982
2016-07-25 10:41:34

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?!

njt1982
2016-07-25 10:50:55

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).

stanchion
2016-07-25 11:01:40

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.

njt1982
2016-07-25 11:16:37

Ahhhh ok. Maybe that's the mistake I'm making here.

Thanks so much for your help, @stanchion !

Back to top