Uppercase

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

travis
Posts: 8
Joined: 26 Oct 2013, 11:24

Uppercase

Postby travis » 11 Nov 2013, 15:24

Hi,

Sorry for my ignorance, anybody know how to change guest_17, guest_18 to Guest_17, Guest_18 when logging in.

TIA
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Uppercase

Postby Lapo » 13 Nov 2013, 08:37

Hi,
guest names are auto-generated by the server when people don't provide their user names. They can't be changed in SFS PRO.
However you can create your own Extension code that checks the login name provided by the user and if it's empty generates a custom name for him/her.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
travis
Posts: 8
Joined: 26 Oct 2013, 11:24

Re: Uppercase

Postby travis » 13 Nov 2013, 12:37

Hi,

Thanks for responding, i was hoping it might be as easy as changing the g to G in the as files, but i got round it with my own login section


// *** If blank create own
Randy = Math.floor(Math.random() * 100000) + 1;
TheLogger = "Guest_" + Randy;

// *** Then log in
smartfox.login(zone,TheLogger,Pass.text);
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Uppercase

Postby rjgtav » 14 Nov 2013, 01:45

Hi,

The problem with creating the names on the client-side is that it could generate a name that is already logged in the Zone.
I'd really suggest you to follow Lapo's recomendation, as on the server-side you can check whether or not a name already exists much easier than with your own implementation.

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.
travis
Posts: 8
Joined: 26 Oct 2013, 11:24

Re: Uppercase

Postby travis » 14 Nov 2013, 13:58

Hi,

Its so random that the likely hood of being the same is remote, however, if it is the same then they just get a username already taken message.
Then press log in again.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Uppercase

Postby rjgtav » 16 Nov 2013, 02:25

Hmm.. I think displaying that error message to a player that is just entering as a Guest may sound a bit confusing to the user.
Maybe you could automate the system so that it retries to login with a different name in case it is a Guest login and the username already exists?
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.

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 38 guests