Exception: cannot serialize(): System.Collections.Hashtable

Options
Hello!

I have an issue with UWP 10 build. When I send Hashtable I got Exception

Exception: cannot serialize(): System.Collections.Hashtable
at ExitGames.Client.Photon.Protocol.Serialize(IO.MemoryStream dout, Object serObject, Boolean setType)
at ExitGames.Client.Photon.Protocol.SerializeParameterTable(IO.MemoryStream memStream, Collections.Generic.Dictionary parameters)
at ExitGames.Client.Photon.Protocol.SerializeOperationRequest(IO.MemoryStream memStream, Byte operationCode, Collections.Generic.Dictionary parameters, Boolean setType)
at ExitGames.Client.Photon.TPeer.SerializeOperationToMessage(Byte opc, Collections.Generic.Dictionary parameters, Client.Photon.PeerBase.EgMessageType messageType, Boolean encrypt)
at ExitGames.Client.Photon.TPeer.EnqueueOperation(Collections.Generic.Dictionary parameters, Byte opCode, Boolean sendReliable, Byte channelId, Boolean encrypt, Client.Photon.PeerBase.EgMessageType messageType)
at ExitGames.Client.Photon.PhotonPeer.OpCustom(Byte customOpCode, Collections.Generic.Dictionary customOpParameters, Boolean sendReliable, Byte channelId)
at ExitGames.Client.Photon.PhotonPeer.OpCustom(Byte customOpCode, Collections.Generic.Dictionary customOpParameters, Boolean sendReliable)
at CustomServer.Client.CreateRoom(String roomName, Collections.Generic.Dictionary param)
at CustomServer.Client.OnOperationResponse(Client.Photon.OperationResponse operationResponse)
at ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback(Byte[] inBuff)
at ExitGames.Client.Photon.TPeer.DispatchIncomingCommands()
at ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands()
at ExitGames.Client.Photon.PhotonPeer.Service()
at CustomServer.Client.Service()
at PhotonMultiplayerController.Update()
(Filename: Line: 0)

I'm using 4.0.5.1 Unity Sdk and Unity3D 5.3.5f1.

I've tried make own custom Hashtable type and I've copied all code from Assembly Browser form 4.1.0.4 SDK but same result, Exception on serialization.

After I've tried use all SDK 4.1.0.4
It serialize Hashtable without problem, but I/m getting UI freeze on connect and my app crahes if I try to connect on device without network access (seems like OS kill app due to freeze UI because I don't see anything in log about a crash)

Can You help solve my issues please?

Answers

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited May 2016
    Options
    Hi @Tenechek,

    Please use Photon's Hashtable implementation by adding this line on top:
    <code class="inline">using Hashtable = Photon.LoadBalancing.Hashtable;</code>