Raised This Month: $32 Target: $400
 8% 

Convert STEAMID to Steam Community ID


Post New Thread Reply   
 
Thread Tools Display Modes
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 09-10-2008 , 17:24   Re: Convert STEAMID to Steam Community ID
Reply With Quote #81

This SQL that was posted earlier works fine for me:
Code:
CAST(MID(steamid, 9, 1) AS UNSIGNED) + CAST("76561197960265728" AS UNSIGNED) + CAST(MID(steamid, 11, 10) * 2 AS UNSIGNED)
Translated to PHP that would be something like:
PHP Code:
$community_id substr($steamid91) + 76561197960265728 substr($steamid1110
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
blik
Senior Member
Join Date: May 2006
Old 09-11-2008 , 17:19   Re: Convert STEAMID to Steam Community ID
Reply With Quote #82

Tsunami, are you sure about that?

I picked a random steam ID out of my logged ID's: STEAM_0:0:16393149

The php script posted on first page returns: 76561197993052026

Your php above not using bcmath returns: 76561197966658877

So...?

Edit: checked with my own ID, and my profile is not returned by the php above... Unfortunate, since I'm after a non bcmath version too...

Last edited by blik; 09-11-2008 at 17:22.
blik is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 09-11-2008 , 19:40   Re: Convert STEAMID to Steam Community ID
Reply With Quote #83

Quote:
Originally Posted by blik View Post
Tsunami, are you sure about that?

I picked a random steam ID out of my logged ID's: STEAM_0:0:16393149

The php script posted on first page returns: 76561197993052026

Your php above not using bcmath returns: 76561197966658877

So...?

Edit: checked with my own ID, and my profile is not returned by the php above... Unfortunate, since I'm after a non bcmath version too...
I made an AMXX version, you can port it to PHP with just a few edits (no BCMath involved)

http://forums.alliedmods.net/showthread.php?p=684578
danielkza is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 09-12-2008 , 04:55   Re: Convert STEAMID to Steam Community ID
Reply With Quote #84

Sorry, I kind of forgot the * 2.

PHP Code:
$community_id 76561197960265728 substr($steamid91) + substr($steamid1110) * 2
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
Atreus
SourceMod Donor
Join Date: Apr 2005
Location: San Diego, CA
Old 09-12-2008 , 09:44   Re: Convert STEAMID to Steam Community ID
Reply With Quote #85

Even using that my issue remains ... the did you look at the page I'd linked to? the subtraction itself when that massive is for some reason returned wrong

Edit: Sent a ticket to my host regarding the issue. Not sure if it's just me or not.

Last edited by Atreus; 09-12-2008 at 09:51.
Atreus is offline
Send a message via AIM to Atreus Send a message via MSN to Atreus
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 09-12-2008 , 12:18   Re: Convert STEAMID to Steam Community ID
Reply With Quote #86

Well alright, the whole reason you need to use BCMath is because PHP doesn't support 64-bit integers. Olly made this but it's reported not to work for all Steam IDs:
PHP Code:
$steamParts explode(":"$steamid);
$comId = (int)$steamParts[2] * 2;
$comId += 60265728 + (int)$steamParts[1];
return 
"765611979" $comId
So, you're out of luck.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 09-12-2008 , 12:51   Re: Convert STEAMID to Steam Community ID
Reply With Quote #87

Quote:
Originally Posted by DJ Tsunami View Post
Well alright, the whole reason you need to use BCMath is because PHP doesn't support 64-bit integers. Olly made this but it's reported not to work for all Steam IDs:
PHP Code:
$steamParts explode(":"$steamid);
$comId = (int)$steamParts[2] * 2;
$comId += 60265728 + (int)$steamParts[1];
return 
"765611979" $comId
So, you're out of luck.
You can do the string-math yourself with a very simple code. Just look at the link I posted some responses above.
danielkza is offline
Atreus
SourceMod Donor
Join Date: Apr 2005
Location: San Diego, CA
Old 09-13-2008 , 21:37   Re: Convert STEAMID to Steam Community ID
Reply With Quote #88

I'll check both those out, thanks Also, I found out that while my host won't add in BCMath, they will allow custom PHP installs. I guess I should figure out how to do that
Atreus is offline
Send a message via AIM to Atreus Send a message via MSN to Atreus
Scuzzy
Senior Member
Join Date: Oct 2007
Old 09-19-2008 , 07:08   Re: Convert STEAMID to Steam Community ID
Reply With Quote #89

Atreus, use the SQL, mySQL will do the math just fine. (I'm the one who originally wrote the SQL) Get with me at the [o-t] if you need more help chief. Good to see ya.

Scuzzy
Scuzzy is offline
micheelgeorge
BANNED
Join Date: Sep 2008
Old 09-20-2008 , 06:36   Re: Convert STEAMID to Steam Community ID
Reply With Quote #90

I wanted to get to someones Steam Community page and add them to my friends list - unfortunately the new system for adding people to your friends list in Steam sucks. You need to know someones Steam Username to be able to do it. The problem with that is that there is no way to add to your friends list by Steam ID - and I think there really should be.
----------
micheel

place your ads
micheelgeorge 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 10:56.


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