14.06.2017, 07:45
In YSF,cfg disable dialog protection,but it is disabled by default
"[A-Z][a-z]+_[A-Z][a-z]+|[А-Я][а-я]+_[А-Я][а-я]+"
А = 208 144 | Я = 208 175 || а = 208 176 | я = 209 143
Салик_Давинче
I didn't know YSF does RegEx checks. There's nothing wrong in the pattern.
|
[19:35:09] Loading plugin: YSF.so [19:35:09] Failed (plugins/YSF.so: undefined symbol: _ZTINSt6thread6_StateE) [19:35:09] Loaded 5 plugins. |
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. |
Does my compile produce the same errors?
|
It's interesting.. Give me example characters which I should test.
|
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 код:
PHP код:
PHP код:
|
static isRussianCharacter[] =
{
'А', 'а', 'Б', 'б', 'В', 'в',
'Г', 'г', 'Д', 'д', 'Е', 'е',
'Ё', 'ё', 'Ж', 'ж', 'З', 'з',
'И', 'и', 'Й', 'й', 'К', 'К',
'Л', 'л', 'М', 'м', 'Н', 'н',
'О', 'о', 'П', 'п', 'Р', 'р',
'С', 'с', 'Т', 'т', 'У', 'у',
'Ф', 'ф', 'Х', 'х', 'Ц', 'ц',
'Ч', 'ч', 'Ш', 'ш', 'Щ', 'щ',
'Ъ', 'ъ', 'Ы', 'ы', 'ь', 'ь',
'Э', 'э', 'Ю', 'ю', 'Я', 'я'
};
stock PreloadAllowNickCharacters() {
for(new i = 0; i < sizeof(isRussianCharacter); i++) {
//
AllowNickNameCharacter(isRussianCharacter[i], true);
}
return true;
}
It's interesting.. Give me example characters which I should test.
|
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.
|
stock NormSignedCharString(string[]) { for(new i = 0; string[i]; i++) { string[i] &= 0xFF; } }
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; } } |
FixSVarString(str[], size = sizeof(str))//thx to daniel cortez
for (new i = 0; ((str[i] &= 0xFF) != '\0') && (++i != size);) {}
Kurta fix this. Link for fix GetPlayerName - FIX LINK
|