2015-05-19 93 views
2

我一直在關注Steam文檔,但是我已經到了需要根據蒸汽ID檢索玩家名稱的地步,並且Steam在其文檔中具有此功能:Steam API獲取角色名稱

const char *pchName = SteamFriends()->GetPersonaName(steamID); 

但是Visual Studio認爲沒有這個參數數目的函數。唯一可接受的功能是

const char *pchName = SteamFriends()->GetPersonaName(); 

這應該返回本地播放器的人物角色名稱(它)。我可以設法從每個用戶那裏獲取此信息,並在登錄時將其存儲在我的服務器上,但它確實看起來應該起作用。我該如何獲得朋友的uint64 SteamID的角色名稱?他們最近是否改變了這個功能?

我使用Steam API 1.30從源代碼使用虛幻引擎4.7.6。

回答

2

顯然,Steam在更新他們的文檔時不好。我打開了isteamfriends.h頭,發現這個功能,它永遠不會在蒸汽文檔中提到:

// returns the name another user - guaranteed to not be NULL. 
// same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user 
// note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously 
// 
virtual const char *GetFriendPersonaName(CSteamID steamIDFriend) = 0; 

加油,汽...我硬是直接從他們的活文檔拉此行大約30分鐘前,它不起作用。

const char *pchName = SteamFriends()->GetPersonaName(steamID); 

所以,正確的做法是,然後:

const char *pchName = SteamFriends()->GetFriendsPersonaName(steamID);