As I understand it, user names in SFS2x are case sensitive; Bob is different from bob.
I would really like to be able to treat user names as case insensitive. I realize I can do quite a bit already; not allow bob to login if Bob is already logged in, for example. However, there are a number of problems I've run into.
My biggest problem is looking up a user by name if I don't have the right case, a situation I'm running into in some of my request handlers. Both SFSApi.getUserByName and Zone.getUserByName are case sensitive (and understandably so, since the system is). SFSApi.findUsers isn't any help; StringMatch has no case insenstive option, either.
Is there any support planned in this area, or am I pretty much on my own here?
Short of iterating through all the users in the zone and checking user.getName().equalsIgnoreCase(name), does anyone have any other suggestions?
User name case sensitivity
Re: User name case sensitivity
BUMP,
I'm having this problem. As this is over a year old and there have been many changes since - is there now a way to do case insensitive searches for users?
I would like to be able to stop users having similar names like 'ken' and 'Ken'. The solution suggested here isn't ideal, I hope someone has a better solution.
Cheers
I'm having this problem. As this is over a year old and there have been many changes since - is there now a way to do case insensitive searches for users?
I would like to be able to stop users having similar names like 'ken' and 'Ken'. The solution suggested here isn't ideal, I hope someone has a better solution.
Cheers
Cheers, NM
Re: User name case sensitivity
There haven't been any changes, the rule is the same where BOB != Bob != bob != BoB etc...
The problem is outside the server. If you don't want two users with the same name you should implement this at the registration level. In other words when a User registers an account (which presumably will be stored in a DB) you check that the name isn't already taken and if its you prompt the User to use another name.
The problem is outside the server. If you don't want two users with the same name you should implement this at the registration level. In other words when a User registers an account (which presumably will be stored in a DB) you check that the name isn't already taken and if its you prompt the User to use another name.
Re: User name case sensitivity
We are running into this problem today too. It is easy to solve that at registration level and login.
For example we allow BoB, and if anyone tries to login with a different capitalization it will not work. However, the problem is with the buddy finding.
When you add a Buddy you need to have the correct case, how do you propose to solve that?
Example username is AbCdEfGh and I would like to be able to add the correct unique user to my buddies with abcdefgh and still have the name displayed in buddy list with the right case AbCdEfGh to respect the intent of the player.
For example we allow BoB, and if anyone tries to login with a different capitalization it will not work. However, the problem is with the buddy finding.
When you add a Buddy you need to have the correct case, how do you propose to solve that?
Example username is AbCdEfGh and I would like to be able to add the correct unique user to my buddies with abcdefgh and still have the name displayed in buddy list with the right case AbCdEfGh to respect the intent of the player.
Re: User name case sensitivity
You could convert the user name to lowercase at login, and save the name with the right capitalization in a user variable, to be displayed in the game. When it comes to the buddy list, you just have to convert the name entered by the player to lowercase and add the buddy.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Who is online
Users browsing this forum: Baidu [Spider] and 63 guests