If you're making any kind of player database though I'd go ahead and use the
64 bit ID's, that way if valve ever changes the STEAM_x:y:z format in the
future your stuff will work without making any modifications.

I don't use the STEAM_ id's anymore for anything big.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Tony Paloma
Sent: Monday, January 18, 2010 11:29 AM
To: 'Discussion of Half-Life Programming'
Subject: Re: [hlcoders] How to find SteamID

I'd prefer:
uint32 accountId = sid.GetAccountID();

char text[255];
Q_snprintf(text, 255, "STEAM_0:%d:%d\n", accountId & 0x01, accountId >> 1);
// Alternatively:
// Q_snprintf(text, 255, "STEAM_0:%d:%d\n", accountId % 2, accountId / 2);

I think I mentioned this earlier in the thread.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Mark Chandler
Sent: Monday, January 18, 2010 1:18 AM
To: Discussion of Half-Life Programming
Subject: Re: [hlcoders] How to find SteamID

If you use steam_api.lib from the sdk and steam_api.dll you can get it 
this way:


#include "steam/steam_api.h"
#include "steam/isteamuser.h"
#include "steam/steamclientpublic.h"

     SteamAPI_InitSafe();

     CSteamAPIContext cc;
     cc.Init();
     ISteamUser *user = cc.SteamUser();

     if (user)
     {
         CSteamID  sid = user->GetSteamID();

         uint64 scid = sid.ConvertToUint64();

         bool srv = scid % 2;
         int auth = ((scid - srv) - 76561197960265728) / 2;

         char text[255];
         Q_snprintf(text, 255, "STEAM_0:%d:%d\n", srv, auth);
    }


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to