move flood control code to security.pwn
This commit is contained in:
parent
e5a2013426
commit
4e84b19014
@ -131,6 +131,18 @@ hook OnPlayerDisconnect( playerid, reason )
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hook OnPlayerFloodControl( playerid, iCount, iTimeSpan ) {
|
||||||
|
static
|
||||||
|
szIP[ 16 ];
|
||||||
|
|
||||||
|
GetPlayerIp( playerid, szIP, sizeof( szIP ) );
|
||||||
|
|
||||||
|
if ( iCount > 2 && iTimeSpan < 10000 && ! IsPlayerNpcEx( playerid ) ) {
|
||||||
|
BanEx( playerid, "BOT-SPAM" );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
#if !defined DEBUG_MODE
|
#if !defined DEBUG_MODE
|
||||||
// prevent player from leaking rcon password
|
// prevent player from leaking rcon password
|
||||||
hook OnPlayerText( playerid, text[ ] )
|
hook OnPlayerText( playerid, text[ ] )
|
||||||
|
@ -433,19 +433,6 @@ public OnPlayerRequestClass( playerid, classid )
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OnPlayerFloodControl( playerid, iCount, iTimeSpan ) {
|
|
||||||
static
|
|
||||||
szIP[ 16 ];
|
|
||||||
|
|
||||||
GetPlayerIp( playerid, szIP, sizeof( szIP ) );
|
|
||||||
|
|
||||||
if ( iCount > 2 && iTimeSpan < 10000 ) {
|
|
||||||
if ( !IsPlayerNpcEx( playerid ) ) {
|
|
||||||
BanEx( playerid, "BOT-SPAM" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public OnNpcConnect( npcid )
|
public OnNpcConnect( npcid )
|
||||||
{
|
{
|
||||||
return Kick( npcid ), 1;
|
return Kick( npcid ), 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user