gpt4 book ai didi

c# - 如何获得用户玩我的游戏花了多少小时? Steamworks API

转载 作者:行者123 更新时间:2023-12-04 17:49:59 25 4
gpt4 key购买 nike

如何获取用户玩我的游戏所花费的时间?在 Unity 中使用 Steamworks API 和 C#。我浏览了一份文档,但没有找到类似的东西,并认为我遗漏了一些东西。

我本应该使用一个简单的脚本来记录自己游戏中的上场时间,但为时已晚。如果有人能给我一击或指出正确的方向,我将不胜感激。

最佳答案

您可能仍有机会让它发挥作用。据我所知,有一种方法可以通过使用已弃用的 Community XML Data 来获取总播放时间(如 Gameplay stats 所示) :

Player Game Stats

To retrieve game stats, you will need the game's Steam Community name. Developers can contact Valve to obtain the community name for their game.

You can retrieve stats and achievements for a player per game using the player's 64-bit Steam ID with: Format: http://steamcommunity.com/profiles/[SteamID]/stats/[CommunityGameName]/?xml=1

Example: http://steamcommunity.com/profiles/76561197968575517/stats/L4D/?xml=1

在示例中,您可以在图像底部看到 hoursPlayed 字段:

hoursPlayed field

现在,问题显然是这已被弃用,Steam 建议您尽可能使用 Web API。但是,我还没有找到通过 Web API 访问此数据的方法,因此我认为这是最好的选择,无需推出自定义的播放时间跟踪方式。

关于c# - 如何获得用户玩我的游戏花了多少小时? Steamworks API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45764769/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com