I was able to setup a CustomType for serialization but I've got some fairly lengthy nested classes to send when an item is initialized and at the very least, a collection of customtype would be handy. The Serialization Documentation indicated that for Array "T-type can be any of the types listed in this table except byte." ... which surely rules out custom types. ..but for Dictionary "K-type can be any of the types listed in this table." with no limit spec'd on Object. I figured I'd give it a shot.
It didn't work for me. I got two different dictionary related exceptions depending on whether the key was a string or int/byte
I thought I would ask if I did something wrong or if this is not supported.
Exceptions:
ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[System.String,ExitGames.Client.Photon.CustomType].Add (System.String key, ExitGames.Client.Photon.CustomType value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
System.Collections.Generic.Dictionary`2[System.String,ExitGames.Client.Photon.CustomType].System.Collections.IDictionary.Add (System.Object key, System.Object value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:671)
ExitGames.Client.Photon.Protocol.DeserializeDictionary (System.IO.MemoryStream din) (at h:/svncontent/photon-sdk-dotnet/PhotonDotNet/Protocol.cs:1812)
ArgumentException: not of type: ExitGames.Client.Photon.CustomType
Parameter name: value
System.Collections.Generic.Dictionary`2[System.Int32,ExitGames.Client.Photon.CustomType].ToTValue (System.Object value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:542)
System.Collections.Generic.Dictionary`2[System.Int32,ExitGames.Client.Photon.CustomType].System.Collections.IDictionary.Add (System.Object key, System.Object value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:164)
ExitGames.Client.Photon.Protocol.DeserializeDictionary (System.IO.MemoryStream din) (at h:/svncontent/photon-sdk-dotnet/PhotonDotNet/Protocol.cs:1812)
It didn't work for me. I got two different dictionary related exceptions depending on whether the key was a string or int/byte
I thought I would ask if I did something wrong or if this is not supported.
Exceptions:
ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[System.String,ExitGames.Client.Photon.CustomType].Add (System.String key, ExitGames.Client.Photon.CustomType value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
System.Collections.Generic.Dictionary`2[System.String,ExitGames.Client.Photon.CustomType].System.Collections.IDictionary.Add (System.Object key, System.Object value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:671)
ExitGames.Client.Photon.Protocol.DeserializeDictionary (System.IO.MemoryStream din) (at h:/svncontent/photon-sdk-dotnet/PhotonDotNet/Protocol.cs:1812)
ArgumentException: not of type: ExitGames.Client.Photon.CustomType
Parameter name: value
System.Collections.Generic.Dictionary`2[System.Int32,ExitGames.Client.Photon.CustomType].ToTValue (System.Object value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:542)
System.Collections.Generic.Dictionary`2[System.Int32,ExitGames.Client.Photon.CustomType].System.Collections.IDictionary.Add (System.Object key, System.Object value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:164)
ExitGames.Client.Photon.Protocol.DeserializeDictionary (System.IO.MemoryStream din) (at h:/svncontent/photon-sdk-dotnet/PhotonDotNet/Protocol.cs:1812)