Raised This Month: $ Target: $400
 0% 

[EXTENSION] CSteamID - SteamIDs as 64bit integers


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-18-2010 , 03:34   Re: [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #1

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.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Afronanny
Veteran Member
Join Date: Aug 2009
Old 04-18-2010 , 18:31   Re: [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #2

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
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 06-01-2010 , 06:28   Re: [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #3

Any progress on this ? I need it for the ep1 engine.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
voogru
Inspector Javert
Join Date: Oct 2004
Old 06-01-2010 , 10:10   Re: [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #4

Quote:
Originally Posted by berni View Post
Any progress on this ? I need it for the ep1 engine.
http://forums.alliedmods.net/showthread.php?t=60899

That's the best you'll get because EP1 engine doesn't have the GetClientSteamID()
voogru is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 06-01-2010 , 16:10   Re: [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #5

Quote:
Originally Posted by voogru View Post
http://forums.alliedmods.net/showthread.php?t=60899

That's the best you'll get because EP1 engine doesn't have the GetClientSteamID()
I know that thread Voogru, but I only found a one way implementation for sourcemod but I want to do it 2 ways, and using 32bit integers for calculation is a bit dirty, isn't it ?

And bl4nk stated he is going to make this work for all other mods also...
you can ge the SteamID for every engine.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni 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 18:15.


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