koishi-plugin-ets2-tools-tmp 2.2.1 → 2.3.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 -133
- package/lib/api/truckersMpMapApi.js +1 -25
- package/lib/api/truckyAppApi.js +1 -48
- package/lib/command/ets-app/queryPoint.js +1 -96
- package/lib/command/ets-app/resetPassword.js +1 -270
- package/lib/command/tmpActivityService.js +1 -603
- package/lib/command/tmpBind.js +1 -19
- package/lib/command/tmpDlcMap.js +1 -33
- package/lib/command/tmpFootprint.js +1 -68
- package/lib/command/tmpMileageRanking.js +1 -55
- package/lib/command/tmpPosition.js +1 -123
- package/lib/command/tmpQuery/tmpQuery.js +1 -12
- package/lib/command/tmpQuery/tmpQueryImg.js +1 -103
- package/lib/command/tmpQuery/tmpQueryText.js +1 -181
- package/lib/command/tmpServer.js +1 -41
- package/lib/command/tmpTraffic/tmpTraffic.js +1 -15
- package/lib/command/tmpTraffic/tmpTrafficMap.js +1 -163
- package/lib/command/tmpTraffic/tmpTrafficText.js +1 -60
- package/lib/command/tmpVersion.js +1 -14
- package/lib/command/tmpVtc.js +1 -29
- 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 -324
- 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/util/baiduTranslate.js +1 -24
- package/lib/util/common.js +1 -5
- package/lib/util/constant.js +1 -29
- package/package.json +1 -1
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
|
+
function _0x28fc(_0x42e50c,_0x3200eb){const _0x277c15=_0x4a7a();return _0x28fc=function(_0x427454,_0x27d47e){_0x427454=_0x427454-0x6e;let _0x34711d=_0x277c15[_0x427454];return _0x34711d;},_0x28fc(_0x42e50c,_0x3200eb);}const _0x2009ff=_0x28fc;(function(_0x1dde6f,_0x5b041a){const _0x250d4d=_0x28fc,_0x303464=_0x1dde6f();while(!![]){try{const _0x159dfd=-parseInt(_0x250d4d(0x80))/0x1+parseInt(_0x250d4d(0x79))/0x2*(-parseInt(_0x250d4d(0x78))/0x3)+-parseInt(_0x250d4d(0x8a))/0x4*(-parseInt(_0x250d4d(0x71))/0x5)+parseInt(_0x250d4d(0x8c))/0x6+parseInt(_0x250d4d(0x7c))/0x7*(parseInt(_0x250d4d(0x93))/0x8)+-parseInt(_0x250d4d(0x92))/0x9*(-parseInt(_0x250d4d(0x81))/0xa)+parseInt(_0x250d4d(0x86))/0xb;if(_0x159dfd===_0x5b041a)break;else _0x303464['push'](_0x303464['shift']());}catch(_0x467bec){_0x303464['push'](_0x303464['shift']());}}}(_0x4a7a,0x375b3));const _0x2a35cf=(function(){let _0x4417a7=!![];return function(_0x575b97,_0x366385){const _0x532405=_0x4417a7?function(){const _0x5f5839=_0x28fc;if(_0x366385){const _0x128ef=_0x366385[_0x5f5839(0x7e)](_0x575b97,arguments);return _0x366385=null,_0x128ef;}}:function(){};return _0x4417a7=![],_0x532405;};}()),_0x3f597c=_0x2a35cf(this,function(){const _0x135ad0=_0x28fc;return _0x3f597c[_0x135ad0(0x8e)]()[_0x135ad0(0x85)](_0x135ad0(0x72))[_0x135ad0(0x8e)]()[_0x135ad0(0x7b)](_0x3f597c)[_0x135ad0(0x85)]('(((.+)+)+)+$');});_0x3f597c();const _0x27d47e=(function(){let _0x1cd612=!![];return function(_0x473f21,_0x1e6da0){const _0x265437=_0x1cd612?function(){if(_0x1e6da0){const _0x1cbedf=_0x1e6da0['apply'](_0x473f21,arguments);return _0x1e6da0=null,_0x1cbedf;}}:function(){};return _0x1cd612=![],_0x265437;};}()),_0x427454=_0x27d47e(this,function(){const _0x575239=_0x28fc,_0x39806b=function(){const _0x36d12a=_0x28fc;let _0x548e56;try{_0x548e56=Function(_0x36d12a(0x70)+_0x36d12a(0x7f)+');')();}catch(_0x5d798c){_0x548e56=window;}return _0x548e56;},_0x2ff3ce=_0x39806b(),_0x42e2fa=_0x2ff3ce[_0x575239(0x75)]=_0x2ff3ce[_0x575239(0x75)]||{},_0x50fd07=['log',_0x575239(0x77),'info',_0x575239(0x7d),_0x575239(0x84),_0x575239(0x7a),_0x575239(0x74)];for(let _0x5e266f=0x0;_0x5e266f<_0x50fd07[_0x575239(0x8b)];_0x5e266f++){const _0x3d1dec=_0x27d47e[_0x575239(0x7b)][_0x575239(0x82)][_0x575239(0x89)](_0x27d47e),_0x1efd23=_0x50fd07[_0x5e266f],_0x40bcad=_0x42e2fa[_0x1efd23]||_0x3d1dec;_0x3d1dec[_0x575239(0x83)]=_0x27d47e[_0x575239(0x89)](_0x27d47e),_0x3d1dec[_0x575239(0x8e)]=_0x40bcad[_0x575239(0x8e)][_0x575239(0x89)](_0x40bcad),_0x42e2fa[_0x1efd23]=_0x3d1dec;}});_0x427454();const guildBind=require(_0x2009ff(0x8f)),truckersMpApi=require(_0x2009ff(0x6f)),evmOpenApi=require('../api/evmOpenApi');function _0x4a7a(){const _0x538c6f=['exports','../api/truckersMpApi','return\x20(function()\x20','5cQsYDZ','(((.+)+)+)+$','tmpId','trace','console','saveOrUpdate','warn','95673fFSLRT','22drQSrt','table','constructor','235529svdZvP','error','apply','{}.constructor(\x22return\x20this\x22)(\x20)','262782eLSQLd','220maxUoS','prototype','__proto__','exception','search','6429841WCrsvV','请输入正确的玩家编号','userId','bind','83704CDyzxe','length','1126392bJBkDH','data','toString','../database/guildBind','name','platform','5517ugNrry','8ISgeDr'];_0x4a7a=function(){return _0x538c6f;};return _0x4a7a();}module[_0x2009ff(0x6e)]=async(_0x1e5312,_0x2067fd,_0x5cfa74,_0x491f44)=>{const _0x4860a5=_0x2009ff;if(!_0x491f44||isNaN(_0x491f44))return _0x4860a5(0x87);let _0x5a95e7=await evmOpenApi['playerInfo'](_0x1e5312['http'],_0x491f44);if(_0x5a95e7['error'])return'绑定失败\x20(查询玩家信息失败)';return guildBind[_0x4860a5(0x76)](_0x1e5312['database'],_0x5cfa74[_0x4860a5(0x91)],_0x5cfa74[_0x4860a5(0x88)],_0x5a95e7[_0x4860a5(0x8d)][_0x4860a5(0x73)]),'绑定成功\x20(\x20'+_0x5a95e7['data'][_0x4860a5(0x90)]+'\x20)';};
|
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
|
+
const _0x54b5ca=_0x342b;(function(_0x290296,_0xd7b465){const _0x4ad707=_0x342b,_0x52faef=_0x290296();while(!![]){try{const _0x5afbe0=-parseInt(_0x4ad707(0x1d0))/0x1*(-parseInt(_0x4ad707(0x1d2))/0x2)+parseInt(_0x4ad707(0x1e3))/0x3+-parseInt(_0x4ad707(0x1db))/0x4+parseInt(_0x4ad707(0x1c7))/0x5*(parseInt(_0x4ad707(0x1e4))/0x6)+-parseInt(_0x4ad707(0x1e7))/0x7+parseInt(_0x4ad707(0x1d9))/0x8*(parseInt(_0x4ad707(0x1f2))/0x9)+-parseInt(_0x4ad707(0x1f4))/0xa;if(_0x5afbe0===_0xd7b465)break;else _0x52faef['push'](_0x52faef['shift']());}catch(_0x7b55da){_0x52faef['push'](_0x52faef['shift']());}}}(_0x2ed1,0x3633f));const _0x9bb99c=(function(){let _0x181209=!![];return function(_0x429a01,_0x2168c8){const _0x3be942=_0x181209?function(){if(_0x2168c8){const _0x3a265f=_0x2168c8['apply'](_0x429a01,arguments);return _0x2168c8=null,_0x3a265f;}}:function(){};return _0x181209=![],_0x3be942;};}()),_0x56fac5=_0x9bb99c(this,function(){const _0x3eac47=_0x342b;return _0x56fac5[_0x3eac47(0x1d4)]()[_0x3eac47(0x1d3)](_0x3eac47(0x1f1))['toString']()[_0x3eac47(0x1c9)](_0x56fac5)[_0x3eac47(0x1d3)](_0x3eac47(0x1f1));});_0x56fac5();function _0x342b(_0x3b87fa,_0x21f05e){const _0x528837=_0x2ed1();return _0x342b=function(_0x4f2993,_0x4ee69f){_0x4f2993=_0x4f2993-0x1c4;let _0x203bcc=_0x528837[_0x4f2993];return _0x203bcc;},_0x342b(_0x3b87fa,_0x21f05e);}const _0x4ee69f=(function(){let _0x904f58=!![];return function(_0x350fcb,_0x39dc26){const _0x25c66e=_0x904f58?function(){const _0x1f3087=_0x342b;if(_0x39dc26){const _0x5bd7ed=_0x39dc26[_0x1f3087(0x1e9)](_0x350fcb,arguments);return _0x39dc26=null,_0x5bd7ed;}}:function(){};return _0x904f58=![],_0x25c66e;};}()),_0x4f2993=_0x4ee69f(this,function(){const _0x210af4=_0x342b;let _0x459c1e;try{const _0x4b4635=Function(_0x210af4(0x1df)+_0x210af4(0x1d7)+');');_0x459c1e=_0x4b4635();}catch(_0x3fa841){_0x459c1e=window;}const _0x260a4f=_0x459c1e[_0x210af4(0x1d5)]=_0x459c1e['console']||{},_0x185386=[_0x210af4(0x1e0),'warn',_0x210af4(0x1c8),_0x210af4(0x1e1),_0x210af4(0x1e2),_0x210af4(0x1cb),_0x210af4(0x1ef)];for(let _0x5011a5=0x0;_0x5011a5<_0x185386[_0x210af4(0x1ee)];_0x5011a5++){const _0x25e4ef=_0x4ee69f[_0x210af4(0x1c9)][_0x210af4(0x1cd)][_0x210af4(0x1c5)](_0x4ee69f),_0x4bea39=_0x185386[_0x5011a5],_0x207117=_0x260a4f[_0x4bea39]||_0x25e4ef;_0x25e4ef[_0x210af4(0x1ea)]=_0x4ee69f[_0x210af4(0x1c5)](_0x4ee69f),_0x25e4ef['toString']=_0x207117[_0x210af4(0x1d4)][_0x210af4(0x1c5)](_0x207117),_0x260a4f[_0x4bea39]=_0x25e4ef;}});function _0x2ed1(){const _0xcd2c22=['975489HRODQH','218094jMCxTq','未启用\x20Puppeteer\x20功能','evaluate','1073751KpuaQb','image','apply','__proto__','puppeteer','#dlc-info-container','page','length','trace','image/jpg','(((.+)+)+)+$','753435PcFkIG','dlcList','6926750YNTfPp','file:///','bind','koishi','35uweoVy','info','constructor','http','table','sleep','prototype','exports','binary','8933hOsmxA','setViewport','90pmzprJ','search','toString','console','渲染异常,请重试','{}.constructor(\x22return\x20this\x22)(\x20)','../api/evmOpenApi','32UAPRBr','path','993472ixUtfl','data','screenshot','close','return\x20(function()\x20','log','error','exception'];_0x2ed1=function(){return _0xcd2c22;};return _0x2ed1();}_0x4f2993();const {segment}=require(_0x54b5ca(0x1c6)),{resolve}=require(_0x54b5ca(0x1da)),common=require('../util/common'),evmOpenApi=require(_0x54b5ca(0x1d8));module[_0x54b5ca(0x1ce)]=async(_0x270ef3,_0x4cb481)=>{const _0x2415d8=_0x54b5ca;if(!_0x270ef3[_0x2415d8(0x1eb)])return _0x2415d8(0x1e5);let _0x7d3c05=await evmOpenApi[_0x2415d8(0x1f3)](_0x270ef3[_0x2415d8(0x1ca)],0x1),_0x427fe8;try{_0x427fe8=await _0x270ef3[_0x2415d8(0x1eb)][_0x2415d8(0x1ed)](),await _0x427fe8[_0x2415d8(0x1d1)]({'width':0x3e8,'height':0x3e8}),await _0x427fe8['goto'](_0x2415d8(0x1c4)+resolve(__dirname,'../resource/dlc.html')),await _0x427fe8[_0x2415d8(0x1e6)]('setData('+JSON['stringify'](_0x7d3c05[_0x2415d8(0x1dc)])+')'),await _0x427fe8['waitForNetworkIdle'](),await common[_0x2415d8(0x1cc)](0x1f4);const _0x67cfb2=await _0x427fe8['$'](_0x2415d8(0x1ec));return segment[_0x2415d8(0x1e8)](await _0x67cfb2[_0x2415d8(0x1dd)]({'encoding':_0x2415d8(0x1cf)}),_0x2415d8(0x1f0));}catch(_0x2eb71b){return console[_0x2415d8(0x1c8)](_0x2eb71b),_0x2415d8(0x1d6);}finally{_0x427fe8&&await _0x427fe8[_0x2415d8(0x1de)]();}};
|
|
@@ -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
|
+
const _0x5e7217=_0x22c7;(function(_0x35b0cf,_0x347886){const _0x1c4e65=_0x22c7,_0x347774=_0x35b0cf();while(!![]){try{const _0x2bdf5a=parseInt(_0x1c4e65(0x192))/0x1+parseInt(_0x1c4e65(0x16c))/0x2*(-parseInt(_0x1c4e65(0x172))/0x3)+parseInt(_0x1c4e65(0x182))/0x4*(-parseInt(_0x1c4e65(0x170))/0x5)+parseInt(_0x1c4e65(0x14b))/0x6+-parseInt(_0x1c4e65(0x178))/0x7+parseInt(_0x1c4e65(0x150))/0x8+parseInt(_0x1c4e65(0x14f))/0x9;if(_0x2bdf5a===_0x347886)break;else _0x347774['push'](_0x347774['shift']());}catch(_0x5c25b2){_0x347774['push'](_0x347774['shift']());}}}(_0x5a83,0x454bd));const _0x47cdfa=(function(){let _0x5c93b9=!![];return function(_0x566cdd,_0xc773f8){const _0x1440d8=_0x5c93b9?function(){const _0x4206d2=_0x22c7;if(_0xc773f8){const _0x1ae1cd=_0xc773f8[_0x4206d2(0x16d)](_0x566cdd,arguments);return _0xc773f8=null,_0x1ae1cd;}}:function(){};return _0x5c93b9=![],_0x1440d8;};}()),_0x59341a=_0x47cdfa(this,function(){const _0x1be55d=_0x22c7;return _0x59341a[_0x1be55d(0x153)]()[_0x1be55d(0x181)](_0x1be55d(0x185))[_0x1be55d(0x153)]()[_0x1be55d(0x16b)](_0x59341a)['search'](_0x1be55d(0x185));});_0x59341a();const _0x2b4930=(function(){let _0x523d97=!![];return function(_0x2be887,_0x3c77d6){const _0x63c039=_0x523d97?function(){const _0x17a53a=_0x22c7;if(_0x3c77d6){const _0x53e4a7=_0x3c77d6[_0x17a53a(0x16d)](_0x2be887,arguments);return _0x3c77d6=null,_0x53e4a7;}}:function(){};return _0x523d97=![],_0x63c039;};}()),_0x13104f=_0x2b4930(this,function(){const _0x307a5e=_0x22c7,_0x29a6b=function(){const _0x2faaca=_0x22c7;let _0x5ba7e5;try{_0x5ba7e5=Function(_0x2faaca(0x194)+_0x2faaca(0x14c)+');')();}catch(_0x4ef292){_0x5ba7e5=window;}return _0x5ba7e5;},_0x4a9bfd=_0x29a6b(),_0x5ec954=_0x4a9bfd[_0x307a5e(0x154)]=_0x4a9bfd[_0x307a5e(0x154)]||{},_0x28128c=[_0x307a5e(0x18b),_0x307a5e(0x186),_0x307a5e(0x174),_0x307a5e(0x15b),_0x307a5e(0x17b),_0x307a5e(0x17e),'trace'];for(let _0x72910f=0x0;_0x72910f<_0x28128c[_0x307a5e(0x195)];_0x72910f++){const _0x293ea0=_0x2b4930[_0x307a5e(0x16b)][_0x307a5e(0x184)][_0x307a5e(0x151)](_0x2b4930),_0x5e0004=_0x28128c[_0x72910f],_0xb335d2=_0x5ec954[_0x5e0004]||_0x293ea0;_0x293ea0['__proto__']=_0x2b4930[_0x307a5e(0x151)](_0x2b4930),_0x293ea0[_0x307a5e(0x153)]=_0xb335d2['toString'][_0x307a5e(0x151)](_0xb335d2),_0x5ec954[_0x5e0004]=_0x293ea0;}});_0x13104f();function _0x5a83(){const _0x1a2143=['setViewport','1101162FOovzL','data','info','code','puppeteer','screenshot','1086064cTTYQb','userId','YYYY-MM-DD\x20HH:mm:ss','exception','http','smallAvatarUrl','table','platform','filter','search','98140zLNOtG','format','prototype','(((.+)+)+)+$','warn','dayjs','file:///','path','查询玩家历史位置数据失败,请稍后重试','log','startsWith','close','koishi','未启用\x20puppeteer\x20服务','请输入正确的玩家编号','get','46318PVahwS','todayMileage','return\x20(function()\x20','length','ets','tmp_id','../util/common','121206sXIsQd','{}.constructor(\x22return\x20this\x22)(\x20)','玩家不存在','evaluate','5178132NUejjv','1705968pTHxMm','bind','stringify','toString','console','name','<at\x20','database','promods','#container','查询玩家信息失败,请重试','error','该用户没有绑定玩家编号','image/jpg','has','exports','newPage','indexOf','image','serverId','waitForNetworkIdle','../api/evmOpenApi','mapPlayerHistory','OK:\x20','sleep','substring','playerInfo','constructor','2naBIdt','apply','渲染异常,请重试','startOf','10bjtqRC'];_0x5a83=function(){return _0x1a2143;};return _0x5a83();}const {segment}=require(_0x5e7217(0x18e)),dayjs=require(_0x5e7217(0x187)),{resolve}=require(_0x5e7217(0x189)),common=require(_0x5e7217(0x14a)),{PromodsIds,ServerType}=require('../util/constant'),evmOpenApi=require(_0x5e7217(0x165)),guildBind=require('../database/guildBind');function _0x22c7(_0x48fa49,_0x2459d0){const _0x9c5b4c=_0x5a83();return _0x22c7=function(_0x13104f,_0x2b4930){_0x13104f=_0x13104f-0x14a;let _0x308da9=_0x9c5b4c[_0x13104f];return _0x308da9;},_0x22c7(_0x48fa49,_0x2459d0);}module[_0x5e7217(0x15f)]=async(_0x27957e,_0x109823,_0x2199c9,_0x1d8c0b,_0x1e7fcf)=>{const _0x4553a8=_0x5e7217;if(!_0x27957e[_0x4553a8(0x176)])return _0x4553a8(0x18f);if(_0x1e7fcf&&_0x1e7fcf[_0x4553a8(0x18c)](_0x4553a8(0x156))){_0x1e7fcf[_0x4553a8(0x18c)](_0x4553a8(0x156))&&(queryQQ=_0x1e7fcf['replace'](_0x4553a8(0x156),''));let _0x53133d='';const _0xb5def4=queryQQ[_0x4553a8(0x161)]('id=\x22');if(_0xb5def4!==-0x1){const _0x59936f=_0xb5def4+0x4,_0x1f86b9=queryQQ[_0x4553a8(0x161)]('\x22',_0x59936f);_0x1f86b9!==-0x1&&(_0x53133d=queryQQ[_0x4553a8(0x169)](_0x59936f,_0x1f86b9));}queryQQ=_0x53133d;let _0x2575c1=await guildBind['get'](_0x27957e[_0x4553a8(0x157)],_0x109823[_0x4553a8(0x17f)],queryQQ);if(!_0x2575c1)return _0x4553a8(0x15c);_0x1e7fcf=_0x2575c1[_0x4553a8(0x197)];}if(_0x1e7fcf&&isNaN(_0x1e7fcf))return _0x4553a8(0x190);if(!_0x1e7fcf){let _0x581677=await guildBind[_0x4553a8(0x191)](_0x27957e[_0x4553a8(0x157)],_0x109823[_0x4553a8(0x17f)],_0x109823[_0x4553a8(0x179)]);if(!_0x581677)return'请输入正确的玩家编号';_0x1e7fcf=_0x581677[_0x4553a8(0x197)];}let _0x58069e=await evmOpenApi[_0x4553a8(0x16a)](_0x27957e['http'],_0x1e7fcf);if(_0x58069e[_0x4553a8(0x15b)]&&_0x58069e[_0x4553a8(0x175)]===0x2711)return _0x4553a8(0x14d);if(_0x58069e[_0x4553a8(0x15b)])return _0x4553a8(0x15a);const _0x127e82=dayjs()[_0x4553a8(0x16f)]('day')[_0x4553a8(0x183)](_0x4553a8(0x17a)),_0x469eb9=dayjs()['endOf']('day')[_0x4553a8(0x183)](_0x4553a8(0x17a));let _0x2978cd=await evmOpenApi[_0x4553a8(0x166)](_0x27957e[_0x4553a8(0x17c)],_0x1e7fcf,null,_0x127e82,_0x469eb9);if(_0x2978cd[_0x4553a8(0x15b)])return _0x4553a8(0x18a);const _0x5f01ce=new Set(PromodsIds),_0x669980=_0x2978cd[_0x4553a8(0x173)][_0x4553a8(0x180)](_0x402e32=>{const _0x16a838=_0x4553a8;if(ServerType[_0x16a838(0x196)]===_0x1d8c0b)return!_0x5f01ce[_0x16a838(0x15e)](_0x402e32[_0x16a838(0x163)]);else{if(ServerType[_0x16a838(0x158)]===_0x1d8c0b)return _0x5f01ce[_0x16a838(0x15e)](_0x402e32[_0x16a838(0x163)]);}return![];});if(_0x669980[_0x4553a8(0x195)]===0x0)return'当日暂无数据';let _0xfd9869={'mapType':ServerType['promods']===_0x1d8c0b?_0x4553a8(0x158):_0x4553a8(0x196),'name':_0x58069e['data'][_0x4553a8(0x155)],'smallAvatarUrl':_0x58069e['data'][_0x4553a8(0x17d)],'todayMileage':_0x58069e['data'][_0x4553a8(0x193)],'points':_0x669980},_0x2c759f;try{_0x2c759f=await _0x27957e[_0x4553a8(0x176)]['init']();const _0x114128=await _0x2c759f[_0x4553a8(0x160)]();await _0x114128[_0x4553a8(0x171)]({'width':0x3e8,'height':0x3e8}),await _0x114128['goto'](_0x4553a8(0x188)+resolve(__dirname,'../resource/footprint.html')),await _0x114128[_0x4553a8(0x14e)]('init('+JSON[_0x4553a8(0x152)](_0xfd9869)+')'),await common[_0x4553a8(0x168)](0x64),await _0x114128[_0x4553a8(0x164)]();const _0x319346=await _0x114128['$'](_0x4553a8(0x159)),_0x569941=await _0x319346[_0x4553a8(0x177)]({'encoding':'binary'});return segment[_0x4553a8(0x162)](_0x569941,_0x4553a8(0x15d));}catch(_0x56639e){return _0x4553a8(0x16e);}finally{if(_0x2c759f)await _0x2c759f[_0x4553a8(0x18d)]();}return _0x4553a8(0x167)+_0x58069e[_0x4553a8(0x173)][_0x4553a8(0x155)];};
|
|
@@ -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 _0x3f8878=_0x4362;(function(_0xdbcf24,_0x88e4f9){const _0x568ecd=_0x4362,_0x7ffba4=_0xdbcf24();while(!![]){try{const _0x22073b=parseInt(_0x568ecd(0xc5))/0x1+parseInt(_0x568ecd(0xe6))/0x2*(parseInt(_0x568ecd(0xd9))/0x3)+-parseInt(_0x568ecd(0xdf))/0x4*(-parseInt(_0x568ecd(0xd4))/0x5)+parseInt(_0x568ecd(0xbe))/0x6*(-parseInt(_0x568ecd(0xdb))/0x7)+parseInt(_0x568ecd(0xc9))/0x8+parseInt(_0x568ecd(0xc0))/0x9+parseInt(_0x568ecd(0xd5))/0xa*(-parseInt(_0x568ecd(0xc1))/0xb);if(_0x22073b===_0x88e4f9)break;else _0x7ffba4['push'](_0x7ffba4['shift']());}catch(_0x2f1345){_0x7ffba4['push'](_0x7ffba4['shift']());}}}(_0x4832,0x5923a));const _0x1d487c=(function(){let _0x4d5f98=!![];return function(_0x2ea96d,_0x3486a6){const _0x3fdb51=_0x4d5f98?function(){const _0x96bd60=_0x4362;if(_0x3486a6){const _0x17407a=_0x3486a6[_0x96bd60(0xce)](_0x2ea96d,arguments);return _0x3486a6=null,_0x17407a;}}:function(){};return _0x4d5f98=![],_0x3fdb51;};}()),_0x289b64=_0x1d487c(this,function(){const _0x585b9e=_0x4362;return _0x289b64[_0x585b9e(0xc6)]()[_0x585b9e(0xde)](_0x585b9e(0xe2))[_0x585b9e(0xc6)]()[_0x585b9e(0xe4)](_0x289b64)[_0x585b9e(0xde)]('(((.+)+)+)+$');});_0x289b64();const _0x4112e7=(function(){let _0x3d69cf=!![];return function(_0x4a27c5,_0x4fdd56){const _0x599f05=_0x3d69cf?function(){const _0x403f56=_0x4362;if(_0x4fdd56){const _0x1d45d=_0x4fdd56[_0x403f56(0xce)](_0x4a27c5,arguments);return _0x4fdd56=null,_0x1d45d;}}:function(){};return _0x3d69cf=![],_0x599f05;};}()),_0x1b8785=_0x4112e7(this,function(){const _0x47333b=_0x4362,_0x1148b1=function(){const _0x3b166d=_0x4362;let _0x1bf536;try{_0x1bf536=Function(_0x3b166d(0xba)+_0x3b166d(0xd2)+');')();}catch(_0x35f79b){_0x1bf536=window;}return _0x1bf536;},_0x45a345=_0x1148b1(),_0x149811=_0x45a345[_0x47333b(0xca)]=_0x45a345[_0x47333b(0xca)]||{},_0x1051da=[_0x47333b(0xee),_0x47333b(0xda),_0x47333b(0xc7),_0x47333b(0xd1),'exception',_0x47333b(0xb7),_0x47333b(0xe7)];for(let _0x23f4cf=0x0;_0x23f4cf<_0x1051da['length'];_0x23f4cf++){const _0x3790a4=_0x4112e7['constructor'][_0x47333b(0xdd)][_0x47333b(0xbb)](_0x4112e7),_0x2a74f9=_0x1051da[_0x23f4cf],_0x92b8c3=_0x149811[_0x2a74f9]||_0x3790a4;_0x3790a4[_0x47333b(0xe1)]=_0x4112e7[_0x47333b(0xbb)](_0x4112e7),_0x3790a4[_0x47333b(0xc6)]=_0x92b8c3['toString']['bind'](_0x92b8c3),_0x149811[_0x2a74f9]=_0x3790a4;}});_0x1b8785();const {segment}=require(_0x3f8878(0xb9)),{resolve}=require(_0x3f8878(0xb4)),common=require(_0x3f8878(0xbf)),evmOpenApi=require(_0x3f8878(0xed)),guildBind=require(_0x3f8878(0xb8));module[_0x3f8878(0xcd)]=async(_0x12ddb1,_0x747ff3,_0x5cd211)=>{const _0x2c4e25=_0x3f8878;if(!_0x12ddb1[_0x2c4e25(0xcc)])return _0x2c4e25(0xea);let _0xce2daa=await evmOpenApi[_0x2c4e25(0xcb)](_0x12ddb1[_0x2c4e25(0xc3)],_0x5cd211,null);if(_0xce2daa[_0x2c4e25(0xd1)])return _0x2c4e25(0xd0);else{if(_0xce2daa[_0x2c4e25(0xcf)][_0x2c4e25(0xbc)]===0x0)return _0x2c4e25(0xbd);}let _0x5836b8=await guildBind[_0x2c4e25(0xeb)](_0x12ddb1[_0x2c4e25(0xc4)],_0x747ff3[_0x2c4e25(0xc8)],_0x747ff3[_0x2c4e25(0xd3)]),_0x506b49=null;if(_0x5836b8){let _0x41388e=await evmOpenApi[_0x2c4e25(0xcb)](_0x12ddb1[_0x2c4e25(0xc3)],_0x5cd211,_0x5836b8[_0x2c4e25(0xe3)]);!_0x41388e[_0x2c4e25(0xd1)]&&_0x41388e[_0x2c4e25(0xcf)][_0x2c4e25(0xbc)]>0x0&&(_0x506b49=_0x41388e[_0x2c4e25(0xcf)][0x0]);}let _0x1e00c1={'rankingType':_0x5cd211,'mileageRankingList':_0xce2daa[_0x2c4e25(0xcf)],'playerMileageRanking':_0x506b49},_0x4260d9;try{_0x4260d9=await _0x12ddb1[_0x2c4e25(0xcc)][_0x2c4e25(0xe9)](),await _0x4260d9[_0x2c4e25(0xd6)]({'width':0x3e8,'height':0x3e8}),await _0x4260d9[_0x2c4e25(0xe5)](_0x2c4e25(0xe8)+resolve(__dirname,'../resource/mileage-leaderboard.html')),await _0x4260d9[_0x2c4e25(0xdc)](_0x2c4e25(0xb6)+JSON[_0x2c4e25(0xec)](_0x1e00c1)+')'),await _0x4260d9['waitForNetworkIdle'](),await common[_0x2c4e25(0xb5)](0x1f4);const _0x54d993=await _0x4260d9['$'](_0x2c4e25(0xc2));return segment['image'](await _0x54d993['screenshot']({'encoding':_0x2c4e25(0xd8)}),'image/jpg');}catch(_0x49671a){return console[_0x2c4e25(0xc7)](_0x49671a),_0x2c4e25(0xd7);}finally{_0x4260d9&&await _0x4260d9[_0x2c4e25(0xe0)]();}};function _0x4362(_0x376b6e,_0x2d35e9){const _0x3c07af=_0x4832();return _0x4362=function(_0x1b8785,_0x4112e7){_0x1b8785=_0x1b8785-0xb4;let _0x3cf80e=_0x3c07af[_0x1b8785];return _0x3cf80e;},_0x4362(_0x376b6e,_0x2d35e9);}function _0x4832(){const _0x50e41c=['4182327YuXpvY','121YSbFVK','#container','http','database','372936iKrLvD','toString','info','platform','1870472loswni','console','mileageRankingList','puppeteer','exports','apply','data','查询排行榜信息失败','error','{}.constructor(\x22return\x20this\x22)(\x20)','userId','55gwZCOt','1165730cDHdWs','setViewport','渲染异常,请重试','binary','24ZvAFMD','warn','1206086HFrVWs','evaluate','prototype','search','235324DVtRLU','close','__proto__','(((.+)+)+)+$','tmp_id','constructor','goto','68356aoPMKs','trace','file:///','page','未启用\x20Puppeteer\x20功能','get','stringify','../api/evmOpenApi','log','path','sleep','setData(','table','../database/guildBind','koishi','return\x20(function()\x20','bind','length','暂无数据','12lssaMF','../util/common'];_0x4832=function(){return _0x50e41c;};return _0x4832();}
|
|
@@ -1,123 +1 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const { resolve } = require('path')
|
|
3
|
-
const guildBind = require('../database/guildBind')
|
|
4
|
-
const truckyAppApi = require('../api/truckyAppApi')
|
|
5
|
-
const truckersMpApi = require('../api/truckersMpApi')
|
|
6
|
-
const evmOpenApi = require('../api/evmOpenApi')
|
|
7
|
-
const baiduTranslate = require('../util/baiduTranslate')
|
|
8
|
-
const common = require('../util/common')
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 定位
|
|
12
|
-
*/
|
|
13
|
-
module.exports = async (ctx, cfg, session, tmpId) => {
|
|
14
|
-
if (ctx.puppeteer) {
|
|
15
|
-
if (tmpId && tmpId.startsWith("<at ")) {
|
|
16
|
-
if (tmpId.startsWith('<at ')) {
|
|
17
|
-
queryQQ = tmpId.replace('<at ', '');
|
|
18
|
-
}
|
|
19
|
-
let id = '';
|
|
20
|
-
const idStart = queryQQ.indexOf('id="');
|
|
21
|
-
if (idStart !== -1) {
|
|
22
|
-
const valueStart = idStart + 4;
|
|
23
|
-
const valueEnd = queryQQ.indexOf('"', valueStart);
|
|
24
|
-
if (valueEnd !== -1) {
|
|
25
|
-
id = queryQQ.substring(valueStart, valueEnd);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
queryQQ = id;
|
|
29
|
-
let guildBindData = await guildBind.get(ctx.database, session.platform, queryQQ);
|
|
30
|
-
if (!guildBindData) {
|
|
31
|
-
return `该用户没有绑定玩家编号`;
|
|
32
|
-
}
|
|
33
|
-
tmpId = guildBindData.tmp_id;
|
|
34
|
-
}
|
|
35
|
-
// 如果没有传入tmpId,尝试从数据库查询绑定信息
|
|
36
|
-
if (!tmpId) {
|
|
37
|
-
let guildBindData = await guildBind.get(ctx.database, session.platform, session.userId)
|
|
38
|
-
if (!guildBindData) {
|
|
39
|
-
return `请输入正确的玩家编号`
|
|
40
|
-
}
|
|
41
|
-
tmpId = guildBindData.tmp_id
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// 查询玩家信息
|
|
45
|
-
let playerInfo = await truckersMpApi.player(ctx.http, tmpId)
|
|
46
|
-
if (playerInfo.error) {
|
|
47
|
-
return '查询玩家信息失败,请重试'
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// 查询线上信息
|
|
51
|
-
let playerMapInfo = await truckyAppApi.online(ctx.http, tmpId)
|
|
52
|
-
if (playerMapInfo.error) {
|
|
53
|
-
return '查询玩家线上信息失败,请重试'
|
|
54
|
-
}
|
|
55
|
-
if (!playerMapInfo.data.online) {
|
|
56
|
-
return '玩家离线'
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// 查询周边玩家,并处理数据
|
|
60
|
-
let areaPlayersData = await evmOpenApi.mapPlayerList(ctx.http, playerMapInfo.data.server,
|
|
61
|
-
playerMapInfo.data.x - 4000,
|
|
62
|
-
playerMapInfo.data.y + 2500,
|
|
63
|
-
playerMapInfo.data.x + 4000,
|
|
64
|
-
playerMapInfo.data.y - 2500)
|
|
65
|
-
let areaPlayerList = []
|
|
66
|
-
if (!areaPlayersData.error) {
|
|
67
|
-
areaPlayerList = areaPlayersData.data
|
|
68
|
-
let index = areaPlayerList.findIndex((player) => {
|
|
69
|
-
return player.tmpId.toString() === tmpId.toString()
|
|
70
|
-
})
|
|
71
|
-
if (index !== -1) {
|
|
72
|
-
areaPlayerList.splice(index, 1)
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
areaPlayerList.push({
|
|
76
|
-
axisX: playerMapInfo.data.x,
|
|
77
|
-
axisY: playerMapInfo.data.y,
|
|
78
|
-
tmpId
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
// promods服ID集合
|
|
82
|
-
let promodsServerIdList = [50, 51]
|
|
83
|
-
|
|
84
|
-
// 构建地图数据
|
|
85
|
-
let data = {
|
|
86
|
-
mapType: promodsServerIdList.indexOf(playerMapInfo.data.server) !== -1 ? 'promods' : 'ets',
|
|
87
|
-
avatar: playerInfo.data.smallAvatar,
|
|
88
|
-
username: playerInfo.data.name,
|
|
89
|
-
serverName: playerMapInfo.data.serverDetails.name,
|
|
90
|
-
country: await baiduTranslate(ctx, cfg, playerMapInfo.data.location.poi.country),
|
|
91
|
-
realName: await baiduTranslate(ctx, cfg, playerMapInfo.data.location.poi.realName),
|
|
92
|
-
currentPlayerId: tmpId,
|
|
93
|
-
centerX: playerMapInfo.data.x,
|
|
94
|
-
centerY: playerMapInfo.data.y,
|
|
95
|
-
playerList: areaPlayerList
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
let page
|
|
99
|
-
try {
|
|
100
|
-
page = await ctx.puppeteer.page()
|
|
101
|
-
await page.setViewport({ width: 1000, height: 1000 })
|
|
102
|
-
await page.goto(`file:///${resolve(__dirname, '../resource/position.html')}`)
|
|
103
|
-
await page.evaluate(`setData(${JSON.stringify(data)})`)
|
|
104
|
-
await common.sleep(100)
|
|
105
|
-
await page.waitForNetworkIdle()
|
|
106
|
-
const element = await page.$("#container");
|
|
107
|
-
return (
|
|
108
|
-
segment.image(await element.screenshot({
|
|
109
|
-
encoding: "binary"
|
|
110
|
-
}), "image/jpg")
|
|
111
|
-
)
|
|
112
|
-
} catch (e) {
|
|
113
|
-
return '渲染异常,请重试'
|
|
114
|
-
} finally {
|
|
115
|
-
if (page) {
|
|
116
|
-
await page.close()
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
} else {
|
|
121
|
-
return '未启用 puppeteer 服务'
|
|
122
|
-
}
|
|
123
|
-
}
|
|
1
|
+
const _0x3f95b4=_0xda9c;function _0x2b31(){const _0x2636f6=['bind','close','(((.+)+)+)+$','server','13800104OZVGIr','goto','smallAvatar','path','realName','binary','log','http','poi','175033YTqVjJ','replace','setViewport','search','table','setData(','mapPlayerList','file:///','{}.constructor(\x22return\x20this\x22)(\x20)','serverDetails','../resource/position.html','tmp_id','country','3461506KMuuya','page','return\x20(function()\x20','indexOf','14PkxsSj','ets','12maxskV','请输入正确的玩家编号','id=\x22','error','tmpId','constructor','sleep','evaluate','substring','该用户没有绑定玩家编号','apply','../database/guildBind','data','toString','未启用\x20puppeteer\x20服务','get','prototype','玩家离线','渲染异常,请重试','puppeteer','查询玩家信息失败,请重试','3874020oAMFTZ','userId','player','../util/baiduTranslate','length','3129255aCePLI','push','info','location','promods','8187750xyhmXs','startsWith','../util/common','findIndex','online','exports','735204LLJUbQ','image/jpg','name','database','console','platform'];_0x2b31=function(){return _0x2636f6;};return _0x2b31();}(function(_0x2379d1,_0x20e600){const _0x104676=_0xda9c,_0x56f875=_0x2379d1();while(!![]){try{const _0x4f1519=parseInt(_0x104676(0x117))/0x1+-parseInt(_0x104676(0x124))/0x2+-parseInt(_0x104676(0x12a))/0x3*(-parseInt(_0x104676(0x104))/0x4)+parseInt(_0x104676(0xfe))/0x5+parseInt(_0x104676(0xf4))/0x6*(-parseInt(_0x104676(0x128))/0x7)+parseInt(_0x104676(0x10e))/0x8+-parseInt(_0x104676(0xf9))/0x9;if(_0x4f1519===_0x20e600)break;else _0x56f875['push'](_0x56f875['shift']());}catch(_0x41d38d){_0x56f875['push'](_0x56f875['shift']());}}}(_0x2b31,0xdc764));const _0x155ef6=(function(){let _0x69898d=!![];return function(_0x2f62ef,_0x2fc92f){const _0x5f199a=_0x69898d?function(){const _0x3a2600=_0xda9c;if(_0x2fc92f){const _0x42aeab=_0x2fc92f[_0x3a2600(0x134)](_0x2f62ef,arguments);return _0x2fc92f=null,_0x42aeab;}}:function(){};return _0x69898d=![],_0x5f199a;};}()),_0x45e340=_0x155ef6(this,function(){const _0x557f03=_0xda9c;return _0x45e340[_0x557f03(0x137)]()[_0x557f03(0x11a)]('(((.+)+)+)+$')['toString']()[_0x557f03(0x12f)](_0x45e340)[_0x557f03(0x11a)](_0x557f03(0x10c));});_0x45e340();const _0xc9621e=(function(){let _0x59022a=!![];return function(_0x55de41,_0x20f3b2){const _0x3ade3a=_0x59022a?function(){const _0x22e6a4=_0xda9c;if(_0x20f3b2){const _0x4dbe8a=_0x20f3b2[_0x22e6a4(0x134)](_0x55de41,arguments);return _0x20f3b2=null,_0x4dbe8a;}}:function(){};return _0x59022a=![],_0x3ade3a;};}()),_0x2f613f=_0xc9621e(this,function(){const _0x5bfaac=_0xda9c;let _0x11cd95;try{const _0x759bab=Function(_0x5bfaac(0x126)+_0x5bfaac(0x11f)+');');_0x11cd95=_0x759bab();}catch(_0x55e281){_0x11cd95=window;}const _0x2f298c=_0x11cd95[_0x5bfaac(0x108)]=_0x11cd95[_0x5bfaac(0x108)]||{},_0x168df4=[_0x5bfaac(0x114),'warn',_0x5bfaac(0xfb),_0x5bfaac(0x12d),'exception',_0x5bfaac(0x11b),'trace'];for(let _0x4c947c=0x0;_0x4c947c<_0x168df4[_0x5bfaac(0xf8)];_0x4c947c++){const _0x407a24=_0xc9621e[_0x5bfaac(0x12f)][_0x5bfaac(0xef)]['bind'](_0xc9621e),_0x1b2237=_0x168df4[_0x4c947c],_0x5eef71=_0x2f298c[_0x1b2237]||_0x407a24;_0x407a24['__proto__']=_0xc9621e[_0x5bfaac(0x10a)](_0xc9621e),_0x407a24[_0x5bfaac(0x137)]=_0x5eef71[_0x5bfaac(0x137)]['bind'](_0x5eef71),_0x2f298c[_0x1b2237]=_0x407a24;}});function _0xda9c(_0x281d09,_0x56183d){const _0x3d7d49=_0x2b31();return _0xda9c=function(_0x2f613f,_0xc9621e){_0x2f613f=_0x2f613f-0xef;let _0x11905f=_0x3d7d49[_0x2f613f];return _0x11905f;},_0xda9c(_0x281d09,_0x56183d);}_0x2f613f();const {segment}=require('koishi'),{resolve}=require(_0x3f95b4(0x111)),guildBind=require(_0x3f95b4(0x135)),truckyAppApi=require('../api/truckyAppApi'),truckersMpApi=require('../api/truckersMpApi'),evmOpenApi=require('../api/evmOpenApi'),baiduTranslate=require(_0x3f95b4(0xf7)),common=require(_0x3f95b4(0x100));module[_0x3f95b4(0x103)]=async(_0x192ab4,_0x5b5a71,_0x320071,_0x197561)=>{const _0xb00feb=_0x3f95b4;if(_0x192ab4['puppeteer']){if(_0x197561&&_0x197561[_0xb00feb(0xff)]('<at\x20')){_0x197561[_0xb00feb(0xff)]('<at\x20')&&(queryQQ=_0x197561[_0xb00feb(0x118)]('<at\x20',''));let _0x267e6a='';const _0x41778b=queryQQ['indexOf'](_0xb00feb(0x12c));if(_0x41778b!==-0x1){const _0x2cdf9e=_0x41778b+0x4,_0x940492=queryQQ[_0xb00feb(0x127)]('\x22',_0x2cdf9e);_0x940492!==-0x1&&(_0x267e6a=queryQQ[_0xb00feb(0x132)](_0x2cdf9e,_0x940492));}queryQQ=_0x267e6a;let _0x3570c0=await guildBind['get'](_0x192ab4[_0xb00feb(0x107)],_0x320071['platform'],queryQQ);if(!_0x3570c0)return _0xb00feb(0x133);_0x197561=_0x3570c0[_0xb00feb(0x122)];}if(!_0x197561){let _0x1304e3=await guildBind[_0xb00feb(0x139)](_0x192ab4['database'],_0x320071[_0xb00feb(0x109)],_0x320071[_0xb00feb(0xf5)]);if(!_0x1304e3)return _0xb00feb(0x12b);_0x197561=_0x1304e3[_0xb00feb(0x122)];}let _0x4edd4c=await truckersMpApi[_0xb00feb(0xf6)](_0x192ab4[_0xb00feb(0x115)],_0x197561);if(_0x4edd4c[_0xb00feb(0x12d)])return _0xb00feb(0xf3);let _0x130fd8=await truckyAppApi[_0xb00feb(0x102)](_0x192ab4['http'],_0x197561);if(_0x130fd8['error'])return'查询玩家线上信息失败,请重试';if(!_0x130fd8['data'][_0xb00feb(0x102)])return _0xb00feb(0xf0);let _0x3a6998=await evmOpenApi[_0xb00feb(0x11d)](_0x192ab4[_0xb00feb(0x115)],_0x130fd8[_0xb00feb(0x136)][_0xb00feb(0x10d)],_0x130fd8[_0xb00feb(0x136)]['x']-0xfa0,_0x130fd8[_0xb00feb(0x136)]['y']+0x9c4,_0x130fd8[_0xb00feb(0x136)]['x']+0xfa0,_0x130fd8['data']['y']-0x9c4),_0x43c8be=[];if(!_0x3a6998['error']){_0x43c8be=_0x3a6998[_0xb00feb(0x136)];let _0x801929=_0x43c8be[_0xb00feb(0x101)](_0x428993=>{const _0x29fb3b=_0xb00feb;return _0x428993[_0x29fb3b(0x12e)][_0x29fb3b(0x137)]()===_0x197561['toString']();});_0x801929!==-0x1&&_0x43c8be['splice'](_0x801929,0x1);}_0x43c8be[_0xb00feb(0xfa)]({'axisX':_0x130fd8[_0xb00feb(0x136)]['x'],'axisY':_0x130fd8['data']['y'],'tmpId':_0x197561});let _0xbb9a88=[0x32,0x33],_0x45f297={'mapType':_0xbb9a88[_0xb00feb(0x127)](_0x130fd8[_0xb00feb(0x136)][_0xb00feb(0x10d)])!==-0x1?_0xb00feb(0xfd):_0xb00feb(0x129),'avatar':_0x4edd4c[_0xb00feb(0x136)][_0xb00feb(0x110)],'username':_0x4edd4c[_0xb00feb(0x136)][_0xb00feb(0x106)],'serverName':_0x130fd8['data'][_0xb00feb(0x120)][_0xb00feb(0x106)],'country':await baiduTranslate(_0x192ab4,_0x5b5a71,_0x130fd8[_0xb00feb(0x136)][_0xb00feb(0xfc)][_0xb00feb(0x116)][_0xb00feb(0x123)]),'realName':await baiduTranslate(_0x192ab4,_0x5b5a71,_0x130fd8[_0xb00feb(0x136)]['location'][_0xb00feb(0x116)][_0xb00feb(0x112)]),'currentPlayerId':_0x197561,'centerX':_0x130fd8[_0xb00feb(0x136)]['x'],'centerY':_0x130fd8[_0xb00feb(0x136)]['y'],'playerList':_0x43c8be},_0x1cf267;try{_0x1cf267=await _0x192ab4[_0xb00feb(0xf2)][_0xb00feb(0x125)](),await _0x1cf267[_0xb00feb(0x119)]({'width':0x3e8,'height':0x3e8}),await _0x1cf267[_0xb00feb(0x10f)](_0xb00feb(0x11e)+resolve(__dirname,_0xb00feb(0x121))),await _0x1cf267[_0xb00feb(0x131)](_0xb00feb(0x11c)+JSON['stringify'](_0x45f297)+')'),await common[_0xb00feb(0x130)](0x64),await _0x1cf267['waitForNetworkIdle']();const _0x18473e=await _0x1cf267['$']('#container');return segment['image'](await _0x18473e['screenshot']({'encoding':_0xb00feb(0x113)}),_0xb00feb(0x105));}catch(_0x5aa798){return _0xb00feb(0xf1);}finally{_0x1cf267&&await _0x1cf267[_0xb00feb(0x10b)]();}}else return _0xb00feb(0x138);};
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
const tmpQueryText = require(
|
|
2
|
-
const tmpQueryImg = require("./tmpQueryImg");
|
|
3
|
-
module.exports = async (ctx, cfg, session, tmpId) => {
|
|
4
|
-
switch (cfg.tmpQuery?.type) {
|
|
5
|
-
case 1:
|
|
6
|
-
return await tmpQueryText(ctx, cfg, session, tmpId);
|
|
7
|
-
case 2:
|
|
8
|
-
return await tmpQueryImg(ctx, cfg, session, tmpId);
|
|
9
|
-
default:
|
|
10
|
-
return '指令配置错误';
|
|
11
|
-
}
|
|
12
|
-
};
|
|
1
|
+
const _0x598cec=_0x12ed;function _0x50a6(){const _0x547b61=['407274fitSph','__proto__','(((.+)+)+)+$','指令配置错误','18414810WIBtQX','toString','3331248AtZYnJ','prototype','{}.constructor(\x22return\x20this\x22)(\x20)','212476vgSlXZ','./tmpQueryImg','2409642fLCMnX','constructor','42696gBViME','exports','table','153sfDAjz','bind','480XtaXpi','21lCbcxj','search','console','length','exception','./tmpQueryText','21140KpuULO','apply','tmpQuery','return\x20(function()\x20'];_0x50a6=function(){return _0x547b61;};return _0x50a6();}(function(_0x4e8425,_0x1067c4){const _0x18c89d=_0x12ed,_0x5676e5=_0x4e8425();while(!![]){try{const _0xec368e=-parseInt(_0x18c89d(0x7f))/0x1+-parseInt(_0x18c89d(0x81))/0x2+parseInt(_0x18c89d(0x7c))/0x3+parseInt(_0x18c89d(0x88))/0x4*(-parseInt(_0x18c89d(0x8f))/0x5)+-parseInt(_0x18c89d(0x93))/0x6*(parseInt(_0x18c89d(0x89))/0x7)+parseInt(_0x18c89d(0x83))/0x8*(parseInt(_0x18c89d(0x86))/0x9)+parseInt(_0x18c89d(0x97))/0xa;if(_0xec368e===_0x1067c4)break;else _0x5676e5['push'](_0x5676e5['shift']());}catch(_0x580c06){_0x5676e5['push'](_0x5676e5['shift']());}}}(_0x50a6,0xdf39c));const _0xc812cf=(function(){let _0x49b097=!![];return function(_0x5df16a,_0x228f99){const _0x68968a=_0x49b097?function(){const _0x19f2bd=_0x12ed;if(_0x228f99){const _0xafedd3=_0x228f99[_0x19f2bd(0x90)](_0x5df16a,arguments);return _0x228f99=null,_0xafedd3;}}:function(){};return _0x49b097=![],_0x68968a;};}()),_0x4ac92d=_0xc812cf(this,function(){const _0x2e0715=_0x12ed;return _0x4ac92d[_0x2e0715(0x7b)]()[_0x2e0715(0x8a)](_0x2e0715(0x95))[_0x2e0715(0x7b)]()[_0x2e0715(0x82)](_0x4ac92d)['search'](_0x2e0715(0x95));});_0x4ac92d();const _0x12ee55=(function(){let _0x184ff7=!![];return function(_0x3b4018,_0x3bd5f0){const _0x46a700=_0x184ff7?function(){const _0x1e3ba2=_0x12ed;if(_0x3bd5f0){const _0xdfd729=_0x3bd5f0[_0x1e3ba2(0x90)](_0x3b4018,arguments);return _0x3bd5f0=null,_0xdfd729;}}:function(){};return _0x184ff7=![],_0x46a700;};}()),_0x4fd320=_0x12ee55(this,function(){const _0x81f9b5=_0x12ed,_0x476c18=function(){const _0x3f1325=_0x12ed;let _0x93566d;try{_0x93566d=Function(_0x3f1325(0x92)+_0x3f1325(0x7e)+');')();}catch(_0x3771ba){_0x93566d=window;}return _0x93566d;},_0x842ec=_0x476c18(),_0x24ed61=_0x842ec[_0x81f9b5(0x8b)]=_0x842ec['console']||{},_0x43d9e2=['log','warn','info','error',_0x81f9b5(0x8d),_0x81f9b5(0x85),'trace'];for(let _0x3ac3a3=0x0;_0x3ac3a3<_0x43d9e2[_0x81f9b5(0x8c)];_0x3ac3a3++){const _0x507819=_0x12ee55[_0x81f9b5(0x82)][_0x81f9b5(0x7d)][_0x81f9b5(0x87)](_0x12ee55),_0x19057e=_0x43d9e2[_0x3ac3a3],_0x15c43b=_0x24ed61[_0x19057e]||_0x507819;_0x507819[_0x81f9b5(0x94)]=_0x12ee55[_0x81f9b5(0x87)](_0x12ee55),_0x507819['toString']=_0x15c43b['toString'][_0x81f9b5(0x87)](_0x15c43b),_0x24ed61[_0x19057e]=_0x507819;}});_0x4fd320();const tmpQueryText=require(_0x598cec(0x8e)),tmpQueryImg=require(_0x598cec(0x80));function _0x12ed(_0x5d2bbf,_0xe8fcb){const _0x161d24=_0x50a6();return _0x12ed=function(_0x4fd320,_0x12ee55){_0x4fd320=_0x4fd320-0x7b;let _0x3af25a=_0x161d24[_0x4fd320];return _0x3af25a;},_0x12ed(_0x5d2bbf,_0xe8fcb);}module[_0x598cec(0x84)]=async(_0x6a4626,_0x16ad21,_0x531de4,_0xde39df)=>{const _0xa34ec7=_0x598cec;switch(_0x16ad21[_0xa34ec7(0x91)]?.['type']){case 0x1:return await tmpQueryText(_0x6a4626,_0x16ad21,_0x531de4,_0xde39df);case 0x2:return await tmpQueryImg(_0x6a4626,_0x16ad21,_0x531de4,_0xde39df);default:return _0xa34ec7(0x96);}};
|
|
@@ -1,103 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
const guildBind = require('../../database/guildBind');
|
|
3
|
-
const truckyAppApi = require('../../api/truckyAppApi');
|
|
4
|
-
const evmOpenApi = require('../../api/evmOpenApi');
|
|
5
|
-
const baiduTranslate = require('../../util/baiduTranslate');
|
|
6
|
-
const { resolve } = require("path");
|
|
7
|
-
const common = require("../../util/common");
|
|
8
|
-
const { segment } = require("koishi");
|
|
9
|
-
/**
|
|
10
|
-
* 用户组
|
|
11
|
-
*/
|
|
12
|
-
const userGroup = {
|
|
13
|
-
'Player': '玩家',
|
|
14
|
-
'Retired Legend': '退役',
|
|
15
|
-
'Game Developer': '游戏开发者',
|
|
16
|
-
'Retired Team Member': '退休团队成员',
|
|
17
|
-
'Add-On Team': '附加组件团队',
|
|
18
|
-
'Game Moderator': '游戏管理员'
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* 查询玩家信息
|
|
22
|
-
*/
|
|
23
|
-
module.exports = async (ctx, cfg, session, tmpId) => {
|
|
24
|
-
if (!ctx.puppeteer) {
|
|
25
|
-
return '未启用 puppeteer 服务';
|
|
26
|
-
}
|
|
27
|
-
if (tmpId && isNaN(tmpId)) {
|
|
28
|
-
return `请输入正确的玩家编号`;
|
|
29
|
-
}
|
|
30
|
-
// 如果没有传入tmpId,尝试从数据库查询绑定信息
|
|
31
|
-
if (!tmpId) {
|
|
32
|
-
let guildBindData = await guildBind.get(ctx.database, session.platform, session.userId);
|
|
33
|
-
if (!guildBindData) {
|
|
34
|
-
return `请输入正确的玩家编号`;
|
|
35
|
-
}
|
|
36
|
-
tmpId = guildBindData.tmp_id;
|
|
37
|
-
}
|
|
38
|
-
// 查询玩家信息
|
|
39
|
-
let playerInfo = await evmOpenApi.playerInfo(ctx.http, tmpId);
|
|
40
|
-
if (playerInfo.error && playerInfo.code === 10001) {
|
|
41
|
-
return '玩家不存在';
|
|
42
|
-
}
|
|
43
|
-
else if (playerInfo.error) {
|
|
44
|
-
return '查询玩家信息失败,请重试';
|
|
45
|
-
}
|
|
46
|
-
// 查询线上信息
|
|
47
|
-
let playerMapInfo = await truckyAppApi.online(ctx.http, tmpId);
|
|
48
|
-
// 拼接数据
|
|
49
|
-
let data = {};
|
|
50
|
-
data.tmpId = playerInfo.data.tmpId;
|
|
51
|
-
data.name = playerInfo.data.name;
|
|
52
|
-
data.steamId = playerInfo.data.steamId;
|
|
53
|
-
data.registerDate = dayjs(playerInfo.data.registerTime).format('YYYY年MM月DD日');
|
|
54
|
-
data.avatarUrl = playerInfo.data.avatarUrl;
|
|
55
|
-
data.groupColor = playerInfo.data.groupColor;
|
|
56
|
-
data.groupName = (userGroup[playerInfo.data.groupName] || playerInfo.data.groupName);
|
|
57
|
-
data.isJoinVtc = playerInfo.data.isJoinVtc;
|
|
58
|
-
data.vtcName = playerInfo.data.vtcName;
|
|
59
|
-
data.vtcRole = playerInfo.data.vtcRole;
|
|
60
|
-
data.isSponsor = playerInfo.data.isSponsor;
|
|
61
|
-
data.sponsorAmount = playerInfo.data.sponsorAmount;
|
|
62
|
-
data.sponsorCumulativeAmount = playerInfo.data.sponsorCumulativeAmount;
|
|
63
|
-
data.sponsorHide = playerInfo.data.sponsorHide;
|
|
64
|
-
data.isOnline = false;
|
|
65
|
-
if (playerMapInfo && !playerMapInfo.error) {
|
|
66
|
-
data.isOnline = playerMapInfo.data.online;
|
|
67
|
-
if (data.isOnline) {
|
|
68
|
-
data.onlineServerName = playerMapInfo.data.serverDetails.name;
|
|
69
|
-
data.onlineCountry = await baiduTranslate(ctx, cfg, playerMapInfo.data.location.poi.country);
|
|
70
|
-
data.onlineCity = await baiduTranslate(ctx, cfg, playerMapInfo.data.location.poi.realName);
|
|
71
|
-
data.onlineX = playerMapInfo.data.x;
|
|
72
|
-
data.onlineY = playerMapInfo.data.y;
|
|
73
|
-
data.onlineMapType = playerMapInfo.data.serverDetails.id === 50 ? 'promods' : 'ets';
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
data.isBan = playerInfo.data.isBan;
|
|
77
|
-
data.banUntil = playerInfo.data.banUntil;
|
|
78
|
-
data.banReason = playerInfo.data.banReason;
|
|
79
|
-
data.banReasonZh = playerInfo.data.banReasonZh;
|
|
80
|
-
data.banCount = playerInfo.data.banCount;
|
|
81
|
-
data.banHide = playerInfo.data.banHide;
|
|
82
|
-
let page;
|
|
83
|
-
try {
|
|
84
|
-
page = await ctx.puppeteer.page();
|
|
85
|
-
await page.setViewport({ width: 1000, height: 1000 });
|
|
86
|
-
await page.goto(`file:///${resolve(__dirname, '../../resource/query.html')}`);
|
|
87
|
-
await page.evaluate(`init(${JSON.stringify(data)})`);
|
|
88
|
-
await common.sleep(100);
|
|
89
|
-
await page.waitForNetworkIdle();
|
|
90
|
-
const element = await page.$("#container");
|
|
91
|
-
return (segment.image(await element.screenshot({
|
|
92
|
-
encoding: "binary"
|
|
93
|
-
}), "image/jpg"));
|
|
94
|
-
}
|
|
95
|
-
catch {
|
|
96
|
-
return '渲染异常,请重试';
|
|
97
|
-
}
|
|
98
|
-
finally {
|
|
99
|
-
if (page) {
|
|
100
|
-
await page.close();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
};
|
|
1
|
+
const _0x8f599d=_0x1a60;function _0x1a60(_0x5d8be6,_0xab7aee){const _0x46fdb5=_0x335c();return _0x1a60=function(_0x3800a1,_0xad46d4){_0x3800a1=_0x3800a1-0xb1;let _0x5ce37b=_0x46fdb5[_0x3800a1];return _0x5ce37b;},_0x1a60(_0x5d8be6,_0xab7aee);}(function(_0x5a23d2,_0x2e569e){const _0x1dd73c=_0x1a60,_0x3da3b7=_0x5a23d2();while(!![]){try{const _0x58643c=-parseInt(_0x1dd73c(0xb9))/0x1*(parseInt(_0x1dd73c(0xee))/0x2)+-parseInt(_0x1dd73c(0xe6))/0x3+-parseInt(_0x1dd73c(0xc3))/0x4*(parseInt(_0x1dd73c(0xe0))/0x5)+-parseInt(_0x1dd73c(0xdc))/0x6+parseInt(_0x1dd73c(0xc0))/0x7*(-parseInt(_0x1dd73c(0xcd))/0x8)+parseInt(_0x1dd73c(0xc5))/0x9*(-parseInt(_0x1dd73c(0xb3))/0xa)+parseInt(_0x1dd73c(0xd6))/0xb;if(_0x58643c===_0x2e569e)break;else _0x3da3b7['push'](_0x3da3b7['shift']());}catch(_0x5b1ba1){_0x3da3b7['push'](_0x3da3b7['shift']());}}}(_0x335c,0x63f21));const _0xb28451=(function(){let _0x58aa83=!![];return function(_0x1ab1d,_0x5123b3){const _0x43b029=_0x58aa83?function(){if(_0x5123b3){const _0x3ae5f5=_0x5123b3['apply'](_0x1ab1d,arguments);return _0x5123b3=null,_0x3ae5f5;}}:function(){};return _0x58aa83=![],_0x43b029;};}()),_0x24b3aa=_0xb28451(this,function(){const _0x12e39b=_0x1a60;return _0x24b3aa[_0x12e39b(0x107)]()[_0x12e39b(0xe3)]('(((.+)+)+)+$')['toString']()[_0x12e39b(0xc9)](_0x24b3aa)['search'](_0x12e39b(0xde));});function _0x335c(){const _0x8ad03a=['exports','banUntil','close','country','toString','platform','error','1928620RPTxBd','return\x20(function()\x20','console','../../api/truckyAppApi','http','banHide','148046tPkTKe','steamId','isOnline','info','playerInfo','evaluate','apply','7KYbBLF','附加组件团队','name','3008556HrsXqQ','puppeteer','27rukYgC','code','isBan','isJoinVtc','constructor','poi','bind','table','4220016VhUtuC','请输入正确的玩家编号','banCount','data','trace','banReasonZh','玩家不存在','vtcName','init(','45067902ZbifNt','warn','vtcRole','setViewport','sponsorAmount','退休团队成员','3945162uULdzT','database','(((.+)+)+)+$','registerTime','5UvgqGT','length','koishi','search','goto','promods','2183439sbaFvh','渲染异常,请重试','online','get','tmpId','ets','查询玩家信息失败,请重试','avatarUrl','6jNOxoh','sleep','onlineServerName','__proto__','tmp_id','log','../../util/baiduTranslate','../../api/evmOpenApi','registerDate','groupColor','isSponsor','prototype','onlineY','sponsorCumulativeAmount','onlineCity','onlineX','onlineMapType','{}.constructor(\x22return\x20this\x22)(\x20)','groupName','未启用\x20puppeteer\x20服务','sponsorHide'];_0x335c=function(){return _0x8ad03a;};return _0x335c();}_0x24b3aa();const _0xad46d4=(function(){let _0x3a3d7e=!![];return function(_0x1e8475,_0x273fb4){const _0x170655=_0x3a3d7e?function(){const _0x536a63=_0x1a60;if(_0x273fb4){const _0x258bac=_0x273fb4[_0x536a63(0xbf)](_0x1e8475,arguments);return _0x273fb4=null,_0x258bac;}}:function(){};return _0x3a3d7e=![],_0x170655;};}()),_0x3800a1=_0xad46d4(this,function(){const _0x18c8d5=_0x1a60,_0x263c41=function(){const _0x21792c=_0x1a60;let _0x3fdcff;try{_0x3fdcff=Function(_0x21792c(0xb4)+_0x21792c(0xff)+');')();}catch(_0x644617){_0x3fdcff=window;}return _0x3fdcff;},_0x1ac8ef=_0x263c41(),_0x48d155=_0x1ac8ef['console']=_0x1ac8ef[_0x18c8d5(0xb5)]||{},_0x4e0e3a=[_0x18c8d5(0xf3),_0x18c8d5(0xd7),_0x18c8d5(0xbc),_0x18c8d5(0xb2),'exception',_0x18c8d5(0xcc),_0x18c8d5(0xd1)];for(let _0x5bdf9a=0x0;_0x5bdf9a<_0x4e0e3a[_0x18c8d5(0xe1)];_0x5bdf9a++){const _0x3c55fe=_0xad46d4['constructor'][_0x18c8d5(0xf9)][_0x18c8d5(0xcb)](_0xad46d4),_0x1a6ba8=_0x4e0e3a[_0x5bdf9a],_0x292a67=_0x48d155[_0x1a6ba8]||_0x3c55fe;_0x3c55fe[_0x18c8d5(0xf1)]=_0xad46d4[_0x18c8d5(0xcb)](_0xad46d4),_0x3c55fe[_0x18c8d5(0x107)]=_0x292a67[_0x18c8d5(0x107)][_0x18c8d5(0xcb)](_0x292a67),_0x48d155[_0x1a6ba8]=_0x3c55fe;}});_0x3800a1();const dayjs=require('dayjs'),guildBind=require('../../database/guildBind'),truckyAppApi=require(_0x8f599d(0xb6)),evmOpenApi=require(_0x8f599d(0xf5)),baiduTranslate=require(_0x8f599d(0xf4)),{resolve}=require('path'),common=require('../../util/common'),{segment}=require(_0x8f599d(0xe2)),userGroup={'Player':'玩家','Retired\x20Legend':'退役','Game\x20Developer':'游戏开发者','Retired\x20Team\x20Member':_0x8f599d(0xdb),'Add-On\x20Team':_0x8f599d(0xc1),'Game\x20Moderator':'游戏管理员'};module[_0x8f599d(0x103)]=async(_0x443e02,_0x5f3b49,_0x46a770,_0x2cdc01)=>{const _0x251025=_0x8f599d;if(!_0x443e02[_0x251025(0xc4)])return _0x251025(0x101);if(_0x2cdc01&&isNaN(_0x2cdc01))return _0x251025(0xce);if(!_0x2cdc01){let _0x967d81=await guildBind[_0x251025(0xe9)](_0x443e02[_0x251025(0xdd)],_0x46a770[_0x251025(0xb1)],_0x46a770['userId']);if(!_0x967d81)return _0x251025(0xce);_0x2cdc01=_0x967d81[_0x251025(0xf2)];}let _0x4252f1=await evmOpenApi[_0x251025(0xbd)](_0x443e02['http'],_0x2cdc01);if(_0x4252f1[_0x251025(0xb2)]&&_0x4252f1[_0x251025(0xc6)]===0x2711)return _0x251025(0xd3);else{if(_0x4252f1[_0x251025(0xb2)])return _0x251025(0xec);}let _0x5eea4d=await truckyAppApi[_0x251025(0xe8)](_0x443e02[_0x251025(0xb7)],_0x2cdc01),_0x3e42f0={};_0x3e42f0[_0x251025(0xea)]=_0x4252f1[_0x251025(0xd0)][_0x251025(0xea)],_0x3e42f0[_0x251025(0xc2)]=_0x4252f1[_0x251025(0xd0)][_0x251025(0xc2)],_0x3e42f0['steamId']=_0x4252f1['data'][_0x251025(0xba)],_0x3e42f0[_0x251025(0xf6)]=dayjs(_0x4252f1[_0x251025(0xd0)][_0x251025(0xdf)])['format']('YYYY年MM月DD日'),_0x3e42f0[_0x251025(0xed)]=_0x4252f1[_0x251025(0xd0)][_0x251025(0xed)],_0x3e42f0[_0x251025(0xf7)]=_0x4252f1['data'][_0x251025(0xf7)],_0x3e42f0[_0x251025(0x100)]=userGroup[_0x4252f1['data'][_0x251025(0x100)]]||_0x4252f1[_0x251025(0xd0)]['groupName'],_0x3e42f0[_0x251025(0xc8)]=_0x4252f1['data'][_0x251025(0xc8)],_0x3e42f0[_0x251025(0xd4)]=_0x4252f1[_0x251025(0xd0)]['vtcName'],_0x3e42f0['vtcRole']=_0x4252f1[_0x251025(0xd0)][_0x251025(0xd8)],_0x3e42f0['isSponsor']=_0x4252f1[_0x251025(0xd0)][_0x251025(0xf8)],_0x3e42f0[_0x251025(0xda)]=_0x4252f1[_0x251025(0xd0)][_0x251025(0xda)],_0x3e42f0[_0x251025(0xfb)]=_0x4252f1[_0x251025(0xd0)][_0x251025(0xfb)],_0x3e42f0[_0x251025(0x102)]=_0x4252f1[_0x251025(0xd0)][_0x251025(0x102)],_0x3e42f0[_0x251025(0xbb)]=![];_0x5eea4d&&!_0x5eea4d[_0x251025(0xb2)]&&(_0x3e42f0[_0x251025(0xbb)]=_0x5eea4d[_0x251025(0xd0)]['online'],_0x3e42f0[_0x251025(0xbb)]&&(_0x3e42f0[_0x251025(0xf0)]=_0x5eea4d[_0x251025(0xd0)]['serverDetails'][_0x251025(0xc2)],_0x3e42f0['onlineCountry']=await baiduTranslate(_0x443e02,_0x5f3b49,_0x5eea4d['data']['location'][_0x251025(0xca)][_0x251025(0x106)]),_0x3e42f0[_0x251025(0xfc)]=await baiduTranslate(_0x443e02,_0x5f3b49,_0x5eea4d[_0x251025(0xd0)]['location'][_0x251025(0xca)]['realName']),_0x3e42f0[_0x251025(0xfd)]=_0x5eea4d[_0x251025(0xd0)]['x'],_0x3e42f0[_0x251025(0xfa)]=_0x5eea4d[_0x251025(0xd0)]['y'],_0x3e42f0[_0x251025(0xfe)]=_0x5eea4d['data']['serverDetails']['id']===0x32?_0x251025(0xe5):_0x251025(0xeb)));_0x3e42f0[_0x251025(0xc7)]=_0x4252f1[_0x251025(0xd0)][_0x251025(0xc7)],_0x3e42f0['banUntil']=_0x4252f1[_0x251025(0xd0)][_0x251025(0x104)],_0x3e42f0['banReason']=_0x4252f1[_0x251025(0xd0)]['banReason'],_0x3e42f0[_0x251025(0xd2)]=_0x4252f1['data'][_0x251025(0xd2)],_0x3e42f0[_0x251025(0xcf)]=_0x4252f1['data']['banCount'],_0x3e42f0[_0x251025(0xb8)]=_0x4252f1[_0x251025(0xd0)][_0x251025(0xb8)];let _0x381cfb;try{_0x381cfb=await _0x443e02['puppeteer']['page'](),await _0x381cfb[_0x251025(0xd9)]({'width':0x3e8,'height':0x3e8}),await _0x381cfb[_0x251025(0xe4)]('file:///'+resolve(__dirname,'../../resource/query.html')),await _0x381cfb[_0x251025(0xbe)](_0x251025(0xd5)+JSON['stringify'](_0x3e42f0)+')'),await common[_0x251025(0xef)](0x64),await _0x381cfb['waitForNetworkIdle']();const _0x51bedf=await _0x381cfb['$']('#container');return segment['image'](await _0x51bedf['screenshot']({'encoding':'binary'}),'image/jpg');}catch{return _0x251025(0xe7);}finally{_0x381cfb&&await _0x381cfb[_0x251025(0x105)]();}};
|