Spamming OnPlayerDeath causing the server to crash? -
Danny_Costelo - 25.09.2009
Well recently it's been happening alot at random times, a player, or hacker I should say joins the server than dies about 500 times a second, the entire server crashes and no one is able to re-enter, they immediately crash.
Quote:
Originally Posted by server_log.txt.
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
[09:15:23] [death] Leon_Kny died 54
|
I already did apply a code under OnPlayerDeath, where if they die more than 6 times in 3 seconds, their banned, but it still doesnt work..
Re: Spamming OnPlayerDeath causing the server to crash? -
Desert - 25.09.2009
I think it could be possible to crash a server by spamming a callback which in this case is OnPlayerDeath
Please post your code
Re: Spamming OnPlayerDeath causing the server to crash? -
Calgon - 26.09.2009
FYI: 54 - Collision *****
Please post the code that you created to prevent spam.
Re: Spamming OnPlayerDeath causing the server to crash? -
Danny_Costelo - 26.09.2009
pawn Код:
PlayerDeath[playerid]++;
if(PlayerDeath[playerid] == 5)
{
Ban(playerid);
}
than every 3 seconds the PlayerDeath var is set to 0.
Also previously the death reason was 255.
Re: Spamming OnPlayerDeath causing the server to crash? -
Calgon - 26.09.2009
Quote:
Originally Posted by 0xF29323
pawn Код:
PlayerDeath[playerid]++; if(PlayerDeath[playerid] == 5) { Ban(playerid); }
than every 3 seconds the PlayerDeath var is set to 0.
|
You're not resetting it. That's just going to ban them on 5 deaths.
Use SetTimerEx() to reset their deaths and make a public to set PlayerDeaths to 0.
Re: Spamming OnPlayerDeath causing the server to crash? -
Danny_Costelo - 26.09.2009
Quote:
Originally Posted by Calgon
Quote:
Originally Posted by 0xF29323
pawn Код:
PlayerDeath[playerid]++; if(PlayerDeath[playerid] == 5) { Ban(playerid); }
than every 3 seconds the PlayerDeath var is set to 0.
|
You're not resetting it. That's just going to ban them on 5 deaths.
Use SetTimerEx() to reset their deaths and make a public to set PlayerDeaths to 0.
|
I do reset it.. lol. My server wouldn't have 60 players on right now if I didn't.
It's on another timer which I use for alot of other things, no point of posting it, it does a loop with one line of code (PlayerDeath[i(loop variable)] = 0
Re: Spamming OnPlayerDeath causing the server to crash? -
Calgon - 26.09.2009
Quote:
Originally Posted by Pawnsta
Quote:
Originally Posted by Calgon
Quote:
Originally Posted by 0xF29323
pawn Код:
PlayerDeath[playerid]++; if(PlayerDeath[playerid] == 5) { Ban(playerid); }
than every 3 seconds the PlayerDeath var is set to 0.
|
You're not resetting it. That's just going to ban them on 5 deaths.
Use SetTimerEx() to reset their deaths and make a public to set PlayerDeaths to 0.
|
I do reset it.. lol. My server wouldn't have 60 players on right now if I didn't.
It's on another timer which I use for alot of other things, no point of posting it, it does a loop with one line of code (PlayerDeath[i(loop variable)] = 0 
|
First of all, I don't know you so don't make assumptions out nor do I know of your server.
Post the lines that actually reset the deaths; including the for() statement.
Re: Spamming OnPlayerDeath causing the server to crash? -
Sergei - 26.09.2009
pawn Код:
PlayerDeath[playerid]++;
if(PlayerDeath[playerid] >= 5)
{
Ban(playerid);
}
Try using this. It will ban all the players which have death count more or equal to 5, not only if they have exactly 5.
Re: Spamming OnPlayerDeath causing the server to crash? -
Calgon - 26.09.2009
Quote:
Originally Posted by $ЂЯĢ
pawn Код:
PlayerDeath[playerid]++; if(PlayerDeath[playerid] >= 5) { Ban(playerid); }
Try using this. It will ban all the players which have death count more or equal to 5, not only if they have exactly 5.
|
Simplest of things actually work, I was thinking of that but I then re-thought, wouldn't it reach five anyway? But then again he has a timer. Yup, >= should work (equal to or higher than).
Re: Spamming OnPlayerDeath causing the server to crash? -
Danny_Costelo - 26.09.2009
Quote:
Originally Posted by Calgon
Quote:
Originally Posted by Pawnsta
Quote:
Originally Posted by Calgon
Quote:
Originally Posted by 0xF29323
pawn Код:
PlayerDeath[playerid]++; if(PlayerDeath[playerid] == 5) { Ban(playerid); }
than every 3 seconds the PlayerDeath var is set to 0.
|
You're not resetting it. That's just going to ban them on 5 deaths.
Use SetTimerEx() to reset their deaths and make a public to set PlayerDeaths to 0.
|
I do reset it.. lol. My server wouldn't have 60 players on right now if I didn't.
It's on another timer which I use for alot of other things, no point of posting it, it does a loop with one line of code (PlayerDeath[i(loop variable)] = 0 
|
First of all, I don't know you so don't make assumptions out nor do I know of your server.
Post the lines that reset the deaths; including the for() statement.
|
Are you blind? I already posted the code, and I already told you that the death resets to 0 on a timer, which I won't post, because it has other things in it.
Look at the first post which I replied to you, I told you I reset the variable..