send user in another room

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

Moderators: Lapo, Bax

Post Reply
beate
Posts: 33
Joined: 15 Jun 2005, 14:34

send user in another room

Post by beate »

hello,

I would like to send, as moderator, a user into another room. is this possible?

best regards beate
beate
Posts: 33
Joined: 15 Jun 2005, 14:34

Post by beate »

ups, sorry i was blind :-)

_server.joinRoom() is the solution, right?

best regards beate
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Post by Virusescu »

Yep, you're right.
Just build an en extension that will do that action for you if you are a moderator.
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
beate
Posts: 33
Joined: 15 Jun 2005, 14:34

Post by beate »

thanks Virusescu,

i have build the extensions and the code works fine. the moderator can now send users in other rooms.

but now i have a new little problem :-)

i will inform all other users in the room (after _server.joinRoom) , that a new user joins the room, but the 'smartfox.onUserEnterRoom' event dont fired ... only 'smartFox.onUserCountChange' event fired.

best regards beate
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Post by Virusescu »

If you look closer to the joinRoom server method you will notice the last parameter "sendUpdate"
You need to give it a value of true to do his magic ;).

Good luck
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
beate
Posts: 33
Joined: 15 Jun 2005, 14:34

Post by beate »

THANKS !!!

best regards
Post Reply