Playtime Logger Mod
用途
如果你曾遇到过监控服务器活动的难题,那么这款模组或许会引起你的兴趣。
本模组利用 Google Spreadsheets API 自动记录每位玩家的登录和登出信息,计算各自的会话时长,并以简洁便捷的方式展示这些数据。
设置
- 下载并将此模组安装到你的专用服务器上。
- 目前,你可以参考以下教程:
- 点击链接并创建新项目
- 启用该 API
- 创建 OAuth 同意屏幕并设置外部用户类型。完成后,你可以在测试环境中使用该项目。
- 别忘了添加权限范围 "./auth/spreadsheets"
- 下载生成的 OAuth 客户端配置文件(json 格式)。
- 将其重命名为 "credentials.json" 并放入 "/config/playtimelogger/" 目录中(如果你的服务器已启动,该目录应该已经存在)。
- 重启服务器。如果一切正常,你将在服务器控制台中看到提示,要求你点击链接并完成授权。请按照链接指引,使用你创建的 Google 项目进行授权。Playtime Logger 将使用这些凭据来生成和更新电子表格。
用法
初始化成功后,即可开始追踪玩家的游戏时长活动。前往 Google Spreadsheets,使用你的 Google 账户登录,并搜索名为 “Playtime Logger” 的电子表格(如果你在配置文件中修改了名称,则显示的名称也会不同)。
你将看到两个工作表:
- 第一个默认名为 “Total Playtime”。从中可以看到自安装模组以来访问过服务器的所有唯一玩家。
这里会显示玩家的名字、UUID(适用于离线模式服务器)、指定时间段内的游戏时长以及最后登录日期。
- 第二个默认名为 “Logs”。这里记录了每位玩家单独的登录和登出事件。这些事件以时间戳(秒级)、日期(通过 =EPOCHTODATE 公式转换)以及以秒为单位的会话时长进行描述。
许可证
本项目采用 MIT 许可证。欢迎学习借鉴,并将其整合到你自己的项目中。
Playtime Logger Mod
Purpose
If you ever encountered a problem with monitoring your server's activity, you might be interested in this modification.
This mod uses Google Spreadsheets API to automatically log every player's logins and logouts, calculates individual session timeframes and shows this information in an easy and comfort way.
Setup
- Download and install this mod on your dedicated server.
- For now, you can follow this tutorial
- Follow the link and create new Project
- Enable the API
- Create OAuth consent screen and setup External user type. After that, you can use this project in the testing environment.
- Don't forget to add scope "./auth/spreadsheets"
- Download your generated OAuth client as a json file.
- Rename it to "credentials.json" and put this file to "/config/playtimelogger/" (if you have started your server, this directory should already exist)
- Restart your server. If everything works correctly, you will be prompted to follow the link in your server console. Follow the link and authorize with Google project that you created. Your credentials will be used by Playtime Logger to generate and update spreadsheet.
Usage
After successful initialization you can start tracking your players' playtime activity. Go to the Google Spreadsheets, authorize with your Google account and search for "Playtime Logger" spreadsheet (the name might be different if you replaced it in the config file).
There you will see two sheets:
- First one, by default, is called "Total Playtime". There you will see all unique players that visited your server starting from the moment you installed the mod.
There you will see players' names, UUIDs (for servers in offline mode), playtime for specified period and last login date.
- The second sheet is called "Logs" by default. There you will see individual logins and logouts of every player. Those events are described by Epochs (in seconds), Dates (using =EPOCHTODATE formula), and session playtime in seconds.
License
This project is available under the MIT license. Feel free to learn from it and incorporate it in your own projects.
评论 0
登录后参与评分
还没有评论,来抢沙发吧