User object no longer available on user lost
Posted: 29 Oct 2007, 14:22
When extensions get EVENT_USER_LOST, uid contains id of user that is no longer available via helper.getUserById(Integer.parseInt(sfsUserId));
This causes problem because when user is lost, we need to have access to the users properties map to fetch real uid which we are using to log user out of the 3rd party authentication servers etc.
This problem only seems to occur on Room level extensions.
Example code from room level extension
Any ideas? I really would not like to setup another singleton hashmap for mapping between sfs uid and our own uids...
This causes problem because when user is lost, we need to have access to the users properties map to fetch real uid which we are using to log user out of the 3rd party authentication servers etc.
This problem only seems to occur on Room level extensions.
Example code from room level extension
Code: Select all
if(evtName.equals(InternalEventObject.EVENT_USER_EXIT) ||
evtName.equals(InternalEventObject.EVENT_USER_LOST))
{
String sfsUserId = ieo.getParam("uid");
if(sfsUserId == null || sfsUserId.isEmpty())
{
return;
}
User user = helper.getUserById(Integer.parseInt(sfsUserId));
Long fgpuserId = (Long)user.properties.get("uid");
FGPUser zUser = ZoneCache.getInstance().getUserCache(zone.getName()).getUser(fgpuserId);
// Clean up calls using our internal user object starts here
}