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

