View Single Post
Afronanny
Veteran Member
Join Date: Aug 2009
Old 04-18-2010 , 18:31   Re: [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #11

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