Raised This Month: $ Target: $400
 0% 

[Orpheu] SV_ClientConnect & Con_Printf


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 06-30-2012 , 20:40   [Orpheu] SV_ClientConnect & Con_Printf
Reply With Quote #1

I have this: (Code is not mine)
PHP Code:
public OrpheuHookReturn:OnSV_ConnectClientPre( )
{
    
handlePrintf OrpheuRegisterHookOrpheuGetFunction"Con_Printf" ), "Con_Printf" OrpheuHookPre );

    return 
OrpheuIgnored;
}

public 
OrpheuHookReturn:Con_Printf( const a[ ], const message[ ] )
{
    if( 
containimessage,"^" connectedaddress ^"" ) != -)
    {
        static 
len
        len 
255;
        
        static 
str_right256 ], str_left256 ], ip256 ], Msg256 ];
        
        
formatexMsg,charsmaxMsg ),"%s"message );
        
        
splitMsgstr_leftlenstr_rightlen"^" connectedaddress ^"" );
        
strtokstr_rightiplenstr_rightlen':' );
        
        
log_amx"IP: %s"ip );
    }
    
    return 
OrpheuIgnored;

Can I get SteamID and player name where I take client IP ?
__________________

Last edited by Neeeeeeeeeel.-; 06-30-2012 at 20:53.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 07-01-2012 , 02:48   Re: [Orpheu] SV_ClientConnect & Con_Printf
Reply With Quote #2

When that hook it is called the player has not steamid or index so I can't get them, thanks meTaLiCroSS.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-01-2012 , 03:13   Re: [Orpheu] SV_ClientConnect & Con_Printf
Reply With Quote #3

I can't confirm that exactly (the index thing), wait for someone's answers.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-01-2012 , 03:40   Re: [Orpheu] SV_ClientConnect & Con_Printf
Reply With Quote #4

If you know the IP, you could use find_player with the IP to get the player's id, then using get_user_authid/get_user_name.
__________________
Arkshine is offline
Old 07-01-2012, 15:11
Neeeeeeeeeel.-
This message has been deleted by Neeeeeeeeeel.-.
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 07-02-2012 , 11:18   Re: [Orpheu] SV_ClientConnect & Con_Printf
Reply With Quote #5

Well, I tried your code but now I have other problem.
I'm trying to fix a new hlfill exploit... When I tried the first time it works, but not now... is it something wrong?

Here is full code:
PHP Code:
#include <amxmodx>
#include <orpheu>

#define PLUGIN "Anti Fake Bot"
#define VERSION "1.0"
#define AUTHOR "kanagava"

new ip_old256 ], ip_warn256 ], Msg256 ];

new 
OrpheuHook:handlePrintf

new time_last_connwarnold_timeregistered;

public 
plugin_init( )
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
OrpheuRegisterHookOrpheuGetFunction"SV_ConnectClient" ),"OnSV_ConnectClientPre"OrpheuHookPre );
    
OrpheuRegisterHookOrpheuGetFunction"SV_ConnectClient" ),"OnSV_ConnectClientPost"OrpheuHookPost );
}

public 
OrpheuHookReturn:OnSV_ConnectClientPre( )
{
    
registered 0;
    
    if( 
get_systime( ) - old_time <= )
    {
        
handlePrintf OrpheuRegisterHookOrpheuGetFunction"Con_Printf" ), "Con_Printf" OrpheuHookPre );
        
registered 1;
    }
    
    
old_time get_systime( );
    
    return 
OrpheuIgnored;
}

public 
OrpheuHookReturn:OnSV_ConnectClientPost( )
{
    if( 
registered )
        
OrpheuUnregisterHookhandlePrintf );

    return 
OrpheuIgnored;
}

public 
OrpheuHookReturn:Con_Printf( const a[ ], const message[ ] )
{
    
registered 1;

    if( 
containimessage,"^" connectedaddress ^"" ) != -)
    {
        new 
len 255;
        new 
temp_right256 ], temp_left256 ], conn_ip256 ];
        
        
formatexMsg,charsmaxMsg ),"%s"message );
        
        
splitMsgtemp_leftlentemp_rightlen"^" connectedaddress ^"" );
        
