Thread: Crashes Server
View Single Post
Author Message
The Professional
Member
Join Date: Nov 2015
Location: İstanbul
Old 07-04-2016 , 10:49   Crashes Server
Reply With Quote #1

This plugin crashing my server:

https://forums.alliedmods.net/showpo...04&postcount=4

Crashes after a few hours of being active.. What should I do? I need NET_QueuePacket Anti Spam

PHP Code:
#include <amxmodx>
#include <orpheu>

new OrpheuFunction:HandleFuncNETQueuePacket;
new 
OrpheuFunction:HandleFuncConPrintf;

new 
OrpheuHook:HandleHookConPrintf;

public 
plugin_init()
{
    
register_plugin"Ban NET Packet Spammer""1.0.1""Arkshine" );
    
    
HandleFuncNETQueuePacket OrpheuGetFunction"NET_QueuePacket" );
    
HandleFuncConPrintf      OrpheuGetFunction"Con_Printf" );
    
    
OrpheuRegisterHookHandleFuncNETQueuePacket"NET_QueuePacket_Pre"OrpheuHookPre );
    
OrpheuRegisterHookHandleFuncNETQueuePacket"NET_QueuePacket_Post"OrpheuHookPost );
}   

public 
NET_QueuePacket_Pre()
{
    
HandleHookConPrintf OrpheuRegisterHookHandleFuncConPrintf"Con_Printf" );
}

public 
Con_Printf( const fmt[], const arg[] )
{
    static const 
message[] = "Oversize packet from ";
    
    if( 
containfmtmessage ) >= )
    {
        new 
ip16 ], ic;
        
        while( 
charsmaxip ) && ( fmtcharsmaxmessage ) ] ) && != ':' 
        { 
            
ipi++ ] = c
        }   
        
        
ip] = EOS;

        
log_to_file"NET_Packet_Spammer.log""Blocking %s"ip );
        
        
server_cmd"addip 0 ^"%s^""ip );
        
server_exec();
    }
}

public 
NET_QueuePacket_Post()
{
    
OrpheuUnregisterHookHandleHookConPrintf ); 
__________________
The Professional is offline