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

[EXTENSION] CSteamID - SteamIDs as 64bit integers


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 02-19-2009 , 13:22   [EXTENSION] CSteamID - SteamIDs as 64bit integers
Reply With Quote #1

CSteamID
v1.0.1

Description:
Provides some native functions for converting to and from SteamIDs stored as 64-bit integers.

Natives:
PHP Code:
/**
 * Gives the 64-bit int SteamID for a client
 *
 * @param client        Client index of the player.
 * @param buffer        Destination string buffer.
 * @param maxlength     Maximum length of output string buffer.
 * @return              True on success, false on invalid client index or failure to find edict index.
 */
native bool:GetClientCSteamID(clientString:buffer[], maxlength);

/**
 * Given a 64-bit int SteamID, gives the SteamID associated with it
 *
 * @param input         64-bit integer stored in a string
 * @param buffer        Destination string buffer for the SteamID.
 * @param maxlength     Maximum length of the output string buffer.
 * @return              True on success, false on invalid input string.
 */
native bool:CSteamIDToSteamID(String:input[], String:buffer[], maxlength);

/**
 * Given a SteamID, gives the 64-bit int SteamID associated with it
 *
 * @param input         SteamID stored in a string
 * @param buffer        Destination string buffer for the 64-bit int SteamID.
 * @param maxlength     Maximum length of the output string buffer.
 * @return              True on success, false on invalid SteamID.
 */
native bool:SteamIDToCSteamID(String:input[], String:buffer[], maxlength); 
Notes:
  • I call the 64bit int representation of a SteamID a CSteamID. Anywhere you see CSteamID, you can know that it's the 64bit int version.
  • A 64bit int SteamID is the same as a Steam Community friend ID.
  • As long as Valve keeps the functions used in this extension in their code, the 64bit int SteamIDs will outlast any changes done to normal SteamIDs (for example how they just changed from STEAM_0 to STEAM_1 and then back again).
  • GetClientCSteamID can be called before a player authorizes to the server. This means that during OnClientConnect you can grab their CSTeamID, and then convert that to their SteamID, and essentially get it before you normally could without this extension.
  • This extension will only work for OB mods. I tested on TF2, but it should work fine on DOD:S and any other OB mod.
Thanks to:
  • voogru - He's the inspiration behind this extension, and helped a ton during the process. Thanks for putting up with my bullshit the whole time. :]
  • Nephyrin - Some small help with casting types and such.
  • Valve - For screwing us over too many times to count.
Changelog:
  • 1.0.1
    • Added a check to see if steamID is NULL.
Download:
http://forums.alliedmods.net/showthr...52#post1800652

Last edited by bl4nk; 09-16-2012 at 21:30.
bl4nk is offline
 



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:36.


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