Expand my Community achievements bar.

anonymous presence and events

Avatar

Level 4

Hi,

I understand that a user needs to do something to broadcast presence to everyone else.

What kind of event can i automate to get that to happen? I dont want users to worry about typing to be seen in a room.

thanks.

....russ

3 Replies

Avatar

Employee

Hi Russ,

One approach you could do is publish a message to a collection node, and make every one subscribe to it. So each user would receive a message. You could then listen to the CollectionNodeEvent.ITEM_RECEIVE and on your listener you check if the user manager has information on the publisher id of the message sent. If not you can manually fetch it using UserManager.getUserDescriptor(items PublisherId)

if (userManager.getUserDescriptor(items PublisherId) == null) {

//wait

//the statement with in the if condition would have forced to fetch the userId of the user

} else {

//Yay your userManager has the info about this user

}

Thanks

Arun

Avatar

Employee

Sorry, but if you want all users to see each other why are you using anonymous presence?

Sent from my iPad

Avatar

Level 4

thanks guys,

the reason why im using anonymouse presence is to cut down the amount of messages getting sent by default. in a previous test i has rooms freze and zombies were created.

In my test this evening everything seemed good. just from a users perspective i dont want them to think about needing to type to see everyone else in the room.

for example im using the default chat pods that are in the sdk. i woud like to push a message to everone saying that "user has entered the room" from actionscript and have everyone in the room see it .

this way. (as i understand it) the amount of messges in the service is cut down and the user will see everyone else in the room as soon as they can.

thanks guys.

...russ