File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ push.push_qq_groups=12345678
86
86
| /addmessagecard | player=0&card=1&colors=0&count=1 | 其中player参数对应** 服务器中的** 玩家Id,card参数对应协议中的卡牌类型,colors参数对应协议中的卡牌颜色,count参数(非必填,默认1)为增加卡牌的个数 |
87
87
| /addrobot | count=1 | 其中count参数对应想要增加机器人的个数,不填表示加满 |
88
88
| /getscore | name=aaa | 其中name参数是想要获取分数的玩家名字 |
89
+ | /getlasttime | name=aaa | 获取最近一次游戏距离现在的时间,其中name参数是想要获取分数的玩家名字 |
89
90
| /ranklist | 无 | 获取排行榜 |
90
91
| /resetpwd | name=aaa | 其中name参数是想要重置密码的玩家名字(重置为空,玩家可以自行重新设置) |
91
92
| /forbidrole | name=aaa | 禁用角色,禁用的角色不会再出现在角色池里,其中name参数是想要禁用的中文角色名 |
@@ -101,6 +102,7 @@ push.push_qq_groups=12345678
101
102
| /winrate | 无 | 返回一张胜率统计的png图片 |
102
103
| /resetseason | 无 | 重置赛季,重置前请手动备份PlayerInfo.csv |
103
104
| /addenergy | name=aaa&energy=1 | 增加精力 |
105
+ | /getallgames | 无 | 获取所有房间的状态 |
104
106
105
107
## 把战绩推送到QQ群
106
108
Original file line number Diff line number Diff line change
1
+ package com.fengsheng.gm
2
+
3
+ import com.fengsheng.Statistics
4
+ import java.util.function.Function
5
+
6
+ class Getlasttime : Function <Map <String , String >, Any > {
7
+ override fun apply (form : Map <String , String >): Any {
8
+ return try {
9
+ val name = form[" name" ]!!
10
+ val playerInfo = Statistics .getPlayerInfo(name)
11
+ if (playerInfo == null || playerInfo.score <= 0 ) " {\" result\" : 0}"
12
+ else " {\" result\" : \" ${System .currentTimeMillis() - playerInfo.lastTime} \" }"
13
+ } catch (e: NullPointerException ) {
14
+ " {\" error\" : \" 参数错误\" }"
15
+ }
16
+ }
17
+ }
You can’t perform that action at this time.
0 commit comments