Steam API获取角色名称
Steam API getting persona name
我一直在遵循Steam文档,但我已经到了我需要根据Steam ID检索玩家名称的地步,Steam在他们的文档中有一个功能:
const char *pchName = SteamFriends()->GetPersonaName(steamID);
但是Visual Studio说没有函数有那么多的参数。唯一可以接受的函数是
const char *pchName = SteamFriends()->GetPersonaName();
应该返回本地玩家的角色名称(它确实如此)。我可以让每个用户得到这个方法,并在登录时将其存储在我的服务器上,但这似乎应该起作用。我怎么能得到一个朋友的uint64 SteamID的角色名?他们最近改变这个功能了吗?
我使用虚幻引擎4.7.6从源与Steam API 1.30。
显然Steam不擅长更新他们的文件。我打开了isteamfriends.h
头文件,发现了这个在Steam文档中从未提到的函数:
// 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;
拜托,Steam…大约30分钟前,我直接从他们的实时文档中引用了这句话,但它不起作用。
const char *pchName = SteamFriends()->GetPersonaName(steamID);
所以正确的方法是:
const char *pchName = SteamFriends()->GetFriendsPersonaName(steamID);
相关文章:
- C++为构建时间获取QDateTime的可靠方法
- lambda参数转换为constexpr技巧,然后获取带链接的数组
- 如何使用 < 和 > 命令获取 c++ 中的输入和输出?
- 使用指针从C++中的数组中获取最大值
- 如何获取std::result_of函数的返回类型
- 如何在openssl-ecc中获取十六进制格式的私钥
- 使用Unreal C++获取VR耳机的世界位置/方向
- 获取日期异步信号安全吗?如果在信号处理程序中使用,它会导致死锁吗
- 从C字符串中获取奇怪的字符串长度
- 为什么我的for循环不能正确获取argv
- 从python中调用C++函数并获取返回值
- 如何获取一个数字的前3位
- 获取字符串的长度并将其分配给数组
- 无法获取菜单选择以运行函数.C++
- 数组长度,为什么从命令行获取时不能使用它?
- Boost Spirit,获取迭代器内部语义动作
- 尝试通过OCI例程从Oracle获取blob数据,但出现错误:ORA-01008:并非所有变量都绑定
- 具有默认值的引用获取函数
- 如何从刺痛角色中获取不同的字符串
- Steam API获取角色名称