Hello,
When a user changes his username in server code I update the DB with the new name and use sender.setName to update the live user object.
However the client does not get this update, smartfox.mySelf.name still returns the old username.
I tried to use
getApi().getUserById(sender.getId()).setName(...) and got the same result.
I'm a bit surprised, I'm pretty sure I tested this before and at some point it worked, something must have changed.
Thank you
username not updated
Re: username not updated
Hello,
In order to successfully change the User's name, you have to do it at the Login time.
You can find more information at this documentation chapter, at 4) Change the user name at login time:
http://docs2x.smartfoxserver.com/Gettin ... wtos#item3
Cheers
In order to successfully change the User's name, you have to do it at the Login time.
You can find more information at this documentation chapter, at 4) Change the user name at login time:
http://docs2x.smartfoxserver.com/Gettin ... wtos#item3
Cheers
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Re: username not updated
How would one do this if they are using the SignUpAssistantComponent and LoginAssistantComponent?
I have some handlers that need to get a user by their name, like this:
However, I noticed in the Zone Monitor that a recently signed-up user still has a username of "Guest#-XXXX".
I tried manually setting the name in the CustomSignUpPostProcessor like this:
But I am still getting null for getUserByName(name) until they exit the app and sign back in.
I have some handlers that need to get a user by their name, like this:
Code: Select all
User otherUser = this.getApi().getUserByName(other_name);
However, I noticed in the Zone Monitor that a recently signed-up user still has a username of "Guest#-XXXX".
I tried manually setting the name in the CustomSignUpPostProcessor like this:
Code: Select all
user.setName(un);
user.getSession().getSessionManager().setName(un);
But I am still getting null for getUserByName(name) until they exit the app and sign back in.
Re: username not updated
Hi,
if you require a login name and a separate user name you will need those fields to be specified at registration time.
In other words your database will need those two fields, and your user registration interface will ask those details , which the SignUpAssistant will handle for you. (it's just a matter of configuring the necessary fields)
At login time you can require the "login name" to be used to sign in while user name will be assigned from another field in the DB.
This is explained in the LoginAssistant documentation:
http://docs2x.smartfoxserver.com/Develo ... -assistant
See the "A slightly more advanced case" section.
Hope it helps
if you require a login name and a separate user name you will need those fields to be specified at registration time.
In other words your database will need those two fields, and your user registration interface will ask those details , which the SignUpAssistant will handle for you. (it's just a matter of configuring the necessary fields)
At login time you can require the "login name" to be used to sign in while user name will be assigned from another field in the DB.
This is explained in the LoginAssistant documentation:
http://docs2x.smartfoxserver.com/Develo ... -assistant
See the "A slightly more advanced case" section.
Hope it helps
Return to “SFS2X ActionScript 3 API”
Who is online
Users browsing this forum: No registered users and 35 guests