Raised This Month: $ Target: $400
 0% 

What is 'auth' and how does it relate to SteamID/Name?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
crayz
AlliedModders Donor
Join Date: Jul 2007
Old 01-06-2014 , 07:01   What is 'auth' and how does it relate to SteamID/Name?
Reply With Quote #1

Is there any relation between a user's auth code and their Steam ID or name? Perhaps a user's IP address? Is the auth generated by the store plugin itself?

edit: I just discovered this handy snippet:
Code:
    $toks = explode(":", $steamid);
    $odd = (int)$toks[1];
    $halfAID = (int)$toks[2];

    return ($halfAID*2) + $odd;
https://forums.alliedmods.net/showpo...&postcount=234

Which is exactly what I was trying to figure out :-)
__________________

Last edited by crayz; 01-08-2014 at 19:26.
crayz is offline
alongub
Veteran Member
Join Date: Aug 2009
Location: Israel
Old 01-07-2014 , 13:31   Re: What is 'auth' and how does it relate to SteamID/Name?
Reply With Quote #2

It's the account id
__________________
alongub is offline
crayz
AlliedModders Donor
Join Date: Jul 2007
Old 01-08-2014 , 10:19   Re: What is 'auth' and how does it relate to SteamID/Name?
Reply With Quote #3

Quote:
Originally Posted by alongub View Post
It's the account id
I was aware of this quickly after looking at the database structure, I saw the store didn't go by the actual steam id, 64 bit, or username, but instead the auth id. So I was seeking how the auth id is related to a steam id, but the snippet in op answered that for me
__________________

Last edited by crayz; 01-08-2014 at 19:27.
crayz is offline
Arrow768
Veteran Member
Join Date: Nov 2011
Location: Austria
Old 01-08-2014 , 10:57   Re: What is 'auth' and how does it relate to SteamID/Name?
Reply With Quote #4

These are the functions I used at the store webpanel:

PHP Code:
    function auth_to_steamid($authid)
    {
        
$steam = array();
        
$steam[0] = "STEAM_0";

        if (
$authid == 0)
        {
            
$steam[1] = 0;
        }
        else
        {
            
$steam[1] = 1;
            
$authid -= 1;
        }
        
$steam[2] = $authid 2;
        return 
$steam[0] . ":" $steam[1] . ":" $steam[2];
    }

    function 
steamid_to_auth($steamid)
    {
        
//from https://forums.alliedmods.net/showpost.php?p=1890083&postcount=234
        
$toks explode(":"$steamid);
        
$odd = (int) $toks[1];
        
$halfAID = (int) $toks[2];

        return (
$halfAID 2) + $odd;
    } 
__________________
Arrow768 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 06:08.


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