Raised This Month: $ Target: $400
 0% 

Convert STEAMID to Steam Community ID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 08-07-2017 , 08:09   Re: Convert STEAMID to Steam Community ID
Reply With Quote #1

Quote:
Originally Posted by waylander3 View Post
No, i mean on server. On my server (dota 2) i have U: format (in "status"), and i need STEAM: format.
It sounded like you wanted the formula for converting it..

If you want the "status" command to show different output, you need to create a plugin that does it exactly as you want.

If you have any other plugins showing the one where you want the other, you need to adjust those plugins yourself, or hire someone to do it for you.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-27-2017 , 02:05   Re: Convert STEAMID to Steam Community ID
Reply With Quote #2

Note that the number 76561197960265728 looks like a constant, but it really isn't.

This doesn't really matter if you're converting SteamId2 to SteamId64 because SteamId2 only supports individual user accounts. However, SteamId3 also contains the account type and (optionally) instance ID.

The correct calculation for Community IDs:

Code:
((universe << 56) | (accountType << 52) | (instance << 32) | accountId)
The first 3 default to 1 for individual user accounts, which means the "magic number" for individual accounts is

Code:
((1L << 56) | (1L << 52) | (1L << 32))
which is 76561197960265728.

(L is there because 64-bit literals need it in the language I was using to double check this.)

If you try this to get group profile IDs or game server profile IDs, it fails spectacularly because they use different account types and instances.

Side note: The second section of a SteamId2 is the lowest bit of the account ID and the third section is the remaining 31 bits of the account ID. Hence, to get the account ID, it's

((third section << 1) | second section)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-27-2017 at 02:09.
Powerlord is offline
rautamiekka
Veteran Member
Join Date: Jan 2009
Location: Finland
Old 09-27-2017 , 02:25   Re: Convert STEAMID to Steam Community ID
Reply With Quote #3

Quote:
Originally Posted by Powerlord View Post
Note that the number 76561197960265728 looks like a constant, but it really isn't.

This doesn't really matter if you're converting SteamId2 to SteamId64 because SteamId2 only supports individual user accounts. However, SteamId3 also contains the account type and (optionally) instance ID.

The correct calculation for Community IDs:

Code:
((universe << 56) | (accountType << 52) | (instance << 32) | accountId)
The first 3 default to 1 for individual user accounts, which means the "magic number" for individual accounts is

Code:
((1L << 56) | (1L << 52) | (1L << 32))
which is 76561197960265728.

(L is there because 64-bit literals need it in the language I was using to double check this.)

If you try this to get group profile IDs or game server profile IDs, it fails spectacularly because they use different account types and instances.

Side note: The second section of a SteamId2 is the lowest bit of the account ID and the third section is the remaining 31 bits of the account ID. Hence, to get the account ID, it's

((third section << 1) | second section)
Very good to know, thank you a lot.
__________________
Links to posts I received Karma from:
Big thanks to all who gave Karma
rautamiekka is offline
Send a message via ICQ to rautamiekka Send a message via AIM to rautamiekka Send a message via MSN to rautamiekka Send a message via Yahoo to rautamiekka Send a message via Skype™ to rautamiekka
james12
New Member
Join Date: Sep 2009
Old 09-08-2009 , 19:31   Re: Convert STEAMID to Steam Community ID
Reply With Quote #4

This is what im talking about =D
Attached Thumbnails
Click image for larger version

Name:	Steam-Module.jpg
Views:	576
Size:	13.6 KB
ID:	49334  
james12 is offline
SilentBr
Veteran Member
Join Date: Jan 2009
Old 02-08-2013 , 16:10   Re: Convert STEAMID to Steam Community ID
Reply With Quote #5

Is there a version of steamid converter with all info like steamidconverter.com?

Those steamid.php that I found in this thread, convert only STEAM_ID to community link.

Thanks
SilentBr 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