Login User Name how to check if it is already used

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

madwilson
Posts: 3
Joined: 14 May 2015, 17:46

Login User Name how to check if it is already used

Postby madwilson » 10 Dec 2020, 19:39

2 days of searching for a solution

I have a zone setup and a single room setup using the AdminTool...

I am allowing people to log in setting the user name but some users could pick the same name witch is disconnecting the first user that is already logged in.

I am hoping I am just missing something simple to check for or how to check it...

before the user logged in I try to get into the room by using "getRoomByName" witch gives me null and then I would like to get a list of users to check with but "getUserList()" is empty even if I can see that there is a user in the room...

Any help would be great.

HTML JAVA...
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Login User Name how to check if it is already used

Postby Lapo » 11 Dec 2020, 08:57

Hi,
user names must be unique in the same Zone.
Is your system based on a login/password type of login? Or do you want people to login freely?

If it is the latter you should let the server auto-assign a unique name to each user, so that there are no name-collisions. They could still choose a nick-name to show on screen, but this is not technically their username it's just a nick name that you can store (for example in UserVariables) and show on screen.

Generally speaking an Extension based login system with username/pass would be the best solution.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 57 guests