As it's been asked a few times in my presence (and people appear to hate using the backpack to check
), I thought I'd post this up here.
If you're lucky enough to receive a gift, it will say "Gift from: <int>" on tf2items.com (or similar sites). People sometimes want to know who it was that blessed them with an additional equaliser (insert complaints prior to the "can craft"/"can trade" move by Valve). The answer is simple: we're half way through conversion.
Assume the SteamID is formatted like this: STEAM_X:
Y:
Z. We only care about Y and Z (X should be 0). Now, the gift ID will be something like 33805851 (a real gift that [-aRcTiC-] got has this ID). So we take this ID and look at it the same way
voogru looks at the full ID.
If the last digit of the ID is odd, Y is 1. If the last digit of the ID is even it is 0. In this case, it is odd, so we now have:
STEAM_0:1:Z.
We subtract Y from Z then divide by 2, yielding Z = 16902925.
This means our anonymous gifter (not annonymous if you use the backpack ...) is STEAM_0:1:16902925.
You then use voogru's method to get the profile ID and you can thank/abuse them as you so choose.
Have fun backpack viewers!
PHP (from asherkin):
Code:
return "STEAM_0:" . $account % 2 . ":" . (int)($account / 2);