How to retrieve Steam username using SteamWorks API? -


how can obtain steam username of used (logged-in) account in application using steam api (which , running).

the steam id can (for example) obtained by:

csteamid id = steamuser.getsteamid(); 

but cannot find method obtain username.

account name

getting account name difficult there no api function far know.
there steamappdata.vdf file in <steaminstallpath>/config folder looks similar this:

"steamappdata" {     "rememberpassword"  "<0|1>"     "autologinuser"     "<accountname>" } 

you can steam install path steamapi_getsteaminstallpath() command defined in steam_api.h.
can read file , extract account name out of it.

player name

getting player name easy:

in isteamfriends.h you'll should find method:

// returns local players name - guaranteed not null. // same name on users community profile page // stored in utf-8 format // other interface functions return char *, it's important pointer not saved // off; free'd or re-allocated virtual const char *getpersonaname() = 0; 

so steamfriends.getpersonaname() should give player name.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -