Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

User Game Info

Avatar

Level 3

Hi

I have almost completed a Chess game which has a lobby where guests can challenge each other and enter private rooms to play. They can also access their own acive games from a ListCollection updated by external XML (The user-specific external XML stores some basic game info for games that the guest has initiated/played).

I am interested to know if there are any AFCS methods to store user specific information or is it advised to keep this information external?

Thanks.

The new fixes to the AFCS Room Console are great. Thanks!

1 Accepted Solution

Avatar

Correct answer by
Employee

In case you change your mind, you can use custom fields and simply store user ids. If you use external authentication (and always assign the same userId to the same user) or if your users login with an AdobeID, the internal userId is guaranteed to be always the same (if your user enter as guests, the userId is a new guid generated every time they login)

View solution in original post

6 Replies

Avatar

Former Community Member

Hi,

I am not sure if I understood your question well but If you need to store an user-specific info, for your case , lets say an XML, you can always use the custom fields in userdescriptors to store the values.

Call API registerCustomUserField of UserManager to create the custom field or you can also create using devconsole. Then you can set the value for a particular user on this field, using setCustomUserField API. There is an example of using CustomFields in the examples folder.

Hope this helps.

Thanks

Hironmay Basu

Avatar

Level 3

Thanks Hironmay

I thought about using custom fields but my biggest obstacle is trying to tie

the two together again when the visitor re-enters the room eg.

1. Guest 'Jenny' challenges 'Johny'

2. A room called Jenny_Johny is created.

3. Jenny logs out of the room.

4. Jenny logs back into the room.

If I am not mistaken - a new GUEST_... type of AFCS ID is generated for

Jenny each time she re-enters the room. So as she logs in to the room, how

will I know what her custom user fields were set to when she first logged in

to the room?

Avatar

Former Community Member

Hi,

I guess for this case , you can then use a separate SharedProperty , and keep an object indexed by name( if that is the way you want to identify your user ) when he logs in next. This way , when an user comes in again, he can just access that object in SharedProperty.

You can also use collectionNode directly itself. If an user is to send message, he can send a message with an item ID same to his name, so that he can easily access it when he comes next. If he needs to send and store multiple messages, you can also create a node for every user, and publish items on that node. Make sure nodeconfiguration properties like userDependantItems etc are set to the right value when you create a node. I am just throwing ideas. You need to decide what works best for you.

Hope this helps.

Thanks

Hironmay Basu

Avatar

Level 3

Thanks

Those sound like viable options. I am just a little concerned about chewing

up my free AFCS space so I might stick to keeping game info in the external

XML.

Avatar

Correct answer by
Employee

In case you change your mind, you can use custom fields and simply store user ids. If you use external authentication (and always assign the same userId to the same user) or if your users login with an AdobeID, the internal userId is guaranteed to be always the same (if your user enter as guests, the userId is a new guid generated every time they login)

Avatar

Level 3

Thanks Raff

I might change the application so that it authenticates users externally.

Currently I am creating the rooms externally so hopefully this should be an

easy move.

I think it will give me more leverage to control my users - it seems that I

should be able to use the custom user field if these are always the same.