koishi-plugin-tmp-bot 1.20.3 → 1.20.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,3 +37,9 @@ export function mileageRankingList(http: any, rankingType: any, tmpId: any): Pro
37
37
  export function mapPlayerHistory(http: any, tmpId: any, serverId: any, startTime: any, endTime: any): Promise<{
38
38
  error: boolean;
39
39
  }>;
40
+ /**
41
+ * 获取 TMP 版本信息
42
+ */
43
+ export function tmpVersion(http: any): Promise<{
44
+ error: boolean;
45
+ }>;
@@ -132,5 +132,27 @@ module.exports = {
132
132
  data.data = result.data;
133
133
  }
134
134
  return data;
135
- }
135
+ },
136
+ /**
137
+ * 获取 TMP 版本信息
138
+ */
139
+ async tmpVersion(http) {
140
+ let result = null;
141
+ try {
142
+ result = await http.get(`${BASE_API}/other/tmpVersion`);
143
+ }
144
+ catch {
145
+ return {
146
+ error: true
147
+ };
148
+ }
149
+ // 拼接返回数据
150
+ let data = {
151
+ error: result.code !== 200
152
+ };
153
+ if (!data.error) {
154
+ data.data = result.data;
155
+ }
156
+ return data;
157
+ },
136
158
  };
@@ -1,3 +1,3 @@
1
- declare function _exports(ctx: any, cfg: any, session: any, tmpId: any): Promise<segment | "渲染异常,请重试" | "未启用 puppeteer 服务" | "请输入正确的玩家编号,或绑定玩家编号" | "查询玩家信息失败,请重试" | "玩家离线">;
1
+ declare function _exports(ctx: any, cfg: any, session: any, tmpId: any): Promise<segment | "渲染异常,请重试" | "未启用 puppeteer 服务" | "请输入正确的玩家编号,或绑定玩家编号" | "查询玩家信息失败,请重试" | "查询玩家位置信息失败,请重试" | "玩家离线">;
2
2
  export = _exports;
3
3
  import { segment } from "@koishijs/core";
@@ -30,7 +30,7 @@ module.exports = async (ctx, cfg, session, tmpId) => {
30
30
  // 查询线上信息
31
31
  let playerMapInfo = await truckyAppApi.online(ctx.http, tmpId);
32
32
  if (playerMapInfo.error) {
33
- return '查询玩家信息失败,请重试';
33
+ return '查询玩家位置信息失败,请重试';
34
34
  }
35
35
  if (!playerMapInfo.data.online) {
36
36
  return '玩家离线';
@@ -1,14 +1,20 @@
1
- const truckersMpApi = require("../api/truckersMpApi");
1
+ const evmOpenApi = require('../api/evmOpenApi');
2
2
  module.exports = async (ctx) => {
3
3
  // 查询版本信息
4
- let result = await truckersMpApi.version(ctx.http);
4
+ let result = await evmOpenApi.tmpVersion(ctx.http);
5
5
  if (result.error) {
6
- return '查询失败,请稍后再试';
6
+ return '查询数据失败,请稍后再试';
7
7
  }
8
8
  // 构建消息返回
9
- let message = '';
10
- message += `TMP版本:${result.data.name}\n`;
11
- message += `欧卡支持版本: ${result.data.supported_game_version}\n`;
12
- message += `美卡支持版本: ${result.data.supported_ats_game_version}`;
9
+ let message = ' 🎮 TMP 插件版本\n';
10
+ message += `◈ 联机插件: ${result.data.tmpVersion}\n`;
11
+ message += `◈ 兼容版本: ${result.data.supportGameVersion}\n`;
12
+ message += `◈ 官方版本: ${result.data.officialGameVersion}\n`;
13
+ if (result.data.supportGameVersion === result.data.officialGameVersion) {
14
+ message += ` 兼容游戏 ✅`;
15
+ }
16
+ else {
17
+ message += ` 兼容游戏 ❌`;
18
+ }
13
19
  return message;
14
20
  };
Binary file
@@ -14,14 +14,14 @@
14
14
  font-family: "微软雅黑", serif;
15
15
  }
16
16
  #container {
17
- width: 500px;
18
- height: 320px;
17
+ width: 720px;
18
+ height: 500px;
19
19
  position: relative;
20
20
  }
21
21
  .map {
22
22
  width: 100%;
23
23
  height: 100%;
24
- background-color: #5d5d5d;
24
+ background: linear-gradient(135deg, #1f2f54, #0f2c2a);
25
25
  }
26
26
  .user-info-box {
27
27
  width: 100%;
@@ -29,7 +29,7 @@
29
29
  position: absolute;
30
30
  bottom: 0;
31
31
  z-index: 999;
32
- background-color: rgba(100, 100, 100, 0.4);
32
+ background-color: rgba(0, 0, 0, 0.4);
33
33
  backdrop-filter: blur(6px);
34
34
  display: flex;
35
35
  flex-direction: row;
@@ -44,23 +44,23 @@
44
44
  }
45
45
  .user {
46
46
  height: 56px;
47
- width: 220px;
47
+ flex: 1;
48
+ margin-left: 10px;
49
+ box-sizing: border-box;
50
+ font-size: 16px;
51
+ color: #eeeeee;
48
52
  display: flex;
49
53
  flex-direction: column;
50
54
  justify-content: center;
51
55
  }
52
- .user {
53
- font-size: 16px;
54
- color: #eeeeee;
55
- margin-left: 10px;
56
- box-sizing: border-box;
57
- }
58
56
  .user .server-name-box {
59
57
  display: flex;
60
58
  align-items: center;
61
59
  margin-top: 4px;
60
+ opacity: 0.85;
62
61
  }
63
62
  .user .username {
63
+ font-weight: 600;
64
64
  white-space: nowrap;
65
65
  overflow: hidden;
66
66
  text-overflow: ellipsis;
@@ -75,7 +75,7 @@
75
75
  box-sizing: border-box;
76
76
  }
77
77
  .location-box {
78
- flex-grow: 1;
78
+ flex: 1;
79
79
  color: #eeeeee;
80
80
  font-size: 16px;
81
81
  height: 56px;
@@ -88,11 +88,17 @@
88
88
  justify-content: center;
89
89
  }
90
90
  .location-box>* {
91
- width: 174px;
91
+ max-width: 100%;
92
92
  white-space: nowrap;
93
93
  overflow: hidden;
94
94
  text-overflow: ellipsis;
95
95
  }
96
+ .location-box .country {
97
+ font-weight: 600;
98
+ }
99
+ .location-box .real-name {
100
+ opacity: 0.85;
101
+ }
96
102
  </style>
97
103
  </head>
98
104
  <body>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-tmp-bot",
3
- "description": "欧洲卡车模拟2 TMP查询插件,不会部署的可以直接使用此机器人->QQ:2364390698",
4
- "version": "1.20.3",
3
+ "description": "欧洲卡车模拟2 TMP查询插件,不会部署的可以直接使用此机器人->QQ:3523283907",
4
+ "version": "1.20.5",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "homepage": "https://github.com/79887143/koishi-plugin-tmp-bot",