Yes this is possible. Get the steamid by
typedef unsigned __int32 HSteamPipe;
typedef unsigned __int32 HSteamUser;
typedef unsigned __int32 uint32;
typedef unsigned __int16 uint16;
typedef unsigned __int64 uint64;
typedef UINT64 (*pfnGetUserSteamID)(void *phSteamHandle);
typedef void *(*pfnSteam_GetGSHandle)(HSteamUser hUser, HSteamPipe
hSteamPipe);
typedef HSteamUser (*pfnSteam_CreateGlobalUser)(HSteamPipe *phSteamPipe);
typedef HSteamPipe (*pfnSteam_CreateSteamPipe)(void);
typedef void (*pfnSteam_ReleaseUser)(HSteamPipe hSteamPipe, HSteamUser
hUser);
typedef BOOL (*pfnSteam_BReleaseSteamPipe)(HSteamPipe hSteamPipe);
pfnGetUserSteamID GetUserSteamID;
pfnSteam_GetGSHandle GetSteamHandle;
pfnSteam_CreateGlobalUser CreateGlobalUser;
pfnSteam_CreateSteamPipe CreateSteamPipe;
pfnSteam_ReleaseUser ReleaseUser;
pfnSteam_BReleaseSteamPipe ReleaseSteamPipe;
int main() {
UINT64 uiSteamID;
HINSTANCE SteamClientLibrary;
HSteamUser hSteamUser;
HSteamPipe hPipe;
void *hSteam;
BOOL ret;
SteamClientLibrary = LoadLibrary("steamclient.dll");
if ( SteamClientLibrary != 0 ) {
printf("[steamclient.dll] loaded successfully ...\n");
}
else {
printf("[steamclient.dll] failed to load ...\n");
return 1;
}
CreateSteamPipe =
(pfnSteam_CreateSteamPipe)GetProcAddress(SteamClientLibrary,
"Steam_CreateSteamPipe");
CreateGlobalUser =
(pfnSteam_CreateGlobalUser)GetProcAddress(SteamClientLibrary,
"Steam_CreateGlobalUser");
GetSteamHandle =
(pfnSteam_GetGSHandle)GetProcAddress(SteamClientLibrary,
"Steam_GetGSHandle");
GetUserSteamID = (pfnGetUserSteamID)GetProcAddress(SteamClientLibrary,
"Steam_GSGetSteamID");
ReleaseUser = (pfnSteam_ReleaseUser)GetProcAddress(SteamClientLibrary,
"Steam_ReleaseUser");
ReleaseSteamPipe =
(pfnSteam_BReleaseSteamPipe)GetProcAddress(SteamClientLibrary,
"Steam_BReleaseSteamPipe");
//----------------------------
// uint64 Steam_GSGetSteamID(void *phSteamHandle)
//-----------------------------------------------
// It would appear that the return value is
// the numerical value of the SteamID * 2.
//
hPipe = CreateSteamPipe();
if (hPipe) {
printf("Steam_CreateSteamPipe returned [%i]\n", hPipe);
hSteamUser = CreateGlobalUser(&hPipe);
if (hSteamUser) {
printf("Steam_CreateGlobalUser returned [%i]\n", hSteamUser);
hSteam = GetSteamHandle(hSteamUser, hPipe);
if (hSteam!=NULL) {
printf("Recieved handle [%i]\n", hSteam);
uiSteamID = GetUserSteamID(hSteam);
printf("Steam_GSGetSteamID returned [%i]\n", uiSteamID);
printf("SteamID for current user is [%i]\n",
(((int)uiSteamID) / 2));
SetFromUint64( uiSteamID );
ReleaseUser( hPipe, hSteamUser );
ret = ReleaseSteamPipe( hPipe );
printf("ReleaseSteamPipe returned [%i]\n", ret);
FreeLibrary(SteamClientLibrary);
}
else {
ReleaseUser( hPipe, hSteamUser );
ReleaseSteamPipe( hPipe );
FreeLibrary(SteamClientLibrary);
return 1;
}
}
else {
ReleaseSteamPipe( hPipe );
FreeLibrary(SteamClientLibrary);
return 1;
}
}
return 0;
}
I know this can be done using the steamapi lib but when i wrote this i wasnt
aware of its existence.
hope this helps
On Wed, Jun 4, 2008 at 6:26 AM, Spencer 'voogru' MacDonald <
[EMAIL PROTECTED]> wrote:
> You can use the Steam Client API to get their FriendID, which converts to
> their STEAM ID, this would be implemented on the client.
>
> Then for the server end you put some protection there as well.
>
> - voogru.
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of vivoli
> Sent: Tuesday, June 03, 2008 6:01 PM
> To: Discussion of Half-Life Programming
> Subject: Re: [hlcoders] Limiting access by Steam ID
>
> You can't because in LAN (or localhost), the SteamID is STEAM_PENDING.
> So you can't limiting access by SteamID.
>
>
> > Nuclear Dawn does something like this, with Steam ID's as far as I know.
> > I
> > imagine a good place would be the DLL's init function (server & client?).
> >
> > That's my best guess.
> >
> > /ScarT
> >
> >
> > On 03/06/2008, Spencer 'voogru' MacDonald <[EMAIL PROTECTED]> wrote:
> >>
> >> This is your best bet.
> >>
> >> -----Original Message-----
> >> From: [EMAIL PROTECTED]
> >> [mailto:[EMAIL PROTECTED] On Behalf Of Adam
> Maras
> >> (memzero)
> >> Sent: Tuesday, June 03, 2008 5:17 PM
> >> To: 'Discussion of Half-Life Programming'
> >> Subject: Re: [hlcoders] Limiting access by Steam ID
> >>
> >> Could you invite the testers to a private Steam Communities group and
> >> hard-code the group ID into the mod instead? Then, simply use the Steam
> >> API
> >> to check for membership in that group.
> >>
> >> // Adam Maras (memzero)
> >>
> >> -----Original Message-----
> >> From: [EMAIL PROTECTED]
> >> [mailto:[EMAIL PROTECTED] On Behalf Of Jed
> >> Sent: Tuesday, June 03, 2008 2:04 PM
> >> To: Discussion of Half-Life Programming
> >> Subject: [hlcoders] Limiting access by Steam ID
> >>
> >> I know this is going to be a controversial subject but bear with me.
> >>
> >> I was asked by one of our Mod team if it would be possible for the
> >> internal beta version to lock them so that they could only be played
> >> by certain people. As we use SVN to allow testers to download/update
> >> the various builds it's percieveable they could give/share their SVN
> >> info and others could happily leech off it.
> >>
> >> The idea was to hard code a list of steam ID's into the DLLs for the
> >> duration of testing and basically refuse to load the game if you're
> >> not on the list. We're not thinking just stopping people joining games
> >> but actually stopping them completely so they can't make local listen
> >> or LAN servers.
> >>
> >> I've never gone this deep into the whole Steam side of things for
> >> getting ID's or where would be a suitable or safe place to put the
> >> check/reject code.
> >>
> >> Thoughts? Suggestions?
> >>
> >> - Jed
> >>
> >> P.S. We're a EP1 mod.
> >>
> >> _______________________________________________
> >> 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
> >>
> >>
> > _______________________________________________
> > To unsubscribe, edit your list preferences, or view the list archives,
> > please visit:
> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >
>
>
>
> --
> Utilisant le client e-mail révolutionnaire d'Opera :
> http://www.opera.com/mail/
>
> _______________________________________________
> 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