koishi-plugin-tmp-bot 1.19.4 → 1.20.0
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.
- package/lib/api/evmOpenApi.js +1 -136
- package/lib/api/truckersMpApi.js +1 -110
- package/lib/api/truckersMpMapApi.js +1 -25
- package/lib/api/truckyAppApi.js +1 -47
- package/lib/command/tmpBind.js +1 -19
- package/lib/command/tmpDlcMap.js +1 -33
- package/lib/command/tmpFootprint.d.ts +1 -1
- package/lib/command/tmpFootprint.js +1 -68
- package/lib/command/tmpMileageRanking.js +1 -55
- package/lib/command/tmpPosition.js +1 -95
- package/lib/command/tmpQuery/tmpQuery.js +1 -12
- package/lib/command/tmpQuery/tmpQueryImg.js +1 -103
- package/lib/command/tmpQuery/tmpQueryText.js +1 -118
- package/lib/command/tmpServer.js +1 -34
- package/lib/command/tmpTraffic/tmpTraffic.js +1 -15
- package/lib/command/tmpTraffic/tmpTrafficMap.js +1 -119
- package/lib/command/tmpTraffic/tmpTrafficText.js +1 -58
- package/lib/command/tmpVersion.js +1 -14
- package/lib/database/guildBind.js +1 -41
- package/lib/database/model.js +1 -65
- package/lib/database/translateCache.js +1 -31
- package/lib/index.js +1 -55
- package/lib/resource/dlc.html +1 -30
- package/lib/resource/footprint.html +1 -125
- package/lib/resource/mileage-leaderboard.html +1 -174
- package/lib/resource/package/ets-map.js +1 -63
- package/lib/resource/package/leaflet/heatmap.min.js +1 -9
- package/lib/resource/package/leaflet/leaflet-heatmap.js +1 -246
- package/lib/resource/package/leaflet/leaflet.min.js +1 -1
- package/lib/resource/position.html +1 -105
- package/lib/resource/query.html +1 -137
- package/lib/resource/traffic.html +1 -121
- package/lib/util/baiduTranslate.js +1 -30
- package/lib/util/common.js +1 -5
- package/lib/util/constant.d.ts +4 -0
- package/lib/util/constant.js +1 -29
- package/package.json +1 -2
package/lib/api/evmOpenApi.js
CHANGED
|
@@ -1,136 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
module.exports = {
|
|
3
|
-
/**
|
|
4
|
-
* 查询服务器列表
|
|
5
|
-
*/
|
|
6
|
-
async serverList(http) {
|
|
7
|
-
let result = null;
|
|
8
|
-
try {
|
|
9
|
-
result = await http.get(`${BASE_API}/server/list`);
|
|
10
|
-
}
|
|
11
|
-
catch {
|
|
12
|
-
return {
|
|
13
|
-
error: true
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
// 拼接返回数据
|
|
17
|
-
let data = {
|
|
18
|
-
error: result.code !== 200
|
|
19
|
-
};
|
|
20
|
-
if (!data.error) {
|
|
21
|
-
data.data = result.data;
|
|
22
|
-
}
|
|
23
|
-
return data;
|
|
24
|
-
},
|
|
25
|
-
/**
|
|
26
|
-
* 查询在线玩家
|
|
27
|
-
*/
|
|
28
|
-
async mapPlayerList(http, serverId, ax, ay, bx, by) {
|
|
29
|
-
let result = null;
|
|
30
|
-
try {
|
|
31
|
-
result = await http.get(`${BASE_API}/map/playerList?aAxisX=${ax}&aAxisY=${ay}&bAxisX=${bx}&bAxisY=${by}&serverId=${serverId}`);
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return {
|
|
35
|
-
error: true
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
// 拼接返回数据
|
|
39
|
-
let data = {
|
|
40
|
-
error: result.code !== 200
|
|
41
|
-
};
|
|
42
|
-
if (!data.error) {
|
|
43
|
-
data.data = result.data;
|
|
44
|
-
}
|
|
45
|
-
return data;
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* 查询玩家信息
|
|
49
|
-
*/
|
|
50
|
-
async playerInfo(http, tmpId) {
|
|
51
|
-
let result = null;
|
|
52
|
-
try {
|
|
53
|
-
result = await http.get(`${BASE_API}/player/info?tmpId=${tmpId}`);
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
return {
|
|
57
|
-
error: true
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
// 拼接返回数据
|
|
61
|
-
let data = {
|
|
62
|
-
code: result.code,
|
|
63
|
-
error: result.code !== 200
|
|
64
|
-
};
|
|
65
|
-
if (!data.error) {
|
|
66
|
-
data.data = result.data;
|
|
67
|
-
}
|
|
68
|
-
return data;
|
|
69
|
-
},
|
|
70
|
-
/**
|
|
71
|
-
* DLC列表
|
|
72
|
-
*/
|
|
73
|
-
async dlcList(http, type) {
|
|
74
|
-
let result = null;
|
|
75
|
-
try {
|
|
76
|
-
result = await http.get(`${BASE_API}/dlc/list?type=${type}`);
|
|
77
|
-
}
|
|
78
|
-
catch (e) {
|
|
79
|
-
return {
|
|
80
|
-
error: true
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
// 拼接返回数据
|
|
84
|
-
let data = {
|
|
85
|
-
error: result.code !== 200
|
|
86
|
-
};
|
|
87
|
-
if (!data.error) {
|
|
88
|
-
data.data = result.data;
|
|
89
|
-
}
|
|
90
|
-
return data;
|
|
91
|
-
},
|
|
92
|
-
/**
|
|
93
|
-
* 玩家里程排行
|
|
94
|
-
*/
|
|
95
|
-
async mileageRankingList(http, rankingType, tmpId) {
|
|
96
|
-
let result = null;
|
|
97
|
-
try {
|
|
98
|
-
result = await http.get(`${BASE_API}/statistics/mileageRankingList?rankingType=${rankingType}&tmpId=${tmpId || ''}&rankingCount=10`);
|
|
99
|
-
}
|
|
100
|
-
catch (e) {
|
|
101
|
-
return {
|
|
102
|
-
error: true
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
// 拼接返回数据
|
|
106
|
-
let data = {
|
|
107
|
-
error: result.code !== 200
|
|
108
|
-
};
|
|
109
|
-
if (!data.error) {
|
|
110
|
-
data.data = result.data;
|
|
111
|
-
}
|
|
112
|
-
return data;
|
|
113
|
-
},
|
|
114
|
-
/**
|
|
115
|
-
* 查询玩家历史数据
|
|
116
|
-
*/
|
|
117
|
-
async mapPlayerHistory(http, tmpId, serverId, startTime, endTime) {
|
|
118
|
-
let result = null;
|
|
119
|
-
try {
|
|
120
|
-
result = await http.get(`${BASE_API}/map/playerHistory?tmpId=${tmpId}&serverId=${serverId}&startTime=${startTime}&endTime=${endTime}`);
|
|
121
|
-
}
|
|
122
|
-
catch {
|
|
123
|
-
return {
|
|
124
|
-
error: true
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
// 拼接返回数据
|
|
128
|
-
let data = {
|
|
129
|
-
error: result.code !== 200
|
|
130
|
-
};
|
|
131
|
-
if (!data.error) {
|
|
132
|
-
data.data = result.data;
|
|
133
|
-
}
|
|
134
|
-
return data;
|
|
135
|
-
}
|
|
136
|
-
};
|
|
1
|
+
const a0_0x58bd31=a0_0x3c30;(function(_0x1a7175,_0x11ab44){const _0x18f39b=a0_0x3c30,_0x167137=_0x1a7175();while(!![]){try{const _0x51d3d5=parseInt(_0x18f39b(0x16d))/0x1*(parseInt(_0x18f39b(0x15e))/0x2)+parseInt(_0x18f39b(0x165))/0x3*(parseInt(_0x18f39b(0x15c))/0x4)+-parseInt(_0x18f39b(0x161))/0x5*(parseInt(_0x18f39b(0x160))/0x6)+parseInt(_0x18f39b(0x15f))/0x7*(parseInt(_0x18f39b(0x16b))/0x8)+-parseInt(_0x18f39b(0x172))/0x9+parseInt(_0x18f39b(0x176))/0xa+-parseInt(_0x18f39b(0x168))/0xb;if(_0x51d3d5===_0x11ab44)break;else _0x167137['push'](_0x167137['shift']());}catch(_0xff79ec){_0x167137['push'](_0x167137['shift']());}}}(a0_0x1264,0xc45cb));const BASE_API=a0_0x58bd31(0x171);function a0_0x1264(){const _0x1c835e=['get','code','13137ZOliFB','&serverId=','/dlc/list?type=','4054589PoRsgx','exports','&aAxisY=','136QSHAcx','&startTime=','689967MTvsDt','/player/info?tmpId=','/map/playerList?aAxisX=','error','https://da.vtcm.link','7398675eafdwQ','/server/list','&bAxisX=','&bAxisY=','7430770itVNda','&endTime=','656oSrqPF','&tmpId=','2RVVDFS','4956jPNLfY','6LDjMIL','841315Ojdkws','data'];a0_0x1264=function(){return _0x1c835e;};return a0_0x1264();}function a0_0x3c30(_0x62be2e,_0x532b86){_0x62be2e=_0x62be2e-0x15b;const _0x126470=a0_0x1264();let _0x3c308c=_0x126470[_0x62be2e];return _0x3c308c;}module[a0_0x58bd31(0x169)]={async 'serverList'(_0x103b00){const _0x4d724c=a0_0x58bd31;let _0x537689=null;try{_0x537689=await _0x103b00['get'](BASE_API+_0x4d724c(0x173));}catch{return{'error':!![]};}let _0x1ff432={'error':_0x537689[_0x4d724c(0x164)]!==0xc8};return!_0x1ff432[_0x4d724c(0x170)]&&(_0x1ff432[_0x4d724c(0x162)]=_0x537689['data']),_0x1ff432;},async 'mapPlayerList'(_0x24389a,_0x1c7acc,_0x3814d1,_0x54397c,_0x3cc36e,_0x1cc87){const _0x7e4f73=a0_0x58bd31;let _0x4a6628=null;try{_0x4a6628=await _0x24389a[_0x7e4f73(0x163)](BASE_API+_0x7e4f73(0x16f)+_0x3814d1+_0x7e4f73(0x16a)+_0x54397c+_0x7e4f73(0x174)+_0x3cc36e+_0x7e4f73(0x175)+_0x1cc87+_0x7e4f73(0x166)+_0x1c7acc);}catch{return{'error':!![]};}let _0x8981cb={'error':_0x4a6628[_0x7e4f73(0x164)]!==0xc8};return!_0x8981cb[_0x7e4f73(0x170)]&&(_0x8981cb[_0x7e4f73(0x162)]=_0x4a6628[_0x7e4f73(0x162)]),_0x8981cb;},async 'playerInfo'(_0x161b1b,_0x3c900f){const _0x152bd3=a0_0x58bd31;let _0x5daaa6=null;try{_0x5daaa6=await _0x161b1b['get'](BASE_API+_0x152bd3(0x16e)+_0x3c900f);}catch{return{'error':!![]};}let _0x3d29d0={'code':_0x5daaa6['code'],'error':_0x5daaa6[_0x152bd3(0x164)]!==0xc8};return!_0x3d29d0['error']&&(_0x3d29d0[_0x152bd3(0x162)]=_0x5daaa6[_0x152bd3(0x162)]),_0x3d29d0;},async 'dlcList'(_0x36968d,_0xf16ce9){const _0x43dbb0=a0_0x58bd31;let _0x18c81a=null;try{_0x18c81a=await _0x36968d['get'](BASE_API+_0x43dbb0(0x167)+_0xf16ce9);}catch(_0x3e5248){return{'error':!![]};}let _0x3e4edf={'error':_0x18c81a[_0x43dbb0(0x164)]!==0xc8};return!_0x3e4edf[_0x43dbb0(0x170)]&&(_0x3e4edf[_0x43dbb0(0x162)]=_0x18c81a[_0x43dbb0(0x162)]),_0x3e4edf;},async 'mileageRankingList'(_0x356186,_0xc002a2,_0x8131c9){const _0x49b2cc=a0_0x58bd31;let _0xba5ab2=null;try{_0xba5ab2=await _0x356186[_0x49b2cc(0x163)](BASE_API+'/statistics/mileageRankingList?rankingType='+_0xc002a2+_0x49b2cc(0x15d)+(_0x8131c9||'')+'&rankingCount=10');}catch(_0x2d26de){return{'error':!![]};}let _0x38e0f8={'error':_0xba5ab2['code']!==0xc8};return!_0x38e0f8[_0x49b2cc(0x170)]&&(_0x38e0f8[_0x49b2cc(0x162)]=_0xba5ab2[_0x49b2cc(0x162)]),_0x38e0f8;},async 'mapPlayerHistory'(_0x1e6697,_0x516893,_0x230be5,_0x26db17,_0x18b876){const _0x334d05=a0_0x58bd31;let _0x43e7c8=null;try{_0x43e7c8=await _0x1e6697[_0x334d05(0x163)](BASE_API+'/map/playerHistory?tmpId='+(_0x516893||'')+'&serverId='+(_0x230be5||'')+_0x334d05(0x16c)+(_0x26db17||'')+_0x334d05(0x15b)+(_0x18b876||''));}catch{return{'error':!![]};}let _0x1cf9d5={'error':_0x43e7c8[_0x334d05(0x164)]!==0xc8};return!_0x1cf9d5[_0x334d05(0x170)]&&(_0x1cf9d5[_0x334d05(0x162)]=_0x43e7c8['data']),_0x1cf9d5;}};
|
package/lib/api/truckersMpApi.js
CHANGED
|
@@ -1,110 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
module.exports = {
|
|
3
|
-
/**
|
|
4
|
-
* 查询玩家信息
|
|
5
|
-
*/
|
|
6
|
-
async player(http, tmpId) {
|
|
7
|
-
let result = null;
|
|
8
|
-
try {
|
|
9
|
-
result = await http.get(`${BASE_API}/player/${tmpId}`);
|
|
10
|
-
}
|
|
11
|
-
catch {
|
|
12
|
-
return {
|
|
13
|
-
error: true
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
// 拼接返回数据
|
|
17
|
-
let data = {
|
|
18
|
-
error: JSON.parse(result.error)
|
|
19
|
-
};
|
|
20
|
-
if (!data.error) {
|
|
21
|
-
data.data = result.response;
|
|
22
|
-
}
|
|
23
|
-
return data;
|
|
24
|
-
},
|
|
25
|
-
/**
|
|
26
|
-
* 查询服务器列表
|
|
27
|
-
*/
|
|
28
|
-
async servers(http) {
|
|
29
|
-
let result = null;
|
|
30
|
-
try {
|
|
31
|
-
result = await http.get(`${BASE_API}/servers`);
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return {
|
|
35
|
-
error: true
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
// 拼接返回数据
|
|
39
|
-
let data = {
|
|
40
|
-
error: JSON.parse(result.error)
|
|
41
|
-
};
|
|
42
|
-
if (!data.error) {
|
|
43
|
-
data.data = result.response;
|
|
44
|
-
}
|
|
45
|
-
return data;
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* 查询玩家封禁信息
|
|
49
|
-
*/
|
|
50
|
-
async bans(http, tmpId) {
|
|
51
|
-
let result = null;
|
|
52
|
-
try {
|
|
53
|
-
result = await http.get(`${BASE_API}/bans/${tmpId}`);
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
return {
|
|
57
|
-
error: true
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
// 拼接返回数据
|
|
61
|
-
let data = {
|
|
62
|
-
error: JSON.parse(result.error)
|
|
63
|
-
};
|
|
64
|
-
if (!data.error) {
|
|
65
|
-
data.data = result.response;
|
|
66
|
-
}
|
|
67
|
-
return data;
|
|
68
|
-
},
|
|
69
|
-
/**
|
|
70
|
-
* 游戏版本
|
|
71
|
-
*/
|
|
72
|
-
async version(http) {
|
|
73
|
-
let result = null;
|
|
74
|
-
try {
|
|
75
|
-
result = await http.get(`${BASE_API}/version`);
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
return {
|
|
79
|
-
error: true
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
// 拼接返回数据
|
|
83
|
-
return {
|
|
84
|
-
error: false,
|
|
85
|
-
data: result
|
|
86
|
-
};
|
|
87
|
-
},
|
|
88
|
-
/**
|
|
89
|
-
* 查询车队成员信息
|
|
90
|
-
*/
|
|
91
|
-
async vtcMember(http, vtcId, memberId) {
|
|
92
|
-
let result = null;
|
|
93
|
-
try {
|
|
94
|
-
result = await http.get(`${BASE_API}/vtc/${vtcId}/member/${memberId}`);
|
|
95
|
-
}
|
|
96
|
-
catch {
|
|
97
|
-
return {
|
|
98
|
-
error: true
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
// 拼接返回数据
|
|
102
|
-
let data = {
|
|
103
|
-
error: JSON.parse(result.error)
|
|
104
|
-
};
|
|
105
|
-
if (!data.error) {
|
|
106
|
-
data.data = result.response;
|
|
107
|
-
}
|
|
108
|
-
return data;
|
|
109
|
-
}
|
|
110
|
-
};
|
|
1
|
+
(function(_0x49b5f5,_0x1db004){const _0x13d748=a1_0x4100,_0x4ea8b8=_0x49b5f5();while(!![]){try{const _0x5de30d=-parseInt(_0x13d748(0x6a))/0x1*(parseInt(_0x13d748(0x69))/0x2)+-parseInt(_0x13d748(0x6e))/0x3+parseInt(_0x13d748(0x71))/0x4+parseInt(_0x13d748(0x76))/0x5*(parseInt(_0x13d748(0x6d))/0x6)+parseInt(_0x13d748(0x7b))/0x7+-parseInt(_0x13d748(0x79))/0x8*(parseInt(_0x13d748(0x73))/0x9)+parseInt(_0x13d748(0x7c))/0xa;if(_0x5de30d===_0x1db004)break;else _0x4ea8b8['push'](_0x4ea8b8['shift']());}catch(_0x5d05de){_0x4ea8b8['push'](_0x4ea8b8['shift']());}}}(a1_0x5ca5,0x8cee0));function a1_0x4100(_0x4b74d7,_0x365927){_0x4b74d7=_0x4b74d7-0x69;const _0x5ca5e2=a1_0x5ca5();let _0x41009a=_0x5ca5e2[_0x4b74d7];return _0x41009a;}const BASE_API='https://api.truckersmp.com/v2';module['exports']={async 'player'(_0x4c80fa,_0x25b6e3){const _0x58e87e=a1_0x4100;let _0x23317c=null;try{_0x23317c=await _0x4c80fa[_0x58e87e(0x78)](BASE_API+_0x58e87e(0x74)+_0x25b6e3);}catch{return{'error':!![]};}let _0x57810f={'error':JSON[_0x58e87e(0x75)](_0x23317c['error'])};return!_0x57810f[_0x58e87e(0x6f)]&&(_0x57810f['data']=_0x23317c[_0x58e87e(0x77)]),_0x57810f;},async 'servers'(_0x1c01ae){const _0x3e0a2a=a1_0x4100;let _0x3a49a9=null;try{_0x3a49a9=await _0x1c01ae[_0x3e0a2a(0x78)](BASE_API+_0x3e0a2a(0x70));}catch{return{'error':!![]};}let _0x1cb7c6={'error':JSON[_0x3e0a2a(0x75)](_0x3a49a9[_0x3e0a2a(0x6f)])};return!_0x1cb7c6[_0x3e0a2a(0x6f)]&&(_0x1cb7c6[_0x3e0a2a(0x6c)]=_0x3a49a9[_0x3e0a2a(0x77)]),_0x1cb7c6;},async 'bans'(_0xa6fc6d,_0x261b5e){const _0x23c303=a1_0x4100;let _0x16cdaf=null;try{_0x16cdaf=await _0xa6fc6d[_0x23c303(0x78)](BASE_API+'/bans/'+_0x261b5e);}catch{return{'error':!![]};}let _0x12c946={'error':JSON[_0x23c303(0x75)](_0x16cdaf['error'])};return!_0x12c946[_0x23c303(0x6f)]&&(_0x12c946[_0x23c303(0x6c)]=_0x16cdaf[_0x23c303(0x77)]),_0x12c946;},async 'version'(_0x591f6e){const _0x2a2ef2=a1_0x4100;let _0x331a8f=null;try{_0x331a8f=await _0x591f6e[_0x2a2ef2(0x78)](BASE_API+_0x2a2ef2(0x6b));}catch{return{'error':!![]};}return{'error':![],'data':_0x331a8f};},async 'vtcMember'(_0x4190ca,_0x151743,_0x171c9a){const _0x13760e=a1_0x4100;let _0x28c6df=null;try{_0x28c6df=await _0x4190ca['get'](BASE_API+_0x13760e(0x72)+_0x151743+_0x13760e(0x7a)+_0x171c9a);}catch{return{'error':!![]};}let _0x1fdfcc={'error':JSON[_0x13760e(0x75)](_0x28c6df[_0x13760e(0x6f)])};return!_0x1fdfcc['error']&&(_0x1fdfcc[_0x13760e(0x6c)]=_0x28c6df[_0x13760e(0x77)]),_0x1fdfcc;}};function a1_0x5ca5(){const _0xa75f77=['7932tSyeMG','1809117JKzieM','error','/servers','1760828xVYWoE','/vtc/','1449Xcgadp','/player/','parse','2195TUwlxN','response','get','44952JGIYKz','/member/','5869556jOLKEB','6744700XUcgHI','2oGkzoX','448597VxnUeM','/version','data'];a1_0x5ca5=function(){return _0xa75f77;};return a1_0x5ca5();}
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
module.exports = {
|
|
3
|
-
/**
|
|
4
|
-
* 区域查询玩家
|
|
5
|
-
*/
|
|
6
|
-
async area(http, serverId, x1, y1, x2, y2) {
|
|
7
|
-
let result = null;
|
|
8
|
-
try {
|
|
9
|
-
result = await http.get(`${BASE_API}/v3/area?x1=${x1}&y1=${y1}&x2=${x2}&y2=${y2}&server=${serverId}`);
|
|
10
|
-
}
|
|
11
|
-
catch {
|
|
12
|
-
return {
|
|
13
|
-
error: true
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
// 拼接返回数据
|
|
17
|
-
let data = {
|
|
18
|
-
error: !result || !result.Success
|
|
19
|
-
};
|
|
20
|
-
if (!data.error) {
|
|
21
|
-
data.data = result.Data;
|
|
22
|
-
}
|
|
23
|
-
return data;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
1
|
+
const a2_0x42769e=a2_0x22cc;(function(_0x13640c,_0x2fe9b8){const _0x17ea0f=a2_0x22cc,_0x1543af=_0x13640c();while(!![]){try{const _0x2eb9ed=-parseInt(_0x17ea0f(0x1a0))/0x1*(parseInt(_0x17ea0f(0x19f))/0x2)+parseInt(_0x17ea0f(0x19a))/0x3*(parseInt(_0x17ea0f(0x193))/0x4)+-parseInt(_0x17ea0f(0x198))/0x5+parseInt(_0x17ea0f(0x199))/0x6*(-parseInt(_0x17ea0f(0x194))/0x7)+-parseInt(_0x17ea0f(0x19d))/0x8*(parseInt(_0x17ea0f(0x195))/0x9)+-parseInt(_0x17ea0f(0x197))/0xa*(parseInt(_0x17ea0f(0x19e))/0xb)+parseInt(_0x17ea0f(0x1a1))/0xc;if(_0x2eb9ed===_0x2fe9b8)break;else _0x1543af['push'](_0x1543af['shift']());}catch(_0x3b20a3){_0x1543af['push'](_0x1543af['shift']());}}}(a2_0x528d,0x36148));function a2_0x528d(){const _0x554f6c=['6998RHzMNY','17509704XMzSDj','error','get','Data','data','&server=','exports','3208IACuGg','610757URsEps','186399tMMzXC','Success','4288270Hcucmw','1004940LWcMmT','30QOvDUS','936fyzivd','&x2=','https://tracker.ets2map.com','144HwgEIe','11ticpAy','14JfjqRC'];a2_0x528d=function(){return _0x554f6c;};return a2_0x528d();}const BASE_API=a2_0x42769e(0x19c);function a2_0x22cc(_0x3691fc,_0x106903){_0x3691fc=_0x3691fc-0x18d;const _0x528dc1=a2_0x528d();let _0x22cc32=_0x528dc1[_0x3691fc];return _0x22cc32;}module[a2_0x42769e(0x192)]={async 'area'(_0x1ac7bc,_0x5303d3,_0x35742f,_0x3883c0,_0x2f7b0c,_0x3f37f4){const _0x2f9f58=a2_0x42769e;let _0x4b0a3c=null;try{_0x4b0a3c=await _0x1ac7bc[_0x2f9f58(0x18e)](BASE_API+'/v3/area?x1='+_0x35742f+'&y1='+_0x3883c0+_0x2f9f58(0x19b)+_0x2f7b0c+'&y2='+_0x3f37f4+_0x2f9f58(0x191)+_0x5303d3);}catch{return{'error':!![]};}let _0xd4cb6d={'error':!_0x4b0a3c||!_0x4b0a3c[_0x2f9f58(0x196)]};return!_0xd4cb6d[_0x2f9f58(0x18d)]&&(_0xd4cb6d[_0x2f9f58(0x190)]=_0x4b0a3c[_0x2f9f58(0x18f)]),_0xd4cb6d;}};
|
package/lib/api/truckyAppApi.js
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
module.exports = {
|
|
3
|
-
/**
|
|
4
|
-
* 查询线上信息
|
|
5
|
-
*/
|
|
6
|
-
async online(http, tmpId) {
|
|
7
|
-
let result = null;
|
|
8
|
-
try {
|
|
9
|
-
result = await http.get(`${BASE_API}/v3/map/online?playerID=${tmpId}`);
|
|
10
|
-
}
|
|
11
|
-
catch {
|
|
12
|
-
return {
|
|
13
|
-
error: true
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
// 拼接返回数据
|
|
17
|
-
let data = {
|
|
18
|
-
error: !result || !result.response || result.response.error
|
|
19
|
-
};
|
|
20
|
-
if (!data.error) {
|
|
21
|
-
data.data = result.response;
|
|
22
|
-
}
|
|
23
|
-
return data;
|
|
24
|
-
},
|
|
25
|
-
/**
|
|
26
|
-
* 查询热门交通数据
|
|
27
|
-
*/
|
|
28
|
-
async trafficTop(http, serverName) {
|
|
29
|
-
let result = null;
|
|
30
|
-
try {
|
|
31
|
-
result = await http.get(`${BASE_API}/v2/traffic/top?game=ets2&server=${serverName}`);
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return {
|
|
35
|
-
error: true
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
// 拼接返回数据
|
|
39
|
-
let data = {
|
|
40
|
-
error: !result || !result.response || result.response.length <= 0
|
|
41
|
-
};
|
|
42
|
-
if (!data.error) {
|
|
43
|
-
data.data = result.response;
|
|
44
|
-
}
|
|
45
|
-
return data;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
1
|
+
function a3_0x1eb8(){const _0x4a8161=['360GWvghz','exports','451863ERwNho','211561RlskzY','2162464GKNaoM','51jTbkDg','105405bxgWzT','get','30xeaoEg','13276cwSZTF','368471BwmEbA','error','response','/v2/traffic/top?game=ets2&server=','data','34532828mcVRNU','length','/v3/map/online?playerID=','90IrqqCx'];a3_0x1eb8=function(){return _0x4a8161;};return a3_0x1eb8();}function a3_0x4853(_0x540dba,_0x4d3aa6){_0x540dba=_0x540dba-0x1e2;const _0x1eb8b1=a3_0x1eb8();let _0x4853aa=_0x1eb8b1[_0x540dba];return _0x4853aa;}const a3_0x526f21=a3_0x4853;(function(_0x4ba6e9,_0x8e399){const _0x61761a=a3_0x4853,_0x58e512=_0x4ba6e9();while(!![]){try{const _0x263e16=-parseInt(_0x61761a(0x1f2))/0x1+-parseInt(_0x61761a(0x1f1))/0x2*(-parseInt(_0x61761a(0x1ed))/0x3)+-parseInt(_0x61761a(0x1e8))/0x4*(parseInt(_0x61761a(0x1ee))/0x5)+-parseInt(_0x61761a(0x1e7))/0x6*(parseInt(_0x61761a(0x1eb))/0x7)+parseInt(_0x61761a(0x1ec))/0x8+parseInt(_0x61761a(0x1ea))/0x9*(parseInt(_0x61761a(0x1f0))/0xa)+parseInt(_0x61761a(0x1e4))/0xb;if(_0x263e16===_0x8e399)break;else _0x58e512['push'](_0x58e512['shift']());}catch(_0x134c26){_0x58e512['push'](_0x58e512['shift']());}}}(a3_0x1eb8,0xe8ea1));const BASE_API='https://api.codetabs.com/v1/proxy/?quest=https://api.truckyapp.com';module[a3_0x526f21(0x1e9)]={async 'online'(_0x58c5f5,_0x4c3570){const _0x430b90=a3_0x526f21;let _0x527acd=null;try{_0x527acd=await _0x58c5f5[_0x430b90(0x1ef)](BASE_API+_0x430b90(0x1e6)+_0x4c3570);}catch{return{'error':!![]};}let _0x67206c={'error':!_0x527acd||!_0x527acd['response']||_0x527acd[_0x430b90(0x1f4)]['error']};return!_0x67206c['error']&&(_0x67206c[_0x430b90(0x1e3)]=_0x527acd[_0x430b90(0x1f4)]),_0x67206c;},async 'trafficTop'(_0x4c1822,_0x1eb75b){const _0x57d99c=a3_0x526f21;let _0x4bf673=null;try{_0x4bf673=await _0x4c1822[_0x57d99c(0x1ef)](BASE_API+_0x57d99c(0x1e2)+_0x1eb75b);}catch{return{'error':!![]};}let _0x4a622b={'error':!_0x4bf673||!_0x4bf673[_0x57d99c(0x1f4)]||_0x4bf673[_0x57d99c(0x1f4)][_0x57d99c(0x1e5)]<=0x0};return!_0x4a622b[_0x57d99c(0x1f3)]&&(_0x4a622b[_0x57d99c(0x1e3)]=_0x4bf673[_0x57d99c(0x1f4)]),_0x4a622b;}};
|
package/lib/command/tmpBind.js
CHANGED
|
@@ -1,19 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
const truckersMpApi = require("../api/truckersMpApi");
|
|
3
|
-
const evmOpenApi = require('../api/evmOpenApi');
|
|
4
|
-
/**
|
|
5
|
-
* 绑定 TMP ID
|
|
6
|
-
*/
|
|
7
|
-
module.exports = async (ctx, cfg, session, tmpId) => {
|
|
8
|
-
if (!tmpId || isNaN(tmpId)) {
|
|
9
|
-
return `请输入正确的玩家编号`;
|
|
10
|
-
}
|
|
11
|
-
// 查询玩家信息
|
|
12
|
-
let playerInfo = await evmOpenApi.playerInfo(ctx.http, tmpId);
|
|
13
|
-
if (playerInfo.error) {
|
|
14
|
-
return '绑定失败 (查询玩家信息失败)';
|
|
15
|
-
}
|
|
16
|
-
// 更新数据库
|
|
17
|
-
guildBind.saveOrUpdate(ctx.database, session.platform, session.userId, playerInfo.data.tmpId);
|
|
18
|
-
return `绑定成功 ( ${playerInfo.data.name} )`;
|
|
19
|
-
};
|
|
1
|
+
const a4_0x2b7019=a4_0x4399;(function(_0x4134f9,_0x2a49f2){const _0x3f7fda=a4_0x4399,_0x4b6506=_0x4134f9();while(!![]){try{const _0xb7d848=parseInt(_0x3f7fda(0xa0))/0x1*(parseInt(_0x3f7fda(0x90))/0x2)+-parseInt(_0x3f7fda(0x8d))/0x3+parseInt(_0x3f7fda(0xa1))/0x4+-parseInt(_0x3f7fda(0x99))/0x5*(parseInt(_0x3f7fda(0xa2))/0x6)+parseInt(_0x3f7fda(0x9f))/0x7+parseInt(_0x3f7fda(0x8e))/0x8+-parseInt(_0x3f7fda(0x97))/0x9*(parseInt(_0x3f7fda(0x9c))/0xa);if(_0xb7d848===_0x2a49f2)break;else _0x4b6506['push'](_0x4b6506['shift']());}catch(_0x127cfc){_0x4b6506['push'](_0x4b6506['shift']());}}}(a4_0x3fbc,0x2bbb6));const guildBind=require(a4_0x2b7019(0x94)),truckersMpApi=require('../api/truckersMpApi'),evmOpenApi=require(a4_0x2b7019(0x9b));function a4_0x4399(_0x6d92f5,_0x417144){_0x6d92f5=_0x6d92f5-0x8d;const _0x3fbc1f=a4_0x3fbc();let _0x439941=_0x3fbc1f[_0x6d92f5];return _0x439941;}module[a4_0x2b7019(0x95)]=async(_0xd51982,_0x2d8138,_0x27f9ca,_0x586a6c)=>{const _0x25623f=a4_0x2b7019;if(!_0x586a6c||isNaN(_0x586a6c))return'请输入正确的玩家编号';let _0x32c05c=await evmOpenApi['playerInfo'](_0xd51982[_0x25623f(0x96)],_0x586a6c);if(_0x32c05c[_0x25623f(0x92)])return _0x25623f(0x9e);return guildBind['saveOrUpdate'](_0xd51982[_0x25623f(0x9d)],_0x27f9ca[_0x25623f(0x93)],_0x27f9ca['userId'],_0x32c05c[_0x25623f(0x8f)][_0x25623f(0x98)]),_0x25623f(0x9a)+_0x32c05c[_0x25623f(0x8f)][_0x25623f(0x91)]+'\x20)';};function a4_0x3fbc(){const _0x46059f=['2575iPbXGy','绑定成功\x20(\x20','../api/evmOpenApi','15390hXTKVb','database','绑定失败\x20(查询玩家信息失败)','2230284UhCUca','57bUUFag','263572eCcIGO','1842mmshjZ','565755stobbU','2567800nWglsO','data','446ymLwxR','name','error','platform','../database/guildBind','exports','http','1125CYyTEX','tmpId'];a4_0x3fbc=function(){return _0x46059f;};return a4_0x3fbc();}
|
package/lib/command/tmpDlcMap.js
CHANGED
|
@@ -1,33 +1 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const { resolve } = require('path');
|
|
3
|
-
const common = require('../util/common');
|
|
4
|
-
const evmOpenApi = require('../api/evmOpenApi');
|
|
5
|
-
module.exports = async (ctx, session) => {
|
|
6
|
-
if (!ctx.puppeteer) {
|
|
7
|
-
return '未启用 Puppeteer 功能';
|
|
8
|
-
}
|
|
9
|
-
// 查询DLC数据
|
|
10
|
-
let dlcData = await evmOpenApi.dlcList(ctx.http, 1);
|
|
11
|
-
let page;
|
|
12
|
-
try {
|
|
13
|
-
page = await ctx.puppeteer.page();
|
|
14
|
-
await page.setViewport({ width: 1000, height: 1000 });
|
|
15
|
-
await page.goto(`file:///${resolve(__dirname, '../resource/dlc.html')}`);
|
|
16
|
-
await page.evaluate(`setData(${JSON.stringify(dlcData.data)})`);
|
|
17
|
-
await page.waitForNetworkIdle();
|
|
18
|
-
await common.sleep(500);
|
|
19
|
-
const element = await page.$("#dlc-info-container");
|
|
20
|
-
return (segment.image(await element.screenshot({
|
|
21
|
-
encoding: "binary"
|
|
22
|
-
}), "image/jpg"));
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
console.info(e);
|
|
26
|
-
return '渲染异常,请重试';
|
|
27
|
-
}
|
|
28
|
-
finally {
|
|
29
|
-
if (page) {
|
|
30
|
-
await page.close();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
1
|
+
function a5_0x52e8(){const _0x4493da=['3940810fyHenq','setViewport','sleep','558pbsjtj','data','2rSznkr','waitForNetworkIdle','92tnYrlA','58318mMcvyD','http','page','setData(','119247RzPHmh','7334270EKSsSN','../resource/dlc.html','koishi','file:///','exports','#dlc-info-container','3096ebLyrF','screenshot','22776yAdGfv','284238vceWYf','stringify','puppeteer','2745zhnxXT','info','goto','evaluate','dlcList','binary','path','../util/common','渲染异常,请重试','22435xJBbdf','close','../api/evmOpenApi','image/jpg','11uCcmef'];a5_0x52e8=function(){return _0x4493da;};return a5_0x52e8();}const a5_0x2568b2=a5_0x2bc7;(function(_0x1dc81e,_0x5cb1ff){const _0x4f4146=a5_0x2bc7,_0x2e4d23=_0x1dc81e();while(!![]){try{const _0x12375e=parseInt(_0x4f4146(0x9a))/0x1*(-parseInt(_0x4f4146(0xb0))/0x2)+parseInt(_0x4f4146(0x90))/0x3*(parseInt(_0x4f4146(0xb2))/0x4)+parseInt(_0x4f4146(0xab))/0x5+parseInt(_0x4f4146(0xae))/0x6*(-parseInt(_0x4f4146(0xa6))/0x7)+parseInt(_0x4f4146(0x99))/0x8*(-parseInt(_0x4f4146(0x9d))/0x9)+parseInt(_0x4f4146(0x91))/0xa*(-parseInt(_0x4f4146(0xaa))/0xb)+parseInt(_0x4f4146(0x97))/0xc*(parseInt(_0x4f4146(0xb3))/0xd);if(_0x12375e===_0x5cb1ff)break;else _0x2e4d23['push'](_0x2e4d23['shift']());}catch(_0x3b57d4){_0x2e4d23['push'](_0x2e4d23['shift']());}}}(a5_0x52e8,0xa4f80));function a5_0x2bc7(_0x242752,_0x1a1e94){_0x242752=_0x242752-0x8f;const _0x52e8f5=a5_0x52e8();let _0x2bc724=_0x52e8f5[_0x242752];return _0x2bc724;}const {segment}=require(a5_0x2568b2(0x93)),{resolve}=require(a5_0x2568b2(0xa3)),common=require(a5_0x2568b2(0xa4)),evmOpenApi=require(a5_0x2568b2(0xa8));module[a5_0x2568b2(0x95)]=async(_0x280f56,_0x5349b0)=>{const _0x44b4ae=a5_0x2568b2;if(!_0x280f56[_0x44b4ae(0x9c)])return'未启用\x20Puppeteer\x20功能';let _0x504cbb=await evmOpenApi[_0x44b4ae(0xa1)](_0x280f56[_0x44b4ae(0xb4)],0x1),_0x4cbfc4;try{_0x4cbfc4=await _0x280f56[_0x44b4ae(0x9c)][_0x44b4ae(0xb5)](),await _0x4cbfc4[_0x44b4ae(0xac)]({'width':0x3e8,'height':0x3e8}),await _0x4cbfc4[_0x44b4ae(0x9f)](_0x44b4ae(0x94)+resolve(__dirname,_0x44b4ae(0x92))),await _0x4cbfc4[_0x44b4ae(0xa0)](_0x44b4ae(0x8f)+JSON[_0x44b4ae(0x9b)](_0x504cbb[_0x44b4ae(0xaf)])+')'),await _0x4cbfc4[_0x44b4ae(0xb1)](),await common[_0x44b4ae(0xad)](0x1f4);const _0x703f41=await _0x4cbfc4['$'](_0x44b4ae(0x96));return segment['image'](await _0x703f41[_0x44b4ae(0x98)]({'encoding':_0x44b4ae(0xa2)}),_0x44b4ae(0xa9));}catch(_0x3f6ebd){return console[_0x44b4ae(0x9e)](_0x3f6ebd),_0x44b4ae(0xa5);}finally{_0x4cbfc4&&await _0x4cbfc4[_0x44b4ae(0xa7)]();}};
|
|
@@ -1,68 +1 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const dayjs = require('dayjs');
|
|
3
|
-
const { resolve } = require('path');
|
|
4
|
-
const common = require('../util/common');
|
|
5
|
-
const { ServerAliasToId, PromodsIds } = require('../util/constant');
|
|
6
|
-
const evmOpenApi = require('../api/evmOpenApi');
|
|
7
|
-
const guildBind = require('../database/guildBind');
|
|
8
|
-
module.exports = async (ctx, session, serverName) => {
|
|
9
|
-
if (!ctx.puppeteer) {
|
|
10
|
-
return '未启用 puppeteer 服务';
|
|
11
|
-
}
|
|
12
|
-
// 转换服务器别名到ID
|
|
13
|
-
let serverId = ServerAliasToId[serverName];
|
|
14
|
-
if (!serverId) {
|
|
15
|
-
return '请输入正确的服务器名称 (s1, s2, p, a)';
|
|
16
|
-
}
|
|
17
|
-
// 尝试从数据库查询绑定信息
|
|
18
|
-
let guildBindData = await guildBind.get(ctx.database, session.platform, session.userId);
|
|
19
|
-
if (!guildBindData) {
|
|
20
|
-
return `请先绑定玩家编号`;
|
|
21
|
-
}
|
|
22
|
-
let tmpId = guildBindData.tmp_id;
|
|
23
|
-
// 查询玩家信息
|
|
24
|
-
let playerInfo = await evmOpenApi.playerInfo(ctx.http, tmpId);
|
|
25
|
-
if (playerInfo.error && playerInfo.code === 10001) {
|
|
26
|
-
return '玩家不存在';
|
|
27
|
-
}
|
|
28
|
-
else if (playerInfo.error) {
|
|
29
|
-
return '查询玩家信息失败,请重试';
|
|
30
|
-
}
|
|
31
|
-
// 查询当日历史位置数据
|
|
32
|
-
const startTime = dayjs().startOf('day').format('YYYY-MM-DD HH:mm:ss');
|
|
33
|
-
const endTime = dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss');
|
|
34
|
-
let mapPlayerHistory = await evmOpenApi.mapPlayerHistory(ctx.http, tmpId, serverId, startTime, endTime);
|
|
35
|
-
if (mapPlayerHistory.data.length === 0) {
|
|
36
|
-
return `当日暂无数据`;
|
|
37
|
-
}
|
|
38
|
-
// 拼接数据
|
|
39
|
-
let data = {
|
|
40
|
-
mapType: PromodsIds.indexOf(serverId) !== -1 ? 'promods' : 'ets',
|
|
41
|
-
name: playerInfo.data.name,
|
|
42
|
-
smallAvatarUrl: playerInfo.data.smallAvatarUrl,
|
|
43
|
-
todayMileage: playerInfo.data.todayMileage,
|
|
44
|
-
points: mapPlayerHistory.data
|
|
45
|
-
};
|
|
46
|
-
let page;
|
|
47
|
-
try {
|
|
48
|
-
page = await ctx.puppeteer.page();
|
|
49
|
-
await page.setViewport({ width: 1000, height: 1000 });
|
|
50
|
-
await page.goto(`file:///${resolve(__dirname, '../resource/footprint.html')}`);
|
|
51
|
-
await page.evaluate(`init(${JSON.stringify(data)})`);
|
|
52
|
-
await common.sleep(100);
|
|
53
|
-
await page.waitForNetworkIdle();
|
|
54
|
-
const element = await page.$("#container");
|
|
55
|
-
return (segment.image(await element.screenshot({
|
|
56
|
-
encoding: "binary"
|
|
57
|
-
}), "image/jpg"));
|
|
58
|
-
}
|
|
59
|
-
catch (e) {
|
|
60
|
-
return '渲染异常,请重试';
|
|
61
|
-
}
|
|
62
|
-
finally {
|
|
63
|
-
if (page) {
|
|
64
|
-
await page.close();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return `OK: ` + playerInfo.data.name;
|
|
68
|
-
};
|
|
1
|
+
function a6_0x4d8f(_0x3d5ee4,_0x4e60e4){_0x3d5ee4=_0x3d5ee4-0x199;const _0x2c0bfb=a6_0x2c0b();let _0x4d8fdc=_0x2c0bfb[_0x3d5ee4];return _0x4d8fdc;}const a6_0x3ed910=a6_0x4d8f;(function(_0x535773,_0x1e5958){const _0x278f5e=a6_0x4d8f,_0x58b6ff=_0x535773();while(!![]){try{const _0x1561a8=-parseInt(_0x278f5e(0x1a7))/0x1+parseInt(_0x278f5e(0x1c9))/0x2+-parseInt(_0x278f5e(0x1aa))/0x3+parseInt(_0x278f5e(0x1ac))/0x4+-parseInt(_0x278f5e(0x19a))/0x5+parseInt(_0x278f5e(0x1a2))/0x6*(parseInt(_0x278f5e(0x1bb))/0x7)+-parseInt(_0x278f5e(0x19d))/0x8*(-parseInt(_0x278f5e(0x1cb))/0x9);if(_0x1561a8===_0x1e5958)break;else _0x58b6ff['push'](_0x58b6ff['shift']());}catch(_0x4b38d4){_0x58b6ff['push'](_0x58b6ff['shift']());}}}(a6_0x2c0b,0x5420c));function a6_0x2c0b(){const _0x1ac7c9=['init(','smallAvatarUrl','screenshot','549787SaEcEJ','http','page','path','请输入正确的玩家编号','setViewport','sleep','evaluate','../util/constant','endOf','dayjs','image','format','ets','453298qjOnXr','length','9vffWko','#container','image/jpg','serverId','userId','error','day','257230PcQDov','goto','waitForNetworkIdle','1207656zxZxSq','platform','promods','puppeteer','查询玩家历史位置数据失败,请稍后重试','24IeKAsg','filter','未启用\x20puppeteer\x20服务','has','get','283392RWUXFE','../util/common','../resource/footprint.html','1486182RUEvjq','查询玩家信息失败,请重试','1932200CwMLyR','exports','mapPlayerHistory','玩家不存在','data','../database/guildBind','stringify','../api/evmOpenApi','当日暂无数据','渲染异常,请重试','koishi','startOf'];a6_0x2c0b=function(){return _0x1ac7c9;};return a6_0x2c0b();}const {segment}=require(a6_0x3ed910(0x1b6)),dayjs=require(a6_0x3ed910(0x1c5)),{resolve}=require(a6_0x3ed910(0x1be)),common=require(a6_0x3ed910(0x1a8)),{PromodsIds,ServerType}=require(a6_0x3ed910(0x1c3)),evmOpenApi=require(a6_0x3ed910(0x1b3)),guildBind=require(a6_0x3ed910(0x1b1));module[a6_0x3ed910(0x1ad)]=async(_0x20bdd8,_0x4f68bc,_0x427785,_0x4bcd42)=>{const _0xa8c5b6=a6_0x3ed910;if(!_0x20bdd8[_0xa8c5b6(0x1a0)])return _0xa8c5b6(0x1a4);if(_0x4bcd42&&isNaN(_0x4bcd42))return _0xa8c5b6(0x1bf);if(!_0x4bcd42){let _0xb8296f=await guildBind[_0xa8c5b6(0x1a6)](_0x20bdd8['database'],_0x4f68bc[_0xa8c5b6(0x19e)],_0x4f68bc[_0xa8c5b6(0x1cf)]);if(!_0xb8296f)return _0xa8c5b6(0x1bf);_0x4bcd42=_0xb8296f['tmp_id'];}let _0x33839e=await evmOpenApi['playerInfo'](_0x20bdd8['http'],_0x4bcd42);if(_0x33839e[_0xa8c5b6(0x1d0)]&&_0x33839e['code']===0x2711)return _0xa8c5b6(0x1af);else{if(_0x33839e[_0xa8c5b6(0x1d0)])return _0xa8c5b6(0x1ab);}const _0x56c77b=dayjs()[_0xa8c5b6(0x1b7)](_0xa8c5b6(0x199))[_0xa8c5b6(0x1c7)]('YYYY-MM-DD\x20HH:mm:ss'),_0x2a005e=dayjs()[_0xa8c5b6(0x1c4)](_0xa8c5b6(0x199))[_0xa8c5b6(0x1c7)]('YYYY-MM-DD\x20HH:mm:ss');let _0x571e1f=await evmOpenApi[_0xa8c5b6(0x1ae)](_0x20bdd8[_0xa8c5b6(0x1bc)],_0x4bcd42,null,_0x56c77b,_0x2a005e);if(_0x571e1f['error'])return _0xa8c5b6(0x1a1);const _0x2e6277=new Set(PromodsIds),_0x2ec99a=_0x571e1f[_0xa8c5b6(0x1b0)][_0xa8c5b6(0x1a3)](_0x1c9f15=>{const _0x2c75ca=_0xa8c5b6;if(ServerType[_0x2c75ca(0x1c8)]===_0x427785)return!_0x2e6277[_0x2c75ca(0x1a5)](_0x1c9f15[_0x2c75ca(0x1ce)]);else{if(ServerType[_0x2c75ca(0x19f)]===_0x427785)return _0x2e6277['has'](_0x1c9f15['serverId']);}return![];});if(_0x2ec99a[_0xa8c5b6(0x1ca)]===0x0)return _0xa8c5b6(0x1b4);let _0x543126={'mapType':ServerType[_0xa8c5b6(0x19f)]===_0x427785?_0xa8c5b6(0x19f):'ets','name':_0x33839e[_0xa8c5b6(0x1b0)]['name'],'smallAvatarUrl':_0x33839e[_0xa8c5b6(0x1b0)][_0xa8c5b6(0x1b9)],'todayMileage':_0x33839e[_0xa8c5b6(0x1b0)]['todayMileage'],'points':_0x571e1f[_0xa8c5b6(0x1b0)]},_0x4f9444;try{_0x4f9444=await _0x20bdd8[_0xa8c5b6(0x1a0)][_0xa8c5b6(0x1bd)](),await _0x4f9444[_0xa8c5b6(0x1c0)]({'width':0x3e8,'height':0x3e8}),await _0x4f9444[_0xa8c5b6(0x19b)]('file:///'+resolve(__dirname,_0xa8c5b6(0x1a9))),await _0x4f9444[_0xa8c5b6(0x1c2)](_0xa8c5b6(0x1b8)+JSON[_0xa8c5b6(0x1b2)](_0x543126)+')'),await common[_0xa8c5b6(0x1c1)](0x64),await _0x4f9444[_0xa8c5b6(0x19c)]();const _0xf0ec32=await _0x4f9444['$'](_0xa8c5b6(0x1cc));return segment[_0xa8c5b6(0x1c6)](await _0xf0ec32[_0xa8c5b6(0x1ba)]({'encoding':'binary'}),_0xa8c5b6(0x1cd));}catch(_0x5f0499){return _0xa8c5b6(0x1b5);}finally{_0x4f9444&&await _0x4f9444['close']();}return'OK:\x20'+_0x33839e[_0xa8c5b6(0x1b0)]['name'];};
|
|
@@ -1,55 +1 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const { resolve } = require('path');
|
|
3
|
-
const common = require('../util/common');
|
|
4
|
-
const evmOpenApi = require('../api/evmOpenApi');
|
|
5
|
-
const guildBind = require('../database/guildBind');
|
|
6
|
-
module.exports = async (ctx, session, rankingType) => {
|
|
7
|
-
if (!ctx.puppeteer) {
|
|
8
|
-
return '未启用 Puppeteer 功能';
|
|
9
|
-
}
|
|
10
|
-
// 查询排行榜信息
|
|
11
|
-
let mileageRankingList = await evmOpenApi.mileageRankingList(ctx.http, rankingType, null);
|
|
12
|
-
if (mileageRankingList.error) {
|
|
13
|
-
return '查询排行榜信息失败';
|
|
14
|
-
}
|
|
15
|
-
else if (mileageRankingList.data.length === 0) {
|
|
16
|
-
return '暂无数据';
|
|
17
|
-
}
|
|
18
|
-
// 查询当前玩家的排行信息
|
|
19
|
-
let guildBindData = await guildBind.get(ctx.database, session.platform, session.userId);
|
|
20
|
-
let playerMileageRanking = null;
|
|
21
|
-
if (guildBindData) {
|
|
22
|
-
let playerMileageRankingResult = await evmOpenApi.mileageRankingList(ctx.http, rankingType, guildBindData.tmp_id);
|
|
23
|
-
if (!playerMileageRankingResult.error && playerMileageRankingResult.data.length > 0) {
|
|
24
|
-
playerMileageRanking = playerMileageRankingResult.data[0];
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
// 拼接页面数据
|
|
28
|
-
let data = {
|
|
29
|
-
rankingType: rankingType,
|
|
30
|
-
mileageRankingList: mileageRankingList.data,
|
|
31
|
-
playerMileageRanking: playerMileageRanking
|
|
32
|
-
};
|
|
33
|
-
let page;
|
|
34
|
-
try {
|
|
35
|
-
page = await ctx.puppeteer.page();
|
|
36
|
-
await page.setViewport({ width: 1000, height: 1000 });
|
|
37
|
-
await page.goto(`file:///${resolve(__dirname, '../resource/mileage-leaderboard.html')}`);
|
|
38
|
-
await page.evaluate(`setData(${JSON.stringify(data)})`);
|
|
39
|
-
await page.waitForNetworkIdle();
|
|
40
|
-
await common.sleep(500);
|
|
41
|
-
const element = await page.$("#container");
|
|
42
|
-
return (segment.image(await element.screenshot({
|
|
43
|
-
encoding: "binary"
|
|
44
|
-
}), "image/jpg"));
|
|
45
|
-
}
|
|
46
|
-
catch (e) {
|
|
47
|
-
console.info(e);
|
|
48
|
-
return '渲染异常,请重试';
|
|
49
|
-
}
|
|
50
|
-
finally {
|
|
51
|
-
if (page) {
|
|
52
|
-
await page.close();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
};
|
|
1
|
+
const a7_0xa88e2c=a7_0x1893;(function(_0x1c351b,_0x2c339b){const _0x58bb87=a7_0x1893,_0x51d5e8=_0x1c351b();while(!![]){try{const _0x229b94=-parseInt(_0x58bb87(0x1e9))/0x1*(parseInt(_0x58bb87(0x1de))/0x2)+parseInt(_0x58bb87(0x1d1))/0x3+parseInt(_0x58bb87(0x1d8))/0x4*(-parseInt(_0x58bb87(0x1ed))/0x5)+parseInt(_0x58bb87(0x1eb))/0x6+-parseInt(_0x58bb87(0x1f2))/0x7*(parseInt(_0x58bb87(0x1e6))/0x8)+-parseInt(_0x58bb87(0x1d6))/0x9*(parseInt(_0x58bb87(0x1ea))/0xa)+parseInt(_0x58bb87(0x1e1))/0xb;if(_0x229b94===_0x2c339b)break;else _0x51d5e8['push'](_0x51d5e8['shift']());}catch(_0x2b9446){_0x51d5e8['push'](_0x51d5e8['shift']());}}}(a7_0x2db5,0x85849));const {segment}=require('koishi'),{resolve}=require(a7_0xa88e2c(0x1d4)),common=require('../util/common'),evmOpenApi=require('../api/evmOpenApi'),guildBind=require(a7_0xa88e2c(0x1f4));function a7_0x2db5(){const _0x475a01=['path','sleep','45HuUKvd','未启用\x20Puppeteer\x20功能','20wInouW','length','渲染异常,请重试','http','setViewport','image/jpg','126QPzOYf','exports','stringify','27671886pziyUb','close','platform','goto','mileageRankingList','192VaEuOg','binary','screenshot','12135FzSevl','1498170ntAIkR','6003540YapCTU','error','927955WXUmVF','image','info','get','file:///','183197NZOTcn','tmp_id','../database/guildBind','setData(','data','database','300966POHTTx','waitForNetworkIdle','puppeteer'];a7_0x2db5=function(){return _0x475a01;};return a7_0x2db5();}function a7_0x1893(_0xdb920c,_0x45cfce){_0xdb920c=_0xdb920c-0x1ce;const _0x2db551=a7_0x2db5();let _0x1893f4=_0x2db551[_0xdb920c];return _0x1893f4;}module[a7_0xa88e2c(0x1df)]=async(_0x1bf321,_0x537fad,_0x19ad6f)=>{const _0x5468cd=a7_0xa88e2c;if(!_0x1bf321[_0x5468cd(0x1d3)])return _0x5468cd(0x1d7);let _0x36866e=await evmOpenApi[_0x5468cd(0x1e5)](_0x1bf321['http'],_0x19ad6f,null);if(_0x36866e[_0x5468cd(0x1ec)])return'查询排行榜信息失败';else{if(_0x36866e['data'][_0x5468cd(0x1d9)]===0x0)return'暂无数据';}let _0x306e3c=await guildBind[_0x5468cd(0x1f0)](_0x1bf321[_0x5468cd(0x1d0)],_0x537fad[_0x5468cd(0x1e3)],_0x537fad['userId']),_0x2e0881=null;if(_0x306e3c){let _0xd79480=await evmOpenApi['mileageRankingList'](_0x1bf321[_0x5468cd(0x1db)],_0x19ad6f,_0x306e3c[_0x5468cd(0x1f3)]);!_0xd79480[_0x5468cd(0x1ec)]&&_0xd79480[_0x5468cd(0x1cf)][_0x5468cd(0x1d9)]>0x0&&(_0x2e0881=_0xd79480[_0x5468cd(0x1cf)][0x0]);}let _0xa2332a={'rankingType':_0x19ad6f,'mileageRankingList':_0x36866e[_0x5468cd(0x1cf)],'playerMileageRanking':_0x2e0881},_0x5cb673;try{_0x5cb673=await _0x1bf321[_0x5468cd(0x1d3)]['page'](),await _0x5cb673[_0x5468cd(0x1dc)]({'width':0x3e8,'height':0x3e8}),await _0x5cb673[_0x5468cd(0x1e4)](_0x5468cd(0x1f1)+resolve(__dirname,'../resource/mileage-leaderboard.html')),await _0x5cb673['evaluate'](_0x5468cd(0x1ce)+JSON[_0x5468cd(0x1e0)](_0xa2332a)+')'),await _0x5cb673[_0x5468cd(0x1d2)](),await common[_0x5468cd(0x1d5)](0x1f4);const _0x11c82d=await _0x5cb673['$']('#container');return segment[_0x5468cd(0x1ee)](await _0x11c82d[_0x5468cd(0x1e8)]({'encoding':_0x5468cd(0x1e7)}),_0x5468cd(0x1dd));}catch(_0x2c5307){return console[_0x5468cd(0x1ef)](_0x2c5307),_0x5468cd(0x1da);}finally{_0x5cb673&&await _0x5cb673[_0x5468cd(0x1e2)]();}};
|