Check to see if already in Room?

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

matrix211v1
Posts: 61
Joined: 16 Jan 2009, 14:48

Check to see if already in Room?

Postby matrix211v1 » 30 Apr 2009, 20:05

I am basically using the code from the SFS Island Demo. In the "networkcontroller" in the function :

void Start() {
DontDestroyOnLoad(this);
Application.runInBackground = true; // Let the application be running whyle the window is not active.
smartFoxClient = GetClient();
if (smartFoxClient==null) {
Application.LoadLevel("LoginScreen");

return;
}

SubscribeEvents();
started = true;

smartFoxClient.JoinRoom("JamesIsland");

}

I am going to a "different" scene in the game, then I need to return to the main world. Obviously the Start is fired again so I put a DontDestroyOnLoad(this); so I don't lose my info.

The issue is, now it is trying to call the smartFoxClient.JoinRoom("JamesIsland"); with the same already logged in user, which causes an error. Is there any way to "check" to see if I am already logged into the room?

Thanks!

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 15 guests