in the openspace events it passes the user's id in the params, but in the smart fox events it's the username. The id is actually not useful to me, and I will have to record the named id in an indexed array so that my other systems know the correct user. for example, MySQL user id != SFS user id.
Would we be able to either switch or add the username into the params for openspace events, and unify this?
os uses id when sfs uses name?
Sure can!
Our users are based on a mysql table, registration / session is done via RoR, and user for other areas of the website.
This means that our system NEEDS to be user name based. The sfs id is actually worthless to almost all of my code, it needs the username. The user is the key in all my hash's... including my custom avatar creator.
This is currently an issue while applying environment effects on the avatars.
My current workaround it to keep a sfs id -> username hash around, but that's generated on a few bizarre avatar events to collect the right information without a custom extension just to poll sfs and collect username information.
Our users are based on a mysql table, registration / session is done via RoR, and user for other areas of the website.
This means that our system NEEDS to be user name based. The sfs id is actually worthless to almost all of my code, it needs the username. The user is the key in all my hash's... including my custom avatar creator.
This is currently an issue while applying environment effects on the avatars.
My current workaround it to keep a sfs id -> username hash around, but that's generated on a few bizarre avatar events to collect the right information without a custom extension just to poll sfs and collect username information.
Why don't you just retrive the User object from the current Room?
Hope this helps.
Code: Select all
var room:Room = smartFox.getActiveRoom() // smartFox is your SmartFoxClient instance
var user:User = room.getUser(id) // id is the user id passed by the OpenSpace events you are listening to
var username:String = user.getName()
Hope this helps.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
perfect, thank you very much.
I would still suggest the change to user name just for unification's sake. Keeping the libraries as similar as possible, to me, seems important... though not as important as efficiency. Is there a reason behind this? I am just curious. (I like taking things apart and putting them back together )
I would still suggest the change to user name just for unification's sake. Keeping the libraries as similar as possible, to me, seems important... though not as important as efficiency. Is there a reason behind this? I am just curious. (I like taking things apart and putting them back together )
Return to “OpenSpace v1 discussions and help”
Who is online
Users browsing this forum: No registered users and 24 guests