Zone logout problem

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
mlts
Posts: 2
Joined: 08 Nov 2007, 09:14

Zone logout problem

Post by mlts »

I have problem with zone logout.
First I log in one main zone and in there have list of other zones. User choose one of this zones , click on button and log in. Then is appear new screen where have chat application and one button back. When click on this button I make logout and return user to the screen with list zones. When he try to login in the same zone, have message "user already login" but why , I already logout form this zone:
Ex:
MainZone
|_______> Zone1
|
|______> Zone2

1) Conect, login to MainZone
2) login to Zone1
3) logout(), show MainZone Screen
4) Try to log on zone1
5) Have error - User already login ?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Step 1 an 2 seem to indicate that you're logging into 2 zones simultaneously.
That's not recommended, avoid it.
First I log in one main zone and in there have list of other zones. User choose one of this zones , click on button and log in.
This is okay but make sure you logout from the main Zone before connecting in another one.
Lapo
--
gotoAndPlay()
...addicted to flash games
bacuri
Posts: 58
Joined: 24 Sep 2007, 13:42

Post by bacuri »

On a follow up to the above question, I'd like to add:

The examples that come with SFS usually draw a scenario where users join a Lobby to play only one type of game.

However a another common scenario is to have a Lobby where people can access several types of games.

Should each type of game be in it's own zone and we log users in/out of zones as they go in and out of games?

What's the best design for such a scenario according to SFS design philosophy?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

No this isn't the best solution. It works but we recommend other solutions... actually the framework is pretty flexible so you can really use many different approaches and obtain similar results.

Best practices are outlined in this document:
http://www.smartfoxserver.com/docs/docP ... ecture.htm
which illustrates different application patterns.

The best approach I can recommend is the one shown at the end of this article:
http://www.smartfoxserver.com/docs/docP ... mmo_p1.htm

The technique used allows you to build a highly modular extension that can support unlimited number of sub-applications / games etc...

Code examples are provided in Python :wink: 8)
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply