Имя счета
Получение имени учетной записи трудно, так как не существует функции API, насколько я знаю.
Но есть SteamAppData.vdf
файл в папке <SteamInstallPath>/config
, которая выглядит примерно так:
"SteamAppData"
{
"RememberPassword" "<0|1>"
"AutoLoginUser" "<accountName>"
}
Вы можете получить Паровой путь установки с SteamAPI_GetSteamInstallPath()
командой, определенной в steam_api.h
.
Затем вы можете прочитать файл и извлечь из него имя учетной записи.
Имя игрока
Получение имени игрока очень просто:
В isteamfriends.h
вы должны найти этот метод:
// 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;
Так SteamFriends.GetPersonaName()
должен дать вам имя игрока.