Raised This Month: $51 Target: $400
 12% 

[EXTENSION] CSteamID - SteamIDs as 64bit integers


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Afronanny
Veteran Member
Join Date: Aug 2009
Old 04-18-2010 , 18:31   Re: [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #10

Quote:
Originally Posted by Powerlord View Post
Note: I haven't tried this code, I was just examining the sourcecode.

Maybe I'm missing something, but the source code for one of the conversions seems to be off.

More specifically, in SteamIDToCSteamID you add 76561197960265728 to the number in the Steam ID to get a steamcommunity ID.

However, CSteamIDToSteamID does not subtract this number from the steamcommunity ID you pass in before being displayed.

Code:
    //-----------------------------------------------------------------------------
    // Purpose: Converts steam ID to its 64-bit representation
    // Output : 64-bit representation of a Steam ID
    //-----------------------------------------------------------------------------
    uint64 ConvertToUint64() const
    {
        return (uint64) ( ( ( (uint64) m_EUniverse ) << 56 ) + ( ( (uint64) m_EAccountType ) << 52 ) + 
            ( ( (uint64) m_unAccountInstance ) << 32 ) + m_unAccountID );
    }
The answer is in steamclientpublic.h
Afronanny is offline
 



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:33.


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