用户如何花了几个小时玩我的游戏? Steamworks API [英] How to get how many hours has users spent playing my game? Steamworks API

查看:213
本文介绍了用户如何花了几个小时玩我的游戏? Steamworks API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获得用户花了多少小时玩我的游戏?在Unity中使用Steamworks API和C#.我浏览了一个文档,但没有找到类似的东西,并以为我错过了一些东西.

How to get how many hours has users spent playing my game? Using Steamworks API and C# in Unity. I have went through a documentation but haven't found anything like that, and thinking that I am missing something.

我本应该使用一个简单的脚本记录自己游戏中的分钟记录,但是为时已晚.如果有人可以给我一个成功的机会或为我指明正确的方向,我将不胜感激.

I should've just went with a simple script that logs minutes played in its own game, but it's too late for that. If anyone can give me a hit or point me a right direction, I'd really appreciate it.

推荐答案

您仍然可以使用它.据我所知,有一种方法可以使用已弃用的

You might still have a chance to get it to work. As far as I know, there's a way to get the total hours played (as shown in the Gameplay stats) by using the deprecated Community XML Data:

玩家游戏统计

要获取游戏统计信息,您需要使用游戏的 Steam社区名称.开发人员可以联系Valve以获取 他们的游戏的社区名称.

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.

您可以使用来检索每场比赛的球员的统计数据和成就 播放器的64位Steam ID,格式为: http://steamcommunity.com/profiles/[SteamID]/stats/[CommunityGameName]/?xml = 1

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

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

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

In the example you can see the hoursPlayed field on the bottom of the image:

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

Now, the problem obviously is that this is deprecated and Steam advices you to use the web APIs whenever possible. However, I haven't seen a way to access this data through the web API so I think that this is your best bet without rolling out a custom way of tracking playtime.

这篇关于用户如何花了几个小时玩我的游戏? Steamworks API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