Unity stops responding when running client based on MmoDemo

Options
Hello!

I'm currently building a multiplayer game using Photon Server, and have used the MmoDemo as my base/starting point. I've created a Unity game similar to the Unity Grid demo provided in Photon Server. I've also created a DLL project within the same solution as the game, which is similar to the Photon.MmoDemo.Client DLL which Unity Grid uses.

However, I'm running into problems! I've only just started, so my class is basic. It instantiates a Game object (which is provided by the DLL, as it is in the MmoDemo), and passes itself (since it implements IGameListener) into the Game object instance.

Within the Game class, it calls AddItem in the constructor. AddItem then calls the listener (the class we passed in which implements IGameListener) OnItemAdded method, and this is where the crash occurs. It seems to go to the OnItemAdded method okay when I step through with the debugger, but just randomly crashes as it reaches it!

I suspect it's maybe something to do with the fact we're passing an object of a class to a DLL, then having then DLL call a method back in the main game code? I am not sure. Whilst debugging, if I add a breakpoint in the AddItem method and attempt to inspect the this.listener object, this also causes Unity to crash.

Bizarre, I'd much appreciate any help you lot can provide.
P.S. Running the MmoDemo works just fine, the problem only occurs in my own game and DLL, maybe it's just because I haven't implemented something yet, so it's missing and causing issues? But I can't figure out what as everything being used is in there.

Comments

This discussion has been closed.