Page 1 of 1

getUserByName() not working

Posted: 21 Jun 2017, 07:55
by khanhdev
Why i can not getUserByName () after setName () for user. :? :?
it return null.

Re: getUserByName() not working

Posted: 21 Jun 2017, 13:57
by Lapo
Please do not call setName() on a user object.

User names cannot be changed at runtime: they are unique and decided at login time exclusively.
If you wish to alter the username of a specific client it can be done a login time as described in this article:
http://smartfoxserver.com/blog/how-to-c ... stom-login

Also as a general rule always use the server API entry point to find the methods you're looking for:
http://docs2x.smartfoxserver.com/Extens ... ension-api

cheers