Thank you for your help. I’ve found out that it’s never going to work with photon because of how much info needs to be sent, unfortunately. I’ll try something different altogether. Have a great day
the problem was in serialization.
Dictionary<string, Dictionary<string, int>> is a deeply nested dictionary, and that kind of serialization is not supported.
An old-style hack is to manually (in code) flatten it. Turn it into an array of strings with entries like “35#dogs#loud”. That’s basically what XML does, automatically converting and unconverting, but wastes a lot of space.
If you intend to lift your entire current implementation, your easiest route is probably to make your own serializable classes to store the same data the dictionary does.
using System
[Serializable]
public class StringAndList {
public string name;
public List<StringAndInt> scores;
}
[Serializable]
public class StringAndInt {
public string name;
public int amt;
}
//in use
List<StringAndList> playerScores
Can’t recall now for photon RPC, but RaiseEvent will need to serialize into a byte array on the sender, and deserialize back into a class on the recipient. You’ll need to look into binary formatter for that.
Thanks everybody for your help. I’ve decided to work around the issue with a different approach, but will definitely remember the alternatives for Dictionary for the future