Convert STEAMID to Steam Community ID
I figured I would share this little snippet, this will convert a STEAMID to the a players friendID which is used for steam community.
What could potentially be done with this, is to fetch data on a player, see what groups he is in, and basically gives you the flexibility to ban whole groups from your server without knowing all of their steamids. At least, thats what I intend to do with it. You can also of course do the reverse, converting friend ID's to steamids. PHP Code:
Edit: Using this a Pure MySQL was created |
Re: Convert STEAMID to Steam Community ID
Really interesting data...
I would never have thought there was a relation ship +Karma for you |
Re: Convert STEAMID to Steam Community ID
That's pretty awesome, voogru. I'm curious as to how you discovered this -- observation with some trial and error?
out of boredom I went and looked up the first few steamids to see how many were definitely valve employees: Code:
steam_0:0:1 (alfred) |
Re: Convert STEAMID to Steam Community ID
Quote:
I got the friendID for these two ID's: STEAM_0:1:1182 (76561197960268093) STEAM_0:1:30679 (76561197960327087) I noticed that the 2 friend ID's were identicle up until 11th number. 76561197960 268093 76561197960 327087 Then I tried this: 76561197960327087 - 76561197960268093 = 58994 Result was higher than expected, so I cut it in half for giggles. 58994 / 2 = 29497 Hmm.. not too far from 30679.. 29497 + 1182 = 30679 DING DING DING DING and 30679 - 29497 = 1182 DING DING DING DING :D To get the first number, I then did: 76561197960268093 - (1182 * 2) = 76561197960265729 But, I use the 76561197960265728 number and then just increment it by what the auth server is. There does not appear to be a STEAM_0:0:0 ID, but there is a STEAM_0:1:0 ID. Now with this knowledge, I also have the option of storing steamid's as 64 bit ints rather than strings. My question to valve is where the hell did they pull out a number like 76561197960265728. A friend of mine pointed out when it's converted to hex it's 110000100000000, but no idea if that is significant or not. |
Re: Convert STEAMID to Steam Community ID
holy cow
|
Re: Convert STEAMID to Steam Community ID
Wow
That's really clever! |
Re: Convert STEAMID to Steam Community ID
voogru: thanks for the logic path behind that :)
Of course you could just store them as 32-bit integers if you wanted... if you just do the X*2 + 1, it will be a long time before they overflow. Nice idea either way for lookup algorithms. |
Re: Convert STEAMID to Steam Community ID
Quote:
|
Re: Convert STEAMID to Steam Community ID
Quote:
|
Re: Convert STEAMID to Steam Community ID
You should post this in the AMXX section too.
|
All times are GMT -4. The time now is 15:51. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.