two things
- is it possible to find out the users user name using there Id
- do users always get the same ID?
two things
No and no
When the user joins the username is in the Subject, can’t remember if the the credentials of the principles. On the userJoined callback on the server, I would create an entry in a map that maps userID’s to usernames.
I currently create a map from userID to player objects. One of the things I could put in the player object is the username. I currently don’t though.
If you want to look at the code, it’s in SVN here
As the documentation states, the userID is only valid for that login of that user, if they log off, and then log on again later, they may get a different userID.
HTH
Endolf
hi , i can’t see your file
u mind uploading again?
Yeah, I moved it all to a tag in subversion as I’m starting from fresh files (grabbing bits I’ve done before) major rearchitecting of my code, again
HTH
Endolf
thanks alot! =) ;D
hi i would like to ask you if you mind posting the part in the code which does the mapping of userid to username?
i am getting confused
thanks
It’s in that class
I have a hashmap that I look it up in
userPlayerMap = new HashMap<UserID, GLOReference<GLOPlayer>>();
Look in userJoined method for what I do to add users. It’s just a hashmap, it’s nothing complex.
HTH
Endolf
thanks i will take a look at it =)