This probably isn't useful to anyone, but I had to get the SteamID of other
players clientside - and couldn't find a way to do it (without networking
them from server)

But eventually I found a way to convert the FriendsID to a SteamID..

const char* C_GMOD_Player::GetNetworkIDString()
{
if ( !engine->GetPlayerInfo( entindex(), &m_SavedPlayerInfo ) )
{
return "NULL";
}

if ( !m_SavedPlayerInfo.friendsID )
return "NULL";

Q_snprintf( m_SavedPlayerInfo.guid, sizeof( m_SavedPlayerInfo.guid ) - 1,
"STEAM_0:%u:%u",
(unsigned int)(m_SavedPlayerInfo.friendsID % 2),
(unsigned int)(m_SavedPlayerInfo.friendsID / 2));

return m_SavedPlayerInfo.guid;
}

garry

On Mon, Jan 4, 2010 at 9:31 PM, Tony Paloma <[email protected]> wrote:

> Well as long as we're coming up with alternatives:
>  - Read HKEY_CURRENT_USER\Software\Valve\Steam\LastGameNameUsed
>  - Enumerate HKEY_CURRENT_USER\Software\Valve\Steam\Users for a matching
> friends\PersonaName value
>   - The keys under Users are account IDs. You can use them to get a
> SteamID.
>
> Infallible? Hardly. But it's the best out-of-game, no-steam-dlls solution I
> could come up with besides mucking around in the blob file.
>
> If you know where Steam is installed
> (HKEY_CURRENT_USER\Software\Valve\Steam\SteamPath), you can load
> steamclient.dll and get the SteamID easy. If you want more details, reply
> and ask.
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Darien Hager
> Sent: Monday, January 04, 2010 1:06 PM
> To: Discussion of Half-Life Programming
> Subject: Re: [hlcoders] How to find SteamID
>
> Just to toss out an alternative... I think the "current user name" is
> probably somewhere in the clientregistry.blob file after the user is
> logged-in... but parsing that thing directly isn't very fun and likely
> won't be as stable making your own exe/dll. (I'm working on phasing out
> some clientregistry-using code for those reasons.)
>
> --Darien
>
> Alexander Hirsch wrote:
> > It does work. I did some stuff with that already.
> > The code down there is just on top of my head though. Still, should
> > work like that.
> >
> >
>
>
> _______________________________________________
> 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