- Home /
Problem with hashtables
I'm using Photon and I need to make a hashtable for the customproperties for the room but get these errors.
Assets/Scripts/MultyPlayer/newMulty.cs(132,39): error CS1502: The best overloaded method match for `PhotonNetwork.CreateRoom(string, bool, bool, int, ExitGames.Client.Photon.Hashtable, string[])' has some invalid arguments
Assets/Scripts/MultyPlayer/newMulty.cs(132,39): error CS1503: Argument `#5' cannot convert `System.Collections.Hashtable' expression to type `ExitGames.Client.Photon.Hashtable'
Answer by Roland1234 · Nov 26, 2013 at 06:19 PM
Well, the error itself is self-explanatory: The CreateRoom method is expecting an ExitGames.Client.Photon.Hashtable but you are passing in a System.Collections.Hashtable. It could be that you've upgraded Photon without first deleting the previous version, so you might have old and new files of Photon mixed together. Try deleting the Photon folder and re-importing it and see if that doesn't clear the error. Other than that you'd have to go into more detail and change the type of hashtable that you are passing in to the method.
I have this same problem but I'm using the same photon as I always have. Do I need to do an include? I'm already extending photon.monobehaviour
Declare the collection type when you declare the variable :
var myHashtable : ExitGames.Client.Photon.Hashtable = new ExitGames.Client.Photon.Hashtable();
http://answers.unity3d.com/questions/562204/overload-methods-of-hashtable.html
Edit : sorry, yeah my example is in uJS
If you're coding in C# you can alias the types like so:
using PhotonHashtable = ExitGames.Client.Photon.Hashtable;
using SystemHashtable = System.Collections.Hashtable;
public class $$anonymous$$yObject
{
public PhotonHashtable PhotonHashtableField;
public SystemHashtable SystemHashtableField;
}
Answer by IdrilKalean · May 25, 2017 at 07:10 AM
using Hashtable = ExitGames.Client.Photon.Hashtable;
;D
Your answer
![](https://koobas.hobune.stream/wayback/20220613122840im_/https://answers.unity.com/themes/thub/images/avi.jpg)