2

I am working with Photon in Unity now, and in all tutotials I can see that people use ExitGames.Client.Photon.Hashtable to set customRoomProperties. My question actually is: what are the difference between default C# Hashtable class and photon Hashtable class. And why I should use only Photon Hashtable to set my room properties, if they are both representing a KeyPairValue type?

Michael Rovinsky
  • 6,807
  • 7
  • 15
  • 30
Viaceslavus
  • 180
  • 1
  • 8
  • 1
    Photon is expecting their hashtable as the collection type. It is a different type, most likely they have a different implementation based on how they use it. – hijinxbassist Apr 29 '21 at 18:17
  • 1
    Have you tried to press `F12` on it -> yes it is a complete custom implementation! They use an underlying `Dictionary` .. kind of dump tbh since they state themselves (and I tested) `string` is the only allowed type for the key ... All other keys are allowed but simply ignored when setting the properties ^^ ... And in general why should you use the Photon `Hashtable`? -> well the room `CustomProperties` and according setter method only uses the Photon `Hashtable` ... you can't just use another type on it that casually has the same name ;) – derHugo Apr 30 '21 at 04:15
  • 1
    We had to come up with as solution since `System.Collections.Hashtable` was not available for UWP/WSA/NET_FX platform(s) in Unity. This "workaround" was kept for backward compatibility I think. – JohnTube May 01 '21 at 02:32

0 Answers0