Error when Instantiating SmartFox
Posted: 15 Mar 2011, 20:18
Hi, for some reason I am getting an error. I just want to keep a running count of the users connected to a room:
Getting the error:
ArgumentException: Key duplication when adding: >
System.Collections.Hashtable.PutImpl (System.Object key, System.Object value, Boolean overwrite)
System.Collections.Hashtable.Add (System.Object key, System.Object value)
SmartFoxClientAPI.Util.Entities.Initialize ()
SmartFoxClientAPI.SmartFoxClient..ctor (Boolean debug)
TavernClientCount.Start () (at Assets/Networking/ClientCount.cs:16)
Code: Select all
//All System references used
public class ClientCount : MonoBehaviour {
public SmartFoxClient sfc;
private void Start() {
sfc = SmartFox.Connection; //fixed the problem!
//sfc = new SmartFoxClient(true);
Debug.Log("ActiveRoom: " + sfc.GetActiveRoom() + " name: " + sfc.myUserName);
//
}
}
ArgumentException: Key duplication when adding: >
System.Collections.Hashtable.PutImpl (System.Object key, System.Object value, Boolean overwrite)
System.Collections.Hashtable.Add (System.Object key, System.Object value)
SmartFoxClientAPI.Util.Entities.Initialize ()
SmartFoxClientAPI.SmartFoxClient..ctor (Boolean debug)
TavernClientCount.Start () (at Assets/Networking/ClientCount.cs:16)