Hello ,
I want to join zone from server side and I find method getApi().login(ISession session, java.lang.String name, java.lang.String pass, java.lang.String zoneName, ISFSObject params) and login(ISession session, java.lang.String name, java.lang.String pass, java.lang.String zoneName, ISFSObject params, boolean forceLogout) . but what value I passed to session ? please give me example of server side code to join zone.
How to join zone from server side
Re: How to join zone from server side
Hi,
sorry I don't understand your question.
What does it mean to "join a zone from server side?"
You want to simulate a client in your Extension code? If so you can use the SFSApi.createNPC(...) method.
Here's a two part article talking about NPCs:
http://smartfoxserver.com/blog/ways-of- ... -game-p-1/
http://smartfoxserver.com/blog/ways-of- ... -game-p-2/
Thanks
sorry I don't understand your question.
What does it mean to "join a zone from server side?"
You want to simulate a client in your Extension code? If so you can use the SFSApi.createNPC(...) method.
Here's a two part article talking about NPCs:
http://smartfoxserver.com/blog/ways-of- ... -game-p-1/
http://smartfoxserver.com/blog/ways-of- ... -game-p-2/
Thanks
Re: How to join zone from server side
I guess he means making a user automatically join a zone from server side. I guess that is not possible, since in login event you don't have an user yet.
I have a similar issue, but making a user automatically join a room. I used both room.addUser() and user.addJoinedRoom(), and in the server console I see them joined, but client side I don't receive the event, neither I can see the room using getLastJoinedRoom, so I can not send extension messages to that room.
Is there any way to achieve this?
Regards,
Roberto
I have a similar issue, but making a user automatically join a room. I used both room.addUser() and user.addJoinedRoom(), and in the server console I see them joined, but client side I don't receive the event, neither I can see the room using getLastJoinedRoom, so I can not send extension messages to that room.
Is there any way to achieve this?
Regards,
Roberto
Roberto G. Fernández
Technical Leader
WILLDOM, WE DO IT_
AR: +54 (11) 4821 1582
US: +1 (954) 905 7439
Skype: roberto.g.fernandez
Technical Leader
WILLDOM, WE DO IT_
AR: +54 (11) 4821 1582
US: +1 (954) 905 7439
Skype: roberto.g.fernandez
Re: How to join zone from server side
Hi,
Exactly, this is not possible. SFS2X runs multiple Zones (or application, if you prefer) at once and it's the client that tells the server which Zone he/she wants to log into.
To join a user from server code just user SFSApi.joinRom(...)
Always look in the SFSApi class first. Chances are you'll find what you need there
http://docs2x.smartfoxserver.com/Extens ... ension-api
hope it helps
I guess he means making a user automatically join a zone from server side. I guess that is not possible, since in login event you don't have an user yet.
Exactly, this is not possible. SFS2X runs multiple Zones (or application, if you prefer) at once and it's the client that tells the server which Zone he/she wants to log into.
To join a user from server code just user SFSApi.joinRom(...)
Always look in the SFSApi class first. Chances are you'll find what you need there
http://docs2x.smartfoxserver.com/Extens ... ension-api
hope it helps
Who is online
Users browsing this forum: No registered users and 97 guests