View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-09-2014 , 10:17   Re: Convert STEAMID to Steam Community ID
Reply With Quote #338

Quote:
Originally Posted by Leonardo View Post
I'll just leave it here.
PHP Code:
function ReadSteamID64$SteamID64 )
{
    if( !
is_numeric$SteamID64 ) ) return null;
    
$binary str_padbcdecbin$SteamID64 ), 64'0'STR_PAD_LEFT );
    return array(
        
'account'    => bindecsubstr$binary, -32 ) ),
        
'instance'    => bindecsubstr$binary, -5220 ) ),
        
'type'        => bindecsubstr$binary, -56) ),
        
'universe'    => bindecsubstr$binary, -64) )
    );

I forget, has anyone mentioned in this thread yet that PHP's number type is only 32-bit on 32-bit systems? 'cause SteamID64 exceeds the size of a 32-bit int.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline