FreeKill/docs/misc/server_admin.md
notify 278e7ce4c6
游戏时长统计 (#302)
* 修复和完善qml mark
* 修复国战野心家放副将
* [需要编译] 统计游戏时长功能
* 后台也开始记录注册时间和上次上线的时间
* 现在会将屏蔽玩家保存到本地并标红提示
2023-12-28 12:11:24 +08:00

24 lines
972 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

服主小技巧
=====================
本文件夹下的 calcDailyLogin.sh 是统计日活的脚本,可以将其设为定时任务。
注意时不时备份数据库。数据库只是单个sqlite文件而已直接cp即可。
使用sqlite命令行之前可以使用.mode markdown命令将sqlite输出设为markdown格式方便复制粘贴到配置中。
常用sql语句
-----------------
```sql
-- 统计某个模式胜率前20名的玩家
SELECT * FROM playerWinRate WHERE mode="m_1v2_mode" AND total > 400 ORDER BY winRate DESC LIMIT 20;
-- 统计某个模式胜率前20名的武将
SELECT * FROM generalWinRate WHERE mode="m_1v2_mode" AND total > 400 ORDER BY winRate DESC LIMIT 20;
-- 统计游玩时长排行
SELECT usergameinfo.id, totalGameTime AS 'Time (sec)', round(totalGameTime/3600.0, 2)||" h" AS ' ', name AS Name FROM usergameinfo, userinfo WHERE userinfo.id = usergameinfo.id GROUP BY usergameinfo.id ORDER BY totalGameTime DESC LIMIT 10;
```