SmartFoxClient client = NetworkController.GetClient();
Hashtable users = new Hashtable();
using UnityEngine;
using System;
using System.Collections;
using SmartFoxClientAPI;
using SmartFoxClientAPI.Data;
using SmartFoxClientAPI.Util;
public class getUsers : MonoBehaviour {
SmartFoxClient client = NetworkController.GetClient();
Hashtable users = new Hashtable();
void Start ()
{
Room currentActiveRoom = client.GetActiveRoom();
Hashtable users = currentActiveRoom.GetUserList();
foreach(User u in users)
u.GetName();
}
This doesn't work at all.
Is there more info on how to construct this in C#.
All i can find is Actionscript.
Ed.
using UnityEngine;
using System;
using System.Collections;
using SmartFoxClientAPI;
using SmartFoxClientAPI.Data;
using SmartFoxClientAPI.Util;
public class getUsers : MonoBehaviour {
SmartFoxClient client = NetworkController.GetClient();
Hashtable users = new Hashtable();
void Start () {
Room currentActiveRoom = client.GetActiveRoom();
Hashtable users = currentActiveRoom.GetUserList();
foreach(User u in users.Values)
Debug.Log(u.GetName());
}
but i get error :
Assets/Game/Scripts/getUsers.cs(24,24): error CS1061: Type `getUsers.User' does not contain a definition for `GetName' and no extension method `GetName' of type `getUsers.User' could be found (are you missing a using directive or an assembly reference?)
Ed.
i can't even get the active room.
this gets called upon join room:
Room currentActiveRoom = client.GetActiveRoom();
Debug.Log(currentActiveRoom);
and i get a null.
Ed.
ok, i don't seem to have entered a room but i don't know how to do that. All i can find to do that is smartFox.joinRoom("The Garden") but smartFox isn't known.
Why are the examples with smartfox.* and i'm using client.*
isn't this called on the client connection ?
Do I need to construct something else ?
Ed.
appels wrote:ok, i don't seem to have entered a room but i don't know how to do that. All i can find to do that is smartFox.joinRoom("The Garden") but smartFox isn't known.
Why are the examples with smartfox.* and i'm using client.*
isn't this called on the client connection ?
Do I need to construct something else ?
Ed.
Its an instance variable of the API - it can be called anything. In all/most examples I simply adopted to call it smartFox.