2015-05-19 87 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);