07.03.2012, 10:19
Nope, that bug was patched like 1-2 releases ago, these are fake players. I've seen this attack multiple times.
I tried to make some code to combat this, but I never tested it as the attacks stopped. I added this code before any login code was attempted:
Not sure if it will work, as I said before, I haven't tested it. Nor have I tested the IsStringAlphaNumeric function, but I'm sure you get the gist of what I'm trying to do, consider it as pseudo-code, if it doesn't work.
I tried to make some code to combat this, but I never tested it as the attacks stopped. I added this code before any login code was attempted:
pawn Код:
stock IsStringAlphaNumeric(string[]) {
new
i;
static const
szAppropriateCharacters[] = { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" };
for(new c = 0; c < strlen(string); c++) {
for(new f = 0; f < sizeof(szAppropriateCharacters); f++) {
if(string[c] == szAppropriateCharacters[f])
i++;
}
}
if(i < strlen(string)) return 0;
return 1;
}
public OnPlayerConnect(playerid) {
new
szPlayerName[MAX_PLAYER_NAME],
szPlayerIP[16],
szPlayerIPs[16],
szPlayerNames[MAX_PLAYER_NAME];
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
GetPlayerIp(playerid, szPlayerIP, sizeof(szPlayerIP));
foreach(Player, x) {
GetPlayerName(x, szPlayerNames, MAX_PLAYER_NAME);
GetPlayerIp(playerid, szPlayerIPs, sizeof(szPlayerIPs));
if(strfind(szPlayerName, szPlayerNames, true) != -1 && !strcmp(szPlayerIPs, szPlayerIP, true) && IsStringAlphaNumeric(szPlayerNames) == 0)
return BanEx(playerid, "Client spam attack attempt");
}
// The rest of your login code...
}