Raised This Month: $32 Target: $400
 8% 

STEAM_ID_PENDING Kicker


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
showdax
Senior Member
Join Date: Dec 2004
Old 12-17-2005 , 12:55   STEAM_ID_PENDING Kicker
Reply With Quote #1

I quickly made this plugin to handle the apparent new exploit that allows players to join and stay on a server with a pending steamid. A pending steamid means that the server hasn't finished validating the player's steamid. The exploit takes advantage of this and their steamid never validates. This can make banning them more annoying and any scripts that ban solely by steamid will be confused by them.

The plugin works around this by kicking clients that go active (spawn) with a pending steamid. 99.9% of the time a player's steamid will be validated before they spawn.

Here's the only interesting bit of code from the plugin:
Code:
void CServerPluginPending_ClientActive(edict_t *entity, bool bLoadGame)
{
        if (!entity)
                RETURN_META(MRES_IGNORED);

        int userid = g_Engine->GetPlayerUserId(entity);
        if (userid < 1)
                RETURN_META(MRES_IGNORED);

        const char *steamid = g_Engine->GetPlayerNetworkIDString(entity);
        if (!steamid || !Q_stristr(steamid, "PENDING"))
                RETURN_META(MRES_IGNORED);

        /* "kickid " = 7, kick message = 40, \0 = 1, + 1 for int length thing */
        int length = ((int) log10((float) userid)) + 49;
        char *command = (char *) malloc(length);
        Q_snprintf(command, length, "kickid %d Network ID didn't validate. Reconnect.\n", userid);
        g_Engine->ServerCommand(command);
        free(command);

        RETURN_META(MRES_HANDLED);
}
Oh, and it's for SourceMM, of course. Linux binary, Windows binary and source code are in the attached archive. Everything is public domain. The Linux binary does not require libstdc++ whatsoever. Just shove the file in mod/addons/ and run "meta load addons/pending_mm".
Attached Files
File Type: zip pending_mm.zip (33.7 KB, 2951 views)
showdax is offline
Send a message via MSN to showdax
 


Thread Tools
Display Modes

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 22:19.


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