SA-MP Forums Archive
Linux is case sensitive - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Linux is case sensitive (/showthread.php?tid=558827)



Linux is case sensitive - ATGOggy - 19.01.2015

I have a server that in development mode, hosted in a samp hosting site.

The problem is that the OS of that host is Linux and Linux is case sensitive, so I'm having issues with user database.

When I register an account named ATGoggy, I can login again and again with the name 'ATGoggy'.

But, when I change case, like atgoggy, I'll have to register again. What should I do now?


Re : Linux is case sensitive - xo - 19.01.2015

Either escape string if it's MYSQL, or turn all string letters to lowercase upon register and check for the lowered case string.

If it's mysql database then:

mysql_real_escape_string(from string, to escapedstring);

where string is the name that you should get.
for ex:
Under your OnPlayerConnect callback
pawn Код:
new pName[MAX_PLAYER_NAME],
        pName1[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,sizeof(pName));
        mysql_real_escape_string(pName,pName1);
Then select result with "pName1" instead of "pName".


Re: Linux is case sensitive - www - 19.01.2015

It's ini or MySQL?


Re: Linux is case sensitive - ATGOggy - 19.01.2015

It's ini.


Re: Linux is case sensitive - www - 19.01.2015

In localhost it works without problems?


Re: Linux is case sensitive - xxmitsu - 19.01.2015

why not strtolower on filenames ?


Re: Linux is case sensitive - xo - 19.01.2015

INI!
Okay then try
pawn Код:
new pName[MAX_PLAYER_NAME],
        pName1[MAX_PLAYER_NAME];

       format(pName1, sizeof(pName1), "%s" ,strlower(pName));
then use up pName1.


Re: Linux is case sensitive - ATGOggy - 19.01.2015

No, it's not working


Re: Linux is case sensitive - PT - 19.01.2015

see the params of strcmp.


Re: Linux is case sensitive - ATGOggy - 19.01.2015

Quote:
Originally Posted by PT
Посмотреть сообщение
see the params of strcmp.
Can you explain more?