Hi,
In my project, I have 2 users that are in the same room to play, when the game ends, I have to put these 2 users in the main zone of the game, with what instruction do I do this?
I tried to use this code, but from errors:
getApi().joinRoom(users[0].user, (Room) getParentRoom().getZone());
getApi().joinRoom(users[1].user, (Room) getParentRoom().getZone());
Yours sincerely
How to put a user in a zone
Re: How to put a user in a zone
Hi,
I don't understand your question:
They are in the Zone as soon as they log in, so when the game ends they are still in that Zone.
Maybe you mean you want to move the Users to another Room when the game ends?
If so you can use getApi().joinRoom() as per your example.
Cheers
I don't understand your question:
I have to put these 2 users in the main zone of the game
They are in the Zone as soon as they log in, so when the game ends they are still in that Zone.
Maybe you mean you want to move the Users to another Room when the game ends?
If so you can use getApi().joinRoom() as per your example.
Cheers
Re: How to put a user in a zone
Users are in a room created by the server, how do I move users from this room to the main zone of the game?
My code:
My code:
Re: How to put a user in a zone
There is probably something missing that I need to understand.
Does your game use multiple Zones?
Can you please explain how your game works in terms of using multiple Zones?
Thanks
Does your game use multiple Zones?
Can you please explain how your game works in terms of using multiple Zones?
Thanks
Re: How to put a user in a zone
No, my game uses only 1 zone, but at the moment of the game the users are moved to a game room, when the game ends I have to redirect the users in the main zone
Re: How to put a user in a zone
A user joins the Zone when he logs and in and he never leaves it until he disconnects or sends a LogOut request.
When your users finish to play a game they can leave the game Room but they are still joined in the main Zone.
Cheers
When your users finish to play a game they can leave the game Room but they are still joined in the main Zone.
Cheers
Re: How to put a user in a zone
I recommend taking a look here:
http://docs2x.smartfoxserver.com/Develo ... chitecture
To understand the relation between Zones and Rooms
Cheers
http://docs2x.smartfoxserver.com/Develo ... chitecture
To understand the relation between Zones and Rooms
Cheers
Who is online
Users browsing this forum: No registered users and 134 guests