Send a message to a known user

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
eventdave
Posts: 18
Joined: 02 Jul 2010, 14:12

Send a message to a known user

Post by eventdave »

I have some code in my server side extension that needs to send a response to a known user in a known room, i.e user roomMaster in room myRoom.

How would I send a message to this particular user, as _server.sendResponse() requires a user object. How do I find a particular user?

Many thanks

Dave
Nelagend
Posts: 9
Joined: 08 Aug 2010, 18:09

Post by Nelagend »

If you have the ID, you can use _server.getUserById(id). Getting them from their name is a bit more complicated. When that user first joins the room myRoom, it will generate a userJoin internal event with a parameter called params.user that is the actual user object. If you add them to an array of users indexed by user name, you can then use that array as a substitute for the nonexistent (I believe) getUserByName function.

At least some of the examples have the exact code for generating this array.
Post Reply