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

[EXTENSION] CSteamID - SteamIDs as 64bit integers


Post New Thread Reply   
 
Thread Tools Display Modes
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
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 #12

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 #13

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 #14

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
egor1908
Veteran Member
Join Date: Sep 2009
Old 06-01-2010 , 17:17   Re: [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #15

I'm not blaming your work, i think it's great, but whan can this be used for? For gaining faster acces for someone's ID page?
egor1908 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-01-2010 , 21:04   Re: [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #16

It's more reliable, i.e. a CSteamID won't break with trivial changes to the display format used (STEAM_1 instead of STEAM_0 for example).
__________________
asherkin is offline
voogru
Inspector Javert
Join Date: Oct 2004
Old 06-02-2010 , 12:33   Re: [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #17

Quote:
Originally Posted by asherkin View Post
It's more reliable, i.e. a CSteamID won't break with trivial changes to the display format used (STEAM_1 instead of STEAM_0 for example).
I think it's a matter of time before the STEAM_ mask goes away completely. It probably won't be until the next iteration of their engine though which they are probably secretly working on.

So using the 64 bit numbers may not be useful for the plug-ins (because a new engine will by default, break all of the plug-ins), but for stuff that resides in MySQL databases and on websites it will make that stuff immune to the changes.
voogru is offline
egor1908
Veteran Member
Join Date: Sep 2009
Old 06-04-2010 , 07:15   Re: [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #18

Quote:
Originally Posted by asherkin View Post
It's more reliable, i.e. a CSteamID won't break with trivial changes to the display format used (STEAM_1 instead of STEAM_0 for example).
Isnt the first number depending on if you are online or not? That's what i have observed.
egor1908 is offline
voogru
Inspector Javert
Join Date: Oct 2004
Old 06-04-2010 , 11:35   Re: [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #19

Quote:
Originally Posted by egor1908 View Post
Isnt the first number depending on if you are online or not? That's what i have observed.
no.
voogru is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 06-11-2010 , 23:42   Re: [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #20

Just click one more time to download here.
__________________

Last edited by pheadxdll; 09-16-2012 at 11:19.
pheadxdll is offline
Reply


Thread Tools
Display Modes

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 09:24.


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