[DFile] Player's account problem.
#2

I assume you're running on Linux?

File names are case-sensitive there, so "File" is not the same as "file".

To make it non-case-sensitive you can convert all file names to lower case and always opening files with lower case. So that "John_Smith" will be saved as "john_smith", as result a player named "jOhN_smiTh" will also be able to login to that account since the file "john_smith" will be used.

To do this, wherever you open the User File, convert the filename to lower case, for example like this:

Код:
new filename[]; // Your file name

for(new i, len = strlen(filename); i < len; i ++) filename[i] = tolower(filename[i]);
All it does is loop through the string, and convert each character to a lower-case character.


That's one way to do it, the other way could be saving all Player Names in a Database with correct cases, searching for the matching case and forcing that name upon the joined player.
Reply


Messages In This Thread
[DFile] Player's account problem. - by Milak - 14.04.2018, 18:39
Re: [DFile] Player's account problem. - by NaS - 14.04.2018, 19:11
Re: [DFile] Player's account problem. - by Milak - 14.04.2018, 19:19

Forum Jump:


Users browsing this thread: 1 Guest(s)