Changing zone from server side?

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

Moderators: Lapo, Bax

xMoMx
Posts: 36
Joined: 13 Jun 2009, 06:11

Changing zone from server side?

Postby xMoMx » 17 Jun 2009, 00:40

So many question sorry... I'm SFS noob.

Just wondering if you can fire command that logout player from one zone and login him into another? I know we can do this from client side, just want to know if it's possible to do it from the server.

I want players to be able to move between zones without having to run check for user/password again.
User avatar
Lapo
Site Admin
Posts: 21645
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 17 Jun 2009, 19:20

Yes, you can call logoutUser from the server side.
Depending if you use Actionscript or Java you can consult the docs here:

Java:
http://www.smartfoxserver.com/docs/docP ... index.html
(under ExtensionHelper class)

Actionscript:
http://www.smartfoxserver.com/docs/docP ... /index.htm
Lapo
--
gotoAndPlay()
...addicted to flash games
xMoMx
Posts: 36
Joined: 13 Jun 2009, 06:11

Postby xMoMx » 17 Jun 2009, 20:23

I still don't get this... still trying to learn SFS here.

- Wouldn't it require you to call login and logout from different zones?
I thought I read somewhere that zones shouldn't talk to each other.

- Does using JoinRoom() with room ID from different zone do this for you immediately? If so, how would you get the room list from different zones?
User avatar
Lapo
Site Admin
Posts: 21645
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 18 Jun 2009, 06:35

- Wouldn't it require you to call login and logout from different zones?
I thought I read somewhere that zones shouldn't talk to each other.

Sorry I don't follow. What do you mean?
I can login into Zone A and decide at a certain point to leave it and enter Zone B. Logout can be called from either the client or the server. Login can only be called by the client.

- Does using JoinRoom() with room ID from different zone do this for you immediately? If so, how would you get the room list from different zones?

No, first you log in a new Zone, then you choose which room to join
Lapo

--

gotoAndPlay()

...addicted to flash games
xMoMx
Posts: 36
Joined: 13 Jun 2009, 06:11

Postby xMoMx » 18 Jun 2009, 13:12

Well suppose a player want to go to a different Zone, a log in command has to be fired again from the "client side". For security purpose, server then need to recheck password with the database. Which slow things down.

On the other hand, if server can login user that has already been verified as safe into a different zone. Then no checking is required. (since those zone won't be accepting joinRoom command from the client side)

Is this even more confusing? :oops:
xMoMx
Posts: 36
Joined: 13 Jun 2009, 06:11

Postby xMoMx » 24 Jun 2009, 01:07

More elaboration on the issue I'm facing.

We're using Terracotta and we divided everything into three zones:

1. Lobby
2. GameServer A
3. GameServer B

Once the players login to Lobby, he can then choose to go to GameServer A or B depending on his type of game.

Now since, server cannot login user into other zones, clients need to logOut from (1) and LogIn again to (2) or (3). DB need to be called once more to check for security.

This kinda defeat the purpose of having different zones at all (especially Lobby Zone which is now pointless) and we're thinking about putting everything into one Zone with Huge code (probably dividing everything into moduls)

But wouldn't that effect the Server performance?

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 25 guests