steam


How to retrieve Steam username using SteamWorks API?


How can I obtain the Steam username of the currently used (logged-in) account in my application using the Steam API (which is up and running).
The Steam id can (for example) be obtained by:
CSteamID id = SteamUser.GetSteamID();
But I cannot find a method to obtain the username.
Account Name
Getting the account name is difficult as there is no API function as far as I know.
But there is a SteamAppData.vdf file in the <SteamInstallPath>/config folder which looks similar to this:
"SteamAppData"
{
"RememberPassword" "<0|1>"
"AutoLoginUser" "<accountName>"
}
You can get the Steam install path with the SteamAPI_GetSteamInstallPath() command defined in steam_api.h.
Then you can read the file and extract the account name out of it.
Player Name
Getting the player name is really easy:
In isteamfriends.h you'll should find this method:
// returns the local players name - guaranteed to not be NULL.
// this is the same name as on the users community profile page
// this is stored in UTF-8 format
// like all the other interface functions that return a char *, it's important that this pointer is not saved
// off; it will eventually be free'd or re-allocated
virtual const char *GetPersonaName() = 0;
So SteamFriends.GetPersonaName() should give you the player name.

Related Links

API Steam - Account not found
How to get the steam IDs of users on a Source server
Get Strange kills (TF2 + steam API
Get link from “Join Game” in Steam
Steam API Get steam level of user?
Get Global Stats CSGO via steam web api
How to retrieve Steam username using SteamWorks API?
How to get steam items names?
Retrieve announcements from steam group
Steam: How retrieve game scheme data?
SteamID64 minimum and maximum length
IEconItems_730 api no longer working
Steam market API returns null
How to get the float value of CS:GO market items?
Using steam web api to access how many times players are reported for hacking
Steam game positive/negative recommendations

Categories

HOME
json
converter
dotnetrdf
ajax
udp
winapi
rotation
scipy
computer-vision
search-engine
laravel-4
defragmentation
algorithmic-trading
xcode8.3
wicket
public-key-encryption
viber
react-leaflet
postmessage
apache-karaf
redux-observable
google-openid
rails-activerecord
apple-tv
avplayeritem
kitematic
servicemix
memsql
shopping-cart
visual-c++-2017
net-snmp
upnp
positioning
pygooglechart
hawtio
ocs
mapguide
ios-ui-automation
windows-10-iot-core
rider
nlb
infusionsoft
restful-url
html-agility-pack
spring-bean
drawingarea
defold
httplib2
autoresize
laravel-query-builder
garrys-mod
coremidi
glkit
gameanalytics
foxit
listadapter
supportmapfragment
twgl.js
sevenzipsharp
grunt-contrib-concat
ghostdoc
wss
lumx
voldemort
late-static-binding
db4o
edit-in-place
windows-mobile-6
sslexception
leptonica
ng-pattern
zend-lucene
reporting-tools
snapjs
trailing-slash
cadisplaylink
scrollto
supersized
wchar
cookieless
out-of-browser
boost-date-time
web-statistics
opcodes
handheld
msf

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App