Raised This Month: $120 Target: $400
 30% 

Convert STEAMID to Steam Community ID


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
voogru
Inspector Javert
Join Date: Oct 2004
Old 09-16-2007 , 01:09   Convert STEAMID to Steam Community ID
Reply With Quote #1

I figured I would share this little snippet, this will convert a STEAMID to the a players friendID which is used for steam community.

What could potentially be done with this, is to fetch data on a player, see what groups he is in, and basically gives you the flexibility to ban whole groups from your server without knowing all of their steamids.

At least, thats what I intend to do with it. You can also of course do the reverse, converting friend ID's to steamids.

PHP Code:
__int64 GetFriendID( const char *pszAuthID )
{
    if(!
pszAuthID)
        return 
0;

    
int iServer 0;
    
int iAuthID 0;

    
char szAuthID[64];
    
strcpy_s(szAuthID63pszAuthID);

    
char *szTmp strtok(szAuthID":");
    while(
szTmp strtok(NULL":"))
    {
        
char *szTmp2 strtok(NULL":");
        if(
szTmp2)
        {
            
iServer atoi(szTmp);
            
iAuthID atoi(szTmp2);
        }
    }

    if(
iAuthID == 0)
        return 
0;

    
__int64 i64friendID = (__int64)iAuthID 2;

    
//Friend ID's with even numbers are the 0 auth server.
    //Friend ID's with odd numbers are the 1 auth server.
    
i64friendID += 76561197960265728 iServer

    return 
i64friendID;

Have fun.

Edit: Using this a Pure MySQL was created

Last edited by devicenull; 02-22-2009 at 22:43.
voogru is offline
 


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


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