Re: YSF - kurta999's version -
kurta999 - 14.06.2017
In YSF,cfg disable dialog protection,but it is disabled by default
Re: YSF - kurta999's version -
iLearner - 14.06.2017
Quote:
Originally Posted by kurta999
In YSF,cfg disable dialog protection,but it is disabled by default
|
Did you compile yet.
Re: YSF - kurta999's version -
Salik - 15.06.2017
A bug with a nickname check with Russian nicknames, with the getplayername function, when checked by RegEx, shows that nickname is not valid.
Regular expression -
PHP код:
"[A-Z][a-z]+_[A-Z][a-z]+|[А-Я][а-я]+_[А-Я][а-я]+"
Ascii -
PHP код:
А = 208 144 | Я = 208 175 || а = 208 176 | я = 209 143
Himself nickname -
Re: YSF - kurta999's version -
IllidanS4 - 15.06.2017
I didn't know YSF does RegEx checks. There's nothing wrong in the pattern.
Re: YSF - kurta999's version -
Salik - 15.06.2017
Quote:
Originally Posted by sprtik
I didn't know YSF does RegEx checks. There's nothing wrong in the pattern.
|
I did not say that I check regex with YSF plugin, please read my message.
And in the pattern there are no mistakes, I even checked them with simple checks on the validity of Russian nicknames, and displays an error when connecting, probably when the player connects to it in nickname something happens (it is unlikely) or it is necessary to remake the function GetPlayerName, probably it is that Then when you connect the player (OnPlayerConnect) displays something that is not what or what happens.
Re: YSF - kurta999's version -
kurta999 - 15.06.2017
Quote:
Originally Posted by iLearner
Did you compile yet.
|
I wasn't able to compile it on my Debian VPS because i wasn't able to install GCC6 on it.. I'll anyway try to find a working way for you
Re: YSF - kurta999's version -
xhunterx - 16.06.2017
Hi, the current version works for me but when I compile it on my local Ubuntu, I get
Quote:
[19:35:09] Loading plugin: YSF.so
[19:35:09] Failed (plugins/YSF.so: undefined symbol: _ZTINSt6thread6_StateE)
[19:35:09] Loaded 5 plugins.
|
How did you fix this? Do I have to use a different OS?
I need a sligtly altered version of YSF for my server and would apreciate any help.
PS: Linking on the machine with the server is not really an option as I use a hosting service.
Re: YSF - kurta999's version -
iLearner - 17.06.2017
Quote:
Originally Posted by kurta999
I wasn't able to compile it on my Debian VPS because i wasn't able to install GCC6 on it.. I'll anyway try to find a working way for you
|
Ye, still waiting.
Re: YSF - kurta999's version -
Salik - 17.06.2017
Quote:
Originally Posted by Salik
I did not say that I check regex with YSF plugin, please read my message.
And in the pattern there are no mistakes, I even checked them with simple checks on the validity of Russian nicknames, and displays an error when connecting, probably when the player connects to it in nickname something happens (it is unlikely) or it is necessary to remake the function GetPlayerName, probably it is that Then when you connect the player (OnPlayerConnect) displays something that is not what or what happens.
|
Kurta fix this. Link for fix GetPlayerName -
FIX LINK
Re: YSF - kurta999's version -
kurta999 - 18.06.2017
It's interesting.. Give me example characters which I should test.
Re: YSF - kurta999's version -
kurta999 - 18.06.2017
@iLearner:
Quote:
Originally Posted by sprtik
|
Try this version. Or this:
For me everything is fine.
Re: YSF - kurta999's version -
Salik - 19.06.2017
Quote:
Originally Posted by kurta999
It's interesting.. Give me example characters which I should test.
|
->
Quote:
Originally Posted by Salik
A bug with a nickname check with Russian nicknames, with the getplayername function, when checked by RegEx, shows that nickname is not valid.
Regular expression -
PHP код:
"[A-Z][a-z]+_[A-Z][a-z]+|[А-Я][а-я]+_[А-Я][а-я]+"
Ascii -
PHP код:
А = 208 144 | Я = 208 175 || а = 208 176 | я = 209 143
Himself nickname -
|
And AllChar =
PHP код:
static isRussianCharacter[] =
{
'А', 'а', 'Б', 'б', 'В', 'в',
'Г', 'г', 'Д', 'д', 'Е', 'е',
'Ё', 'ё', 'Ж', 'ж', 'З', 'з',
'И', 'и', 'Й', 'й', 'К', 'К',
'Л', 'л', 'М', 'м', 'Н', 'н',
'О', 'о', 'П', 'п', 'Р', 'р',
'С', 'с', 'Т', 'т', 'У', 'у',
'Ф', 'ф', 'Х', 'х', 'Ц', 'ц',
'Ч', 'ч', 'Ш', 'ш', 'Щ', 'щ',
'Ъ', 'ъ', 'Ы', 'ы', 'ь', 'ь',
'Э', 'э', 'Ю', 'ю', 'Я', 'я'
};
stock PreloadAllowNickCharacters() {
for(new i = 0; i < sizeof(isRussianCharacter); i++) {
//
AllowNickNameCharacter(isRussianCharacter[i], true);
}
return true;
}
Russian Characters - Wikipedia
Re: YSF - kurta999's version -
IllidanS4 - 19.06.2017
I assume you use the
Windows-1251 character set. For compatibility with other users and compilers, I'd recommend writing the characters using their respective ANSI character codes, not the character themselves.
Re: YSF - kurta999's version -
Salik - 19.06.2017
Quote:
Originally Posted by kurta999
It's interesting.. Give me example characters which I should test.
|
Quote:
Originally Posted by sprtik
I assume you use the Windows-1251 character set. For compatibility with other users and compilers, I'd recommend writing the characters using their respective ANSI character codes, not the character themselves.
|
I want what day I already have to explain to you that the bug is in the function GetPlayerName, probably kurta999 understood me.
Re: YSF - kurta999's version -
IllidanS4 - 19.06.2017
Quote:
Originally Posted by Salik
I want what day I already have to explain to you that the bug is in the function GetPlayerName, probably kurta999 understood me.
|
For some reason, GetPlayerName takes the characters in the player's name as signed bytes (someone apparently forgot
unsigned char), and does sign extension to store them to the string. Thus characters with codes > 127 (all non-ASCII characters) get stored as negative values instead of values in range 0 - 255. Therefore, 'Ń' is stored as 0xFFFFFFD1 (-47) instead of 209. This produces a packed string, which is recognized by all other natives, but contains wrong characters.
Why hasn't this been spotted before? Because the packedness of a string is determined by the first character in the string, and so far all character names tested (latin with diacritics) apparently didn't start with a non-ASCII letter, thus the string was recognized as unpacked by all routines, and therefore they ignored the redundant FFFFFFs. Nice bug you've found!
Fortunately, it is possible to fix this with a simple function:
Код:
stock NormSignedCharString(string[])
{
for(new i = 0; string[i]; i++)
{
string[i] &= 0xFF;
}
}
This strips all non-character data from the string. However, it appears that this is not caused only by GetPlayerName, but possibly other functions. I have observed GetPVarString string behaving this way, too. Might be even an error in Pawn implementation.
Re: YSF - kurta999's version -
Salik - 19.06.2017
Quote:
Originally Posted by sprtik
For some reason, GetPlayerName takes the characters in the player's name as signed bytes (someone apparently forgot unsigned char), and does sign extension to store them to the string. Thus characters with codes > 127 (all non-ASCII characters) get stored as negative values instead of values in range 0 - 255. Therefore, 'Ń' is stored as 0xFFFFFFD1 (-47) instead of 209. This produces a packed string, which is recognized by all other natives, but contains wrong characters.
Why hasn't this been spotted before? Because the packedness of a string is determined by the first character in the string, and so far all character names tested (latin with diacritics) apparently didn't start with a non-ASCII letter, thus the string was recognized as unpacked by all routines, and therefore they ignored the redundant FFFFFFs. Nice bug you've found!
Fortunately, it is possible to fix this with a simple function:
Код:
stock NormSignedCharString(string[])
{
for(new i = 0; string[i]; i++)
{
string[i] &= 0xFF;
}
}
This strips all non-character data from the string. However, it appears that this is not caused only by GetPlayerName, but possibly other functions. I have observed GetPVarString string behaving this way, too. Might be even an error in Pawn implementation.
|
facepalm, server kicked with your fix -
The variant from Daniel_Cortez helped, but still you(kurta999) need to fix the fix in the YSF plugin.
PHP код:
FixSVarString(str[], size = sizeof(str))//thx to daniel cortez
for (new i = 0; ((str[i] &= 0xFF) != '\0') && (++i != size);) {}
Re: YSF - kurta999's version -
IllidanS4 - 19.06.2017
Quote:
Originally Posted by Salik
facepalm, server kicked with your fix -
for (new i = 0; ((str[i] &= 0xFF) != '\0') && (++i != size)  {}[/php]
|
For no reason, the code does the same thing...
Re: YSF - kurta999's version -
Salik - 19.06.2017
Quote:
Originally Posted by sprtik
For no reason, the code does the same thing...
|
I also thought the same way but somewhere you made a mistake probably.
Re: YSF - kurta999's version -
kurta999 - 24.06.2017
Quote:
Originally Posted by Salik
Kurta fix this. Link for fix GetPlayerName - FIX LINK
|
It's not possible to load first yes, then this plugin? It might work anyway without touching ysf.
Kurta you kill me with anxiety -
RazorGuigo - 26.06.2017
When will the new version of the plugin come out?
I'm dreaming times, expecting AttachedObecjts per player, and the server controlling sirens ... I have lots of ideas for them ^^