strtoktemp_rightconn_iplentemp_rightlen':' );
        
        if( 
equalconn_ip,ip_old ) && !equalconn_ip,"" ) && ( ( get_systime( ) - time_last_conn ) < ) )
        {
            
warn warn 1;
            
            if( 
warn && equalconn_ipip_warn ) )
            {
                
/*static id;
                id = find_player( "d", ip_old );
                
                static szName[ 32 ], szSteamID[ 64 ];
                
                get_user_name( id, szName, charsmax( szName ) );
                get_user_authid( id,szSteamID, charsmax( szSteamID ) );*/
                
                
                
log_to_file"orpheu_bot_block.txt""[Fake Bot Flood] Flood stopped from: %s - Name: \
                 - SteamID:  - Tipo: "
ip_old/*, szName, szSteamID, is_user_bot( id ) ? "BOT" : "PLAYER"*/ );
                
                
server_cmd"addip 120.0 %s"ip_old );
            }
            
            
ip_warn conn_ip;
        }
        
        else
            
warn 0;
        
        
ip_old conn_ip;
        
time_last_conn get_systime( );
    }
    
    return 
OrpheuIgnored;

HTML Code:
{
    "name" : "SV_ConnectClient",
    "library" : "engine",
    "identifiers" :
    [
        {
            "os" : "windows",
            "value" : [0x55,0x8B,0xEC,0x81,"*","*","*","*","*",0x53,0x56,0x57,0xB9,0x05,0x00,0x00,0x00,0xBE,"*","*","*","*",0x8D,"*","*",0x33,0xDB,0x68,"*","*","*","*"]
        },
        {
            "os" : "linux",
            "value" : "SV_ConnectClient"
        }
    ]
}
HTML Code:
{
    "name"      : "Con_Printf",
    "library"   : "engine",
    "arguments" : 
    [
        {
            "type" : "char *" 
        },
        {
            "type" : "char *" 
        }
    ],
    "identifiers" : 
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : [0x55,0x8B,0xEC,0xB8,"*","*","*","*",0xE8,"*","*","*","*",0x8B,"*","*",0x8D,"*","*",0x50,0x51,0x8D,0x95,"*","*","*","*",0x68,"*","*","*","*",0x52,0xE8,"*","*","*","*",0x8D,0x85,"*","*","*","*",0x50]
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "Con_Printf"
        } 
    ]
}
__________________

Last edited by Neeeeeeeeeel.-; 07-02-2012 at 11:21.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-02-2012 , 12:29   Re: [Orpheu] SV_ClientConnect & Con_Printf
Reply With Quote #6

What problem you're talking about ? What exploit ?
__________________
Arkshine is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 07-02-2012 , 12:48   Re: [Orpheu] SV_ClientConnect & Con_Printf
Reply With Quote #7

Quote:
Originally Posted by Arkshine View Post
What problem you're talking about ? What exploit ?
It sents bots to my server and every time a bot disconnected the server gets lag, but it is not the common hlfill because I've a metamod plugin that fixs it.
I put a log on client connect & disconnect but nothing apperas, but clients console shows that '%botname% dropped'

I tried first time with that plugin and it banned the ip. But now I tried again and it is not working.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 07-02-2012 , 15:09   Re: [Orpheu] SV_ClientConnect & Con_Printf
Reply With Quote #8

Quote:
Originally Posted by Arkshine View Post
If you know the IP, you could use find_player with the IP to get the player's id, then using get_user_authid/get_user_name.
Isn't it possible for the client to not be authorized yet?
Backstabnoob is offline
mazdan
Junior Member
Join Date: Jan 2011
Old 07-29-2012 , 12:02   Re: [Orpheu] SV_ClientConnect & Con_Printf
Reply With Quote #9

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
I have this: (Code is not mine)
Yes, it's my code
What do you want to do? May be I can help you
You can't use get_user_authid() - this is to early to use it.
Quote:
What problem you're talking about ? What exploit ?
Oh, this is only for non-steam servers But may be soon it be possible to use it on steam servers.

Neeeeeeeeeel.-, This code is really bad, I would not want to have my code quoted.
Such pawn and Orpheu Guru as Arkshine will be bad when they see it

UPD: now it's not working because new flooder using proxy. But new version of noflood.amxx is working ok
p.s. Sorry for my bad English.

Last edited by mazdan; 07-29-2012 at 12:14.
mazdan is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:04.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode