Photon3Unity3D not supports List<Dictionary<byte, object>>?

Options
BesoC
BesoC ✭✭
edited May 2014 in DotNet
Hi

I'm using unity3d with Photon3Unity3D.dll to connect to already set up and running Photon server. Connection is made, operations and events are passing fine. One thing: when photon client receives event with List<Dictionary<byte, object>> :

[code2=csharp]List<Dictionary<byte, object>> matches = new List<Dictionary<byte, object>>();
// populate matches
Parameters = new Dictionary<byte, object>
{
{(byte) EventParameters.MatchesList, matches}, matches}
};[/code2]

then unity client crashes with message:

[code2=plain]Exception: deserialize(): 118
ExitGames.Client.Photon.Protocol.Deserialize (System.IO.MemoryStream din, Byte type)
ExitGames.Client.Photon.Protocol.DeserializeParameterTable (System.IO.MemoryStream memoryStream)
ExitGames.Client.Photon.Protocol.DeserializeEventData (System.IO.MemoryStream din)
ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (System.Byte[] inBuff)
ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands ()
ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands ()
ExitGames.Client.Photon.PhotonPeer.Service ()
Assets.PhotonEngine.Scripts.GameStates.Connected.OnUpdate () (at Assets/PhotonEngine/Scripts/GameStates/Connected.cs:13)
Assets.PhotonEngine.Scripts.PhotonEngine.Update () (at Assets/PhotonEngine/Scripts/PhotonEngine.cs:51)[/code2]

With WinForms application and Photon3DotNet.dll, there are no such problems.

All dlls are latest version
Does it mean that Photon3Unity3D.dll not supports deserialization of List<Dictionary<byte, object>> ?

Please help

P.S. looks like forum is not processing markup tags anymore.....

Comments

  • vadim
    Options
    Hi,

    Photon does not support List. Use array instead. But sending List should fail during serialization. So your issues still is not clear for me. If array would not work, send more info how exactly do you send event.
    And check please do you really need List/array of Dictionary<byte, object> wrapped with Dictionary<byte, object>. Looks too complicated (but Photon should cope with it).
  • Tobias
    Options
    The question is: What do you want to send, why and how often?
    If it's so complicated, then it's sometimes not a good idea to send it in the first place.
  • BesoC
    BesoC ✭✭
    Options
    Hi

    I need to send a list of matches with players' names, score, match type, etc. for each match.In order to send this info I'm using List<Dictionary<byte, object>>. It is possible, of course, to use JSon for serialize/deserialize...

    In my case the difference between photon c# client (WinForms) and unity client is that in WinForms client receives data and i can deserialize List<Dictionary<byte, object>> into array, while in unity client is throwing an exception on receive
  • BesoC
    BesoC ✭✭
    Options
    Just tried to use Dictionary<byte, object>[] instead of List<Dictionary<byte, object>> and it worked. so my question is answered. thank you all :)
  • Tobias
    Options
    Are you using the Photon Server SDK?
  • BesoC
    BesoC ✭✭
    Options
    yes, ExitGames-Photon-Server-SDK_v3-4-13-5874
  • Tobias
    Options
    Ah ok, cool.
    I hope you can re-use some of the basics we built in it and derive the "LoadBalancing" app.
    Let us know when you need anything else.
  • BesoC
    BesoC ✭✭
    Options
    it's always nice to learn something new :) what basics can you recommend to look at?
  • Tobias
    Options
    Server basics?
    I guess you know the "getting started" and "tutorial" section here:
    http://doc.exitgames.com/en/onpremise/c ... rver-intro
  • BesoC
    BesoC ✭✭
    Options
    Well, yes, i wrote a couple of production servers :) i thought maybe you have some specific recommendations