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

Steam Community Profile Viewer


Post New Thread Reply   
 
Thread Tools Display Modes
Hawkeye-
Senior Member
Join Date: Jan 2009
Old 10-13-2009 , 09:02   Re: Steam Community Profile Viewer
Reply With Quote #21

Take a look at this:

http://www.martinpace.com/steam/Stea...ommunityID.pdf

That has the details of the conversion process that works for your SteamID. I'll take a look at the subroutine later I am a little swamped at the moment.
Hawkeye- is offline
Hawkeye-
Senior Member
Join Date: Jan 2009
Old 10-13-2009 , 09:42   Re: Steam Community Profile Viewer
Reply With Quote #22

Alright, took a quick peak at the code

It looks like the way the URL is being generated, it ALWAYS place 79 as opposed to 80 in the URL and appended the rest, since 79/80 is variable based on the math, I just moved those from static to the math equation side. This 'should' work but I don't have a server to test the code on.

PHP Code:
#include <sourcemod>
#include <sdktools>
public Plugin:myinfo ={
    
name "RG Profile",
    
author "Theowningone",
    
description "RG Profile",
    
version "1.11",
    
url "http://www.theowningone.info/"
};
 
public 
OnPluginStart(){
 
RegConsoleCmd("sm_profile",id,"Takes a steam id, converts it to a steam community link and sends you to it!");
 
CreateConVar("rg_profile_ver","1.11","RG Profile Version",FCVAR_REPLICATED|FCVAR_NOTIFY);
}
public 
Action:id(client,args){
 if(
args==0){
  
PrintToChat(client,"Proper Usage: !profile<steamid, userid, playername>");
  
PrintToChat(client,"Proper Usage: sm_profile <steamid, userid, playername>");
  return 
Plugin_Handled;
 }
 
decl String:arg[128],String:link[256],String:ID[256];
 
GetCmdArgString(arg,128);
 new 
Targ=FindTarget(client,arg,true,false);
 
 if(
Targ<=0){
  
Format(ID,sizeof(ID),"%s",arg);
 }else{
  
GetClientAuthString(Targ,ID,256);
 }
 
AuthIDToFriendID(ID,link,256);
 if(
client!=0){
  
ShowMOTDPanel(client,"ID",link,MOTDPANEL_TYPE_URL);
 }else{
  
PrintToServer("%s",link);
 }
 return 
Plugin_Handled;
}
AuthIDToFriendID(String:AuthID[],String:FriendID[],size){
    
ReplaceString(AuthID,strlen(AuthID),"STEAM_","");
    if(
StrEqual(AuthID,"ID_LAN")){
        
FriendID[0]='\0';
        return;
    }
    
decl String:toks[3][16];
    
ExplodeString(AuthID,":",toks,3,16);
    new 
iServer=StringToInt(toks[1]);
    new 
iAuthID=StringToInt(toks[2]);
    new 
iFriendID=(iAuthID*2)+7960265728+iServer;
    
Format(FriendID,size,"http://steamcommunity.com/profiles/7656119%d",iFriendID);

Hawkeye- is offline
Timiditas
Senior Member
Join Date: Apr 2009
Old 10-13-2009 , 09:56   Re: Steam Community Profile Viewer
Reply With Quote #23

Attached version of rg_profile uses an available mySQL server connection.
You can specify which section in databases.cfg to use by setting the cvar
rg_profile_db_section. sqllite won't work.

PHP Code:
SELECT CAST(MID('%s'91) AS UNSIGNED) + CAST('76561197960265728' AS UNSIGNED) + CAST(MID('%s'1110) * AS UNSIGNED) AS friend_id 
If you omit the name/userid/steamid and just type !profile, it will open up a menu with a list of all players to select from.
Attached Files
File Type: sp Get Plugin or Get Source (rg_profile_DB.sp - 378 views - 4.5 KB)
__________________

Timiditas is offline
Lethal-
Member
Join Date: Jun 2009
Old 10-13-2009 , 12:27   Re: Steam Community Profile Viewer
Reply With Quote #24

Quote:
Originally Posted by aoHawkeye View Post
Alright, took a quick peak at the code

It looks like the way the URL is being generated, it ALWAYS place 79 as opposed to 80 in the URL and appended the rest, since 79/80 is variable based on the math, I just moved those from static to the math equation side. This 'should' work but I don't have a server to test the code on.
No luck

Using the steamID from above:
Code:
iServer: 0
iAuthID: 24465655
iFriendID: -580737554
Final FriendID: 765611979-580737554
@Timiditas: I'm aware of the SQL method, but is there a way to do it with just SourcePawn?
Lethal- is offline
Timiditas
Senior Member
Join Date: Apr 2009
Old 10-13-2009 , 12:34   Re: Steam Community Profile Viewer
Reply With Quote #25

Quote:
Originally Posted by Lethal- View Post
I'm aware of the SQL method, but is there a way to do it with just SourcePawn?
I dunno. Find a way to do bigint math on two 32bit integers.
__________________

Timiditas is offline
Hawkeye-
Senior Member
Join Date: Jan 2009
Old 10-14-2009 , 03:11   Re: Steam Community Profile Viewer
Reply With Quote #26

I think we are stuck unless we can find a way to handle 64bit integers within Sourcepawn or a Metamod plugin would be a candidate. It seems like a lot of trouble to go though for soemthing that the steam client has somewhat built in. Off the top of my head I can think of a couple different approaches to it, if I find time I will experiment.
Hawkeye- is offline
manofphat
Member
Join Date: Mar 2007
Old 02-07-2010 , 17:27   Re: Steam Community Profile Viewer
Reply With Quote #27

Is it possible to use this to point to a specific Steam Community page for anyone who inputs the command?
manofphat is offline
Alienmario
Senior Member
Join Date: Aug 2013
Old 11-29-2013 , 17:09   Re: Steam Community Profile Viewer
Reply With Quote #28

replacement here.
Alienmario 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 00:23.


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