koishi-plugin-ets2-tools-tmp 2.3.0 → 2.3.1

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.
Files changed (36) hide show
  1. package/lib/api/evmOpenApi.js +138 -1
  2. package/lib/api/truckersMpApi.js +133 -1
  3. package/lib/api/truckersMpMapApi.js +25 -1
  4. package/lib/api/truckyAppApi.js +48 -1
  5. package/lib/command/ets-app/queryPoint.js +96 -1
  6. package/lib/command/ets-app/resetPassword.js +270 -1
  7. package/lib/command/tmpActivityService.js +603 -1
  8. package/lib/command/tmpBind.js +19 -1
  9. package/lib/command/tmpDlcMap.js +33 -1
  10. package/lib/command/tmpFootprint.js +109 -1
  11. package/lib/command/tmpMileageRanking.js +55 -1
  12. package/lib/command/tmpPosition.js +123 -1
  13. package/lib/command/tmpQuery/tmpQuery.js +12 -1
  14. package/lib/command/tmpQuery/tmpQueryImg.js +103 -1
  15. package/lib/command/tmpQuery/tmpQueryText.js +196 -1
  16. package/lib/command/tmpServer.js +41 -1
  17. package/lib/command/tmpTraffic/tmpTraffic.js +15 -1
  18. package/lib/command/tmpTraffic/tmpTrafficMap.js +163 -1
  19. package/lib/command/tmpTraffic/tmpTrafficText.js +60 -1
  20. package/lib/command/tmpVersion.js +14 -1
  21. package/lib/command/tmpVtc.js +29 -1
  22. package/lib/database/guildBind.js +41 -1
  23. package/lib/database/model.js +65 -1
  24. package/lib/database/translateCache.js +31 -1
  25. package/lib/index.js +331 -1
  26. package/lib/resource/dlc.html +1 -1
  27. package/lib/resource/footprint.html +1 -1
  28. package/lib/resource/package/ets-map.js +63 -1
  29. package/lib/resource/package/leaflet/heatmap.min.js +9 -1
  30. package/lib/resource/package/leaflet/leaflet-heatmap.js +246 -1
  31. package/lib/resource/position.html +1 -1
  32. package/lib/resource/traffic.html +1 -1
  33. package/lib/util/baiduTranslate.js +24 -1
  34. package/lib/util/common.js +5 -1
  35. package/lib/util/constant.js +36 -1
  36. package/package.json +1 -1
@@ -1 +1,196 @@
1
- const _0x116882=_0x106b;(function(_0x27f32c,_0x54c2ce){const _0x1ad224=_0x106b,_0x3efcb8=_0x27f32c();while(!![]){try{const _0x17e599=-parseInt(_0x1ad224(0x118))/0x1*(parseInt(_0x1ad224(0x10a))/0x2)+parseInt(_0x1ad224(0xb9))/0x3+-parseInt(_0x1ad224(0xe2))/0x4+parseInt(_0x1ad224(0x115))/0x5+-parseInt(_0x1ad224(0xe6))/0x6*(parseInt(_0x1ad224(0xc6))/0x7)+-parseInt(_0x1ad224(0xf1))/0x8*(-parseInt(_0x1ad224(0x104))/0x9)+parseInt(_0x1ad224(0xe5))/0xa;if(_0x17e599===_0x54c2ce)break;else _0x3efcb8['push'](_0x3efcb8['shift']());}catch(_0x505a9f){_0x3efcb8['push'](_0x3efcb8['shift']());}}}(_0x12b4,0xdc866));const _0x3ed108=(function(){let _0x52cfdf=!![];return function(_0x5f5466,_0xc73fe9){const _0xafc610=_0x52cfdf?function(){if(_0xc73fe9){const _0x24f59b=_0xc73fe9['apply'](_0x5f5466,arguments);return _0xc73fe9=null,_0x24f59b;}}:function(){};return _0x52cfdf=![],_0xafc610;};}()),_0x51997a=_0x3ed108(this,function(){const _0x186822=_0x106b;return _0x51997a[_0x186822(0x12a)]()[_0x186822(0xbb)](_0x186822(0x107))[_0x186822(0x12a)]()['constructor'](_0x51997a)['search'](_0x186822(0x107));});function _0x12b4(){const _0x5b7d1a=['tmpActivityService','point','\x20的V2.0积分','sponsorAmount','\x0a\x0a🌟是否Patreon支持者:\x20','\x0a\x0a🚩历史里程:\x20','该用户没有绑定玩家编号','\x20的V1.0积分','游戏管理员','49zoSlgd','\x0a💼所属分组:\x20','get','&tmpName=&teamId=&qq=&state=0&teamRole=','exception','dayjs','/api/user/info/list?token=','avatarUrl','substring','isBan','response','api','day','离线⚫','serverDetails','extend','../../api/truckyAppApi','country','post','banHide','realName','isSponsor','dayjs/locale/zh-cn','dayjs/plugin/relativeTime','\x0a🚚车队角色:\x20','lastOnlineTime','joinDate','\x0a🚩今日里程:\x20','5842412MMCwim','mainSettings','online','25689920WxEOQK','1533822gARFGb','startsWith','\x0a💰全部赞助金额:\x20','indexOf','&tmpId=','YYYY年MM月DD日','apply','附加组件团队','积分查询过程出错:\x20','return\x20(function()\x20','code','40pseBeI','\x0a📑注册日期:\x20','groupName','[TMP_BOT]\x20V1.0用户信息响应:\x20','info','warn','vtcId','platform','null','list','\x0a🚫封禁次数:\x20','\x20-\x20','locale','bind','游戏开发者','tmp_id','fromNow','[TMP_BOT]\x20请求V1.0用户信息:\x20','vtcName','2162007wnAukQ','\x0a😀玩家名称:\x20','vtcHistory','(((.+)+)+)+$','length','退休团队成员','31298ndjnfX','rewardPoints','__proto__','registerTime','banUntil','database','todayMileage','<at\x20','http','[TMP_BOT]\x20V2.0用户信息响应:\x20','{}.constructor(\x22return\x20this\x22)(\x20)','553550bSsgre','stringify','quitDate','34wQlZfe','查询玩家信息失败,请重试','format','tmpId','\x0a📶上次在线:\x20','location','\x0a🚫封禁截止:\x20','logger','id=\x22','constructor','banCount','showAvatar','log','map','../../util/baiduTranslate','<img\x20src=\x22','\x22/>\x0a','[TMP_BOT]\x20请求V2.0用户信息:\x20','toString','\x0a🚫封禁原因:\x20','\x0a🎮SteamID:\x20','\x0a🚚所属车队:\x20','mileage','name','error','&page=0&limit=7&tmpId=','toFixed','https://','exports','0美金','prototype','toLowerCase','trace','[TMP_BOT]\x20tmpQuery:开始查询TmpID\x20','poi','sponsorCumulativeAmount','isJoinVtc','data','../../database/guildBind','2413743QRieFW','console','search','steamId'];_0x12b4=function(){return _0x5b7d1a;};return _0x12b4();}_0x51997a();const _0x2828e1=(function(){let _0x4606dd=!![];return function(_0x4f04ad,_0x17659a){const _0x41c1fc=_0x4606dd?function(){const _0x5e7107=_0x106b;if(_0x17659a){const _0xb453d6=_0x17659a[_0x5e7107(0xec)](_0x4f04ad,arguments);return _0x17659a=null,_0xb453d6;}}:function(){};return _0x4606dd=![],_0x41c1fc;};}()),_0x4ce3c2=_0x2828e1(this,function(){const _0x4bde76=_0x106b,_0x367332=function(){const _0x96d4d1=_0x106b;let _0x402b35;try{_0x402b35=Function(_0x96d4d1(0xef)+_0x96d4d1(0x114)+');')();}catch(_0x2e1951){_0x402b35=window;}return _0x402b35;},_0x3792ba=_0x367332(),_0x1e22e3=_0x3792ba[_0x4bde76(0xba)]=_0x3792ba[_0x4bde76(0xba)]||{},_0x119959=[_0x4bde76(0x124),_0x4bde76(0xf6),_0x4bde76(0xf5),_0x4bde76(0xaa),_0x4bde76(0xca),'table',_0x4bde76(0xb2)];for(let _0x1c2ede=0x0;_0x1c2ede<_0x119959[_0x4bde76(0x108)];_0x1c2ede++){const _0x1744a0=_0x2828e1[_0x4bde76(0x121)][_0x4bde76(0xb0)][_0x4bde76(0xfe)](_0x2828e1),_0x28bddc=_0x119959[_0x1c2ede],_0x2c9cbd=_0x1e22e3[_0x28bddc]||_0x1744a0;_0x1744a0[_0x4bde76(0x10c)]=_0x2828e1['bind'](_0x2828e1),_0x1744a0['toString']=_0x2c9cbd[_0x4bde76(0x12a)][_0x4bde76(0xfe)](_0x2c9cbd),_0x1e22e3[_0x28bddc]=_0x1744a0;}});_0x4ce3c2();const dayjs=require(_0x116882(0xcb)),dayjsRelativeTime=require(_0x116882(0xdd)),dayjsLocaleZhCn=require(_0x116882(0xdc)),guildBind=require(_0x116882(0xb8)),truckyAppApi=require(_0x116882(0xd6)),evmOpenApi=require('../../api/evmOpenApi'),baiduTranslate=require(_0x116882(0x126));function _0x106b(_0x497721,_0x1c19bd){const _0xf1b987=_0x12b4();return _0x106b=function(_0x4ce3c2,_0x2828e1){_0x4ce3c2=_0x4ce3c2-0xa6;let _0x58de4b=_0xf1b987[_0x4ce3c2];return _0x58de4b;},_0x106b(_0x497721,_0x1c19bd);}dayjs[_0x116882(0xd5)](dayjsRelativeTime),dayjs[_0x116882(0xfd)](dayjsLocaleZhCn);const userGroup={'Player':'玩家','Retired\x20Legend':'退役','Game\x20Developer':_0x116882(0xff),'Retired\x20Team\x20Member':_0x116882(0x109),'Add-On\x20Team':_0x116882(0xed),'Game\x20Moderator':_0x116882(0xc5)};module[_0x116882(0xae)]=async(_0x3637ea,_0x38c64a,_0x41a5ad,_0x3ab787)=>{const _0x73ec41=_0x116882,{vtcId:_0x35fe05}=_0x38c64a[_0x73ec41(0xbd)]?.[_0x73ec41(0xd1)]||{};if(_0x3ab787&&_0x3ab787[_0x73ec41(0xe7)](_0x73ec41(0x111))){_0x3ab787[_0x73ec41(0xe7)](_0x73ec41(0x111))&&(queryQQ=_0x3ab787['replace']('<at\x20',''));let _0x36721c='';const _0x1ab23d=queryQQ[_0x73ec41(0xe9)](_0x73ec41(0x120));if(_0x1ab23d!==-0x1){const _0xb228e0=_0x1ab23d+0x4,_0x2ffeee=queryQQ[_0x73ec41(0xe9)]('\x22',_0xb228e0);_0x2ffeee!==-0x1&&(_0x36721c=queryQQ[_0x73ec41(0xce)](_0xb228e0,_0x2ffeee));}queryQQ=_0x36721c;let _0xa7e422=await guildBind[_0x73ec41(0xc8)](_0x3637ea[_0x73ec41(0x10f)],_0x41a5ad[_0x73ec41(0xf8)],queryQQ);if(!_0xa7e422)return _0x73ec41(0xc3);_0x3ab787=_0xa7e422[_0x73ec41(0x100)];}if(!_0x3ab787){let _0xe0fdf3=await guildBind[_0x73ec41(0xc8)](_0x3637ea[_0x73ec41(0x10f)],_0x41a5ad[_0x73ec41(0xf8)],_0x41a5ad['userId']);if(!_0xe0fdf3)return'请输入正确的玩家编号';_0x3ab787=_0xe0fdf3[_0x73ec41(0x100)];}let _0x277081=await evmOpenApi['playerInfo'](_0x3637ea[_0x73ec41(0x112)],_0x3ab787);if(_0x277081[_0x73ec41(0xaa)]&&_0x277081['code']===0x2711)return'玩家不存在';else{if(_0x277081[_0x73ec41(0xaa)])return _0x73ec41(0x119);}let _0x39d542=await truckyAppApi[_0x73ec41(0xe4)](_0x3637ea[_0x73ec41(0x112)],_0x3ab787),_0x1c4e9a='';_0x38c64a['tmpQuery']?.[_0x73ec41(0x123)]&&(_0x1c4e9a+=_0x73ec41(0x127)+_0x277081[_0x73ec41(0xb7)][_0x73ec41(0xcd)]+_0x73ec41(0x128));_0x1c4e9a+='🆔TMP编号:\x20'+_0x277081[_0x73ec41(0xb7)][_0x73ec41(0x11b)],_0x1c4e9a+=_0x73ec41(0x105)+_0x277081[_0x73ec41(0xb7)][_0x73ec41(0xa9)],_0x1c4e9a+=_0x73ec41(0xa6)+_0x277081['data'][_0x73ec41(0xbc)];let _0x3ad140=dayjs(_0x277081['data'][_0x73ec41(0x10d)]);_0x1c4e9a+=_0x73ec41(0xf2)+_0x3ad140['format'](_0x73ec41(0xeb))+('\x20('+dayjs()['diff'](_0x3ad140,_0x73ec41(0xd2))+'天)'),_0x1c4e9a+=_0x73ec41(0xc7)+(userGroup[_0x277081[_0x73ec41(0xb7)][_0x73ec41(0xf3)]]||_0x277081['data']['groupName']);if(_0x277081[_0x73ec41(0xb7)][_0x73ec41(0xb6)]){_0x1c4e9a+=_0x73ec41(0xa7)+_0x277081[_0x73ec41(0xb7)][_0x73ec41(0x103)];_0x38c64a['commands']?.['tmpQueryHistory']&&(_0x277081[_0x73ec41(0xb7)]['vtcHistory']&&_0x277081['data']['vtcHistory']['length']>0x0&&(_0x1c4e9a+='\x0a📜历史车队:\x0a'+_0x277081['data'][_0x73ec41(0x106)][_0x73ec41(0x125)](_0x2d45b2=>'-\x20'+_0x2d45b2[_0x73ec41(0x103)]+'\x0a(加入时间:\x20'+dayjs(_0x2d45b2[_0x73ec41(0xe0)])['format']('YYYY年MM月DD日')+',\x20离开日期:\x20'+dayjs(_0x2d45b2[_0x73ec41(0x117)])[_0x73ec41(0x11a)](_0x73ec41(0xeb))+')')['join']('\x0a')));_0x1c4e9a+=_0x73ec41(0xde)+_0x277081[_0x73ec41(0xb7)]['vtcRole'];if(_0x277081['data'][_0x73ec41(0xf7)]==_0x35fe05){const {url:_0x5c00d1,token:_0xaea03f,logOutput:_0x368ac9,platformVersion:_0x2bbd31}=_0x38c64a[_0x73ec41(0xe3)]?.['settings']||{},_0x138b32=(_0x2bbd31||'v1')[_0x73ec41(0xb1)]();try{let _0x539761=0x0;if(_0x138b32==='v2'){const _0x589bc5=_0x5c00d1,_0x537039=_0x73ec41(0xad)+_0x589bc5+'/members/get?token='+_0xaea03f+_0x73ec41(0xea)+_0x3ab787;_0x368ac9&&(_0x3637ea[_0x73ec41(0x11f)]['info'](_0x73ec41(0xb3)+_0x3ab787+_0x73ec41(0xbf)),_0x3637ea[_0x73ec41(0x11f)][_0x73ec41(0xf5)](_0x73ec41(0x129)+_0x537039));const _0x31155c=await _0x3637ea[_0x73ec41(0x112)]['get'](_0x537039);_0x368ac9&&_0x3637ea[_0x73ec41(0x11f)]['info'](_0x73ec41(0x113)+JSON[_0x73ec41(0x116)](_0x31155c)),_0x31155c[_0x73ec41(0xf0)]===0xc8&&_0x31155c[_0x73ec41(0xb7)]&&(_0x539761=_0x31155c['data'][_0x73ec41(0xbe)]||0x0);}else{_0x368ac9&&_0x3637ea[_0x73ec41(0x11f)][_0x73ec41(0xf5)](_0x73ec41(0xb3)+_0x3ab787+_0x73ec41(0xc4));const _0x22600a=_0x73ec41(0xad)+_0x5c00d1+_0x73ec41(0xcc)+_0xaea03f+_0x73ec41(0xab)+_0x3ab787+_0x73ec41(0xc9);_0x368ac9&&_0x3637ea[_0x73ec41(0x11f)]['info'](_0x73ec41(0x102)+_0x22600a);const _0x15f2bf=await _0x3637ea[_0x73ec41(0x112)][_0x73ec41(0xd8)](_0x22600a);_0x368ac9&&_0x3637ea[_0x73ec41(0x11f)]['info'](_0x73ec41(0xf4)+JSON[_0x73ec41(0x116)](_0x15f2bf));const _0xfc1c86=_0x15f2bf['page']?.[_0x73ec41(0xfa)]||[],_0x26fe0b=_0xfc1c86[0x0];_0x539761=_0x26fe0b[_0x73ec41(0x10b)]||0x0;}_0x1c4e9a+='\x0a⭐\x20当前车队积分:\x20'+_0x539761;}catch(_0x5e612f){_0x3637ea[_0x73ec41(0x11f)][_0x73ec41(0xaa)](_0x73ec41(0xee)+_0x5e612f),_0x5e612f[_0x73ec41(0xd0)]&&(_0x1c4e9a+='查询出错');}}}_0x1c4e9a+='\x0a\x0a🚫是否封禁:\x20'+(_0x277081[_0x73ec41(0xb7)][_0x73ec41(0xcf)]?'是':'否');_0x277081[_0x73ec41(0xb7)][_0x73ec41(0xcf)]&&(_0x1c4e9a+=_0x73ec41(0x11e),_0x277081['data'][_0x73ec41(0xd9)]?_0x1c4e9a+='隐藏':(!_0x277081['data'][_0x73ec41(0x10e)]?_0x1c4e9a+='永久':_0x1c4e9a+=dayjs(_0x277081[_0x73ec41(0xb7)][_0x73ec41(0x10e)])['format']('YYYY年MM月DD日\x20HH:mm'),_0x1c4e9a+=_0x73ec41(0x12b)+(_0x277081[_0x73ec41(0xb7)]['banReasonZh']||_0x277081[_0x73ec41(0xb7)]['banReason'])));_0x1c4e9a+=_0x73ec41(0xfb)+(_0x277081['data'][_0x73ec41(0x122)]||0x0);if(_0x277081[_0x73ec41(0xb7)][_0x73ec41(0xa8)]){let _0x543e51=_0x277081[_0x73ec41(0xb7)]['mileage'],_0x458ba1='米';_0x543e51>0x3e8&&(_0x543e51=(_0x543e51/0x3e8)[_0x73ec41(0xac)](0x1),_0x458ba1='公里'),_0x1c4e9a+=_0x73ec41(0xc2)+_0x543e51+_0x458ba1;}if(_0x277081['data'][_0x73ec41(0x110)]){let _0x6b9a49=_0x277081[_0x73ec41(0xb7)][_0x73ec41(0x110)],_0x277893='米';_0x6b9a49>0x3e8&&(_0x6b9a49=(_0x6b9a49/0x3e8)[_0x73ec41(0xac)](0x1),_0x277893='公里'),_0x1c4e9a+=_0x73ec41(0xe1)+_0x6b9a49+_0x277893;}if(_0x39d542&&!_0x39d542[_0x73ec41(0xaa)]){_0x1c4e9a+='\x0a📶在线状态:\x20'+(_0x39d542[_0x73ec41(0xb7)][_0x73ec41(0xe4)]?'在线🟢\x20('+_0x39d542[_0x73ec41(0xb7)][_0x73ec41(0xd4)][_0x73ec41(0xa9)]+')':_0x73ec41(0xd3));if(_0x39d542[_0x73ec41(0xb7)]['online'])_0x1c4e9a+='\x0a🌍线上位置:\x20',_0x1c4e9a+=await baiduTranslate(_0x3637ea,_0x38c64a,_0x39d542[_0x73ec41(0xb7)][_0x73ec41(0x11d)]['poi'][_0x73ec41(0xd7)]),_0x1c4e9a+=_0x73ec41(0xfc),_0x1c4e9a+=await baiduTranslate(_0x3637ea,_0x38c64a,_0x39d542['data'][_0x73ec41(0x11d)][_0x73ec41(0xb4)][_0x73ec41(0xda)]);else _0x277081[_0x73ec41(0xb7)][_0x73ec41(0xdf)]&&(_0x1c4e9a+=_0x73ec41(0x11c)+dayjs(_0x277081['data'][_0x73ec41(0xdf)])[_0x73ec41(0x101)](![]));}return _0x1c4e9a+=_0x73ec41(0xc1),_0x277081[_0x73ec41(0xb7)][_0x73ec41(0xdb)]?_0x1c4e9a+='是':_0x1c4e9a+='否',_0x1c4e9a+='\x0a💰当前赞助金额:\x20',_0x277081[_0x73ec41(0xb7)][_0x73ec41(0xc0)]==_0x73ec41(0xf9)?_0x1c4e9a+=_0x73ec41(0xaf):_0x1c4e9a+=_0x277081[_0x73ec41(0xb7)][_0x73ec41(0xc0)]/0x64+'美金',_0x1c4e9a+=_0x73ec41(0xe8),_0x277081[_0x73ec41(0xb7)][_0x73ec41(0xb5)]==_0x73ec41(0xf9)?_0x1c4e9a+=_0x73ec41(0xaf):_0x1c4e9a+=_0x277081[_0x73ec41(0xb7)][_0x73ec41(0xb5)]/0x64+'美金',_0x1c4e9a;};
1
+ const dayjs = require('dayjs');
2
+ const dayjsRelativeTime = require('dayjs/plugin/relativeTime');
3
+ const dayjsLocaleZhCn = require('dayjs/locale/zh-cn');
4
+ const guildBind = require('../../database/guildBind');
5
+ const truckyAppApi = require('../../api/truckyAppApi');
6
+ const evmOpenApi = require('../../api/evmOpenApi');
7
+ const baiduTranslate = require('../../util/baiduTranslate');
8
+ dayjs.extend(dayjsRelativeTime);
9
+ dayjs.locale(dayjsLocaleZhCn);
10
+ /**
11
+ * 用户组
12
+ */
13
+ const userGroup = {
14
+ 'Player': '玩家',
15
+ 'Retired Legend': '退役',
16
+ 'Game Developer': '游戏开发者',
17
+ 'Retired Team Member': '退休团队成员',
18
+ 'Add-On Team': '附加组件团队',
19
+ 'Game Moderator': '游戏管理员'
20
+ };
21
+ /**
22
+ * 查询玩家信息
23
+ */
24
+ module.exports = async (ctx, cfg, session, tmpId) => {
25
+ const { vtcId } = cfg.tmpActivityService?.api || {};
26
+ if (tmpId && tmpId.startsWith("<at ")) {
27
+ if (tmpId.startsWith('<at ')) {
28
+ queryQQ = tmpId.replace('<at ', '');
29
+ }
30
+ let id = '';
31
+ const idStart = queryQQ.indexOf('id="');
32
+ if (idStart !== -1) {
33
+ const valueStart = idStart + 4;
34
+ const valueEnd = queryQQ.indexOf('"', valueStart);
35
+ if (valueEnd !== -1) {
36
+ id = queryQQ.substring(valueStart, valueEnd);
37
+ }
38
+ }
39
+ queryQQ = id;
40
+ let guildBindData = await guildBind.get(ctx.database, session.platform, queryQQ);
41
+ if (!guildBindData) {
42
+ return `该用户没有绑定玩家编号`;
43
+ }
44
+ tmpId = guildBindData.tmp_id;
45
+ }
46
+ // 如果没有传入tmpId,尝试从数据库查询绑定信息
47
+ if (!tmpId) {
48
+ let guildBindData = await guildBind.get(ctx.database, session.platform, session.userId);
49
+ if (!guildBindData) {
50
+ return `请输入正确的玩家编号`;
51
+ }
52
+ tmpId = guildBindData.tmp_id;
53
+ }
54
+ // 查询玩家信息
55
+ let playerInfo = await evmOpenApi.playerInfo(ctx.http, tmpId);
56
+ if (playerInfo.error && playerInfo.code === 10001) {
57
+ return '玩家不存在';
58
+ }
59
+ else if (playerInfo.error) {
60
+ return '查询玩家信息失败,请重试';
61
+ }
62
+ // 查询线上信息
63
+ let playerMapInfo = await truckyAppApi.online(ctx.http, tmpId);
64
+ // 拼接消息模板
65
+ let message = '';
66
+ if (cfg.tmpQuery?.showAvatar) {
67
+ message += `<img src="${playerInfo.data.avatarUrl}"/>\n`;
68
+ }
69
+ message += '🆔TMP编号: ' + playerInfo.data.tmpId;
70
+ message += '\n😀玩家名称: ' + playerInfo.data.name;
71
+ message += '\n🎮SteamID: ' + playerInfo.data.steamId;
72
+ let registerDate = dayjs(playerInfo.data.registerTime);
73
+ message += '\n📑注册日期: ' + registerDate.format('YYYY年MM月DD日') + ` (${dayjs().diff(registerDate, 'day')}天)`;
74
+ message += '\n💼所属分组: ' + (userGroup[playerInfo.data.groupName] || playerInfo.data.groupName);
75
+ if (playerInfo.data.isJoinVtc) {
76
+ message += '\n🚚所属车队: ' + playerInfo.data.vtcName;
77
+ if(cfg.commands?.tmpQueryHistory){
78
+ if (playerInfo.data.vtcHistory && playerInfo.data.vtcHistory.length > 0) {
79
+ message += `\n📜历史车队:\n${playerInfo.data.vtcHistory.map(vtc => `- ${vtc.vtcName}\n(加入时间: ${dayjs(vtc.joinDate).format('YYYY年MM月DD日')}, 离开日期: ${dayjs(vtc.quitDate).format('YYYY年MM月DD日')})`).join('\n')}`
80
+ }
81
+ }
82
+ message += '\n🚚车队角色: ' + playerInfo.data.vtcRole;
83
+ if (playerInfo.data.vtcId == vtcId) {
84
+ const { url, token, logOutput, platformVersion } = cfg.mainSettings?.settings || {};
85
+ const platform = (platformVersion || "v1").toLowerCase();
86
+ try {
87
+ let rewardPoints = 0;
88
+ if (platform === "v2") {
89
+ const baseUrl = url;
90
+ const userInfoUrl = `https://${baseUrl}/members/get?token=${token}&tmpId=${tmpId}`;
91
+ if (logOutput) {
92
+ ctx.logger.info(`[TMP_BOT] tmpQuery:开始查询TmpID ${tmpId} 的V2.0积分`);
93
+ ctx.logger.info(`[TMP_BOT] 请求V2.0用户信息: ${userInfoUrl}`);
94
+ }
95
+ const userInfoResponse = await ctx.http.get(userInfoUrl);
96
+ if (logOutput) {
97
+ ctx.logger.info(`[TMP_BOT] V2.0用户信息响应: ${JSON.stringify(userInfoResponse)}`);
98
+ }
99
+ if (userInfoResponse.code === 200 && userInfoResponse.data) {
100
+ rewardPoints = userInfoResponse.data.point || 0;
101
+ }
102
+ } else {
103
+ if (logOutput) {
104
+ ctx.logger.info(`[TMP_BOT] tmpQuery:开始查询TmpID ${tmpId} 的V1.0积分`);
105
+ }
106
+ const userInfoUrl = `https://${url}/api/user/info/list?token=${token}&page=0&limit=7&tmpId=${tmpId}&tmpName=&teamId=&qq=&state=0&teamRole=`;
107
+ if (logOutput) {
108
+ ctx.logger.info(`[TMP_BOT] 请求V1.0用户信息: ${userInfoUrl}`);
109
+ }
110
+ const userInfoResponse = await ctx.http.post(userInfoUrl);
111
+ if (logOutput) {
112
+ ctx.logger.info(`[TMP_BOT] V1.0用户信息响应: ${JSON.stringify(userInfoResponse)}`);
113
+ }
114
+ const userList = userInfoResponse.page?.list || [];
115
+ const userInfo = userList[0];
116
+ rewardPoints = userInfo.rewardPoints || 0;
117
+ }
118
+ message += `\n⭐ 当前车队积分: ${rewardPoints}`;
119
+ } catch (error) {
120
+ ctx.logger.error(`积分查询过程出错: ${error}`);
121
+ if (error.response) {
122
+ message += '查询出错';
123
+ }
124
+ }
125
+ }
126
+ }
127
+ message += '\n\n🚫是否封禁: ' + (playerInfo.data.isBan ? '是' : '否');
128
+ if (playerInfo.data.isBan) {
129
+ message += '\n🚫封禁截止: ';
130
+ if (playerInfo.data.banHide) {
131
+ message += '隐藏';
132
+ }
133
+ else {
134
+ if (!playerInfo.data.banUntil) {
135
+ message += '永久';
136
+ }
137
+ else {
138
+ message += dayjs(playerInfo.data.banUntil).format('YYYY年MM月DD日 HH:mm');
139
+ }
140
+ message += "\n🚫封禁原因: " + (playerInfo.data.banReasonZh || playerInfo.data.banReason);
141
+ }
142
+ }
143
+ message += '\n🚫封禁次数: ' + (playerInfo.data.banCount || 0);
144
+ if (playerInfo.data.mileage) {
145
+ let mileage = playerInfo.data.mileage;
146
+ let mileageUnit = '米';
147
+ if (mileage > 1000) {
148
+ mileage = (mileage / 1000).toFixed(1);
149
+ mileageUnit = '公里';
150
+ }
151
+ message += '\n\n🚩历史里程: ' + mileage + mileageUnit;
152
+ }
153
+ if (playerInfo.data.todayMileage) {
154
+ let todayMileage = playerInfo.data.todayMileage;
155
+ let mileageUnit = '米';
156
+ if (todayMileage > 1000) {
157
+ todayMileage = (todayMileage / 1000).toFixed(1);
158
+ mileageUnit = '公里';
159
+ }
160
+ message += '\n🚩今日里程: ' + todayMileage + mileageUnit;
161
+ }
162
+ if (playerMapInfo && !playerMapInfo.error) {
163
+ message += '\n📶在线状态: ' + (playerMapInfo.data.online ? `在线🟢 (${playerMapInfo.data.serverDetails.name})` : '离线⚫');
164
+ if (playerMapInfo.data.online) {
165
+ message += '\n🌍线上位置: ';
166
+ message += await baiduTranslate(ctx, cfg, playerMapInfo.data.location.poi.country);
167
+ message += ' - ';
168
+ message += await baiduTranslate(ctx, cfg, playerMapInfo.data.location.poi.realName);
169
+ }
170
+ else if (playerInfo.data.lastOnlineTime) {
171
+ message += '\n📶上次在线: ' + dayjs(playerInfo.data.lastOnlineTime).fromNow(false);
172
+ }
173
+ }
174
+ message += '\n\n🌟是否Patreon支持者: '
175
+ if (playerInfo.data.isSponsor) {
176
+ message += '是'
177
+ }
178
+ else {
179
+ message += '否'
180
+ }
181
+ message += '\n💰当前赞助金额: '
182
+ if (playerInfo.data.sponsorAmount == 'null') {
183
+ message += '0美金'
184
+ }
185
+ else {
186
+ message += playerInfo.data.sponsorAmount / 100 + '美金'
187
+ }
188
+ message += '\n💰全部赞助金额: '
189
+ if (playerInfo.data.sponsorCumulativeAmount == 'null') {
190
+ message += '0美金'
191
+ }
192
+ else {
193
+ message += playerInfo.data.sponsorCumulativeAmount / 100 + '美金'
194
+ }
195
+ return message;
196
+ };
@@ -1 +1,41 @@
1
- (function(_0x1f6ddc,_0x162ec3){const _0x8c75=_0x2e81,_0x51e0ef=_0x1f6ddc();while(!![]){try{const _0x59a7da=-parseInt(_0x8c75(0xf8))/0x1*(-parseInt(_0x8c75(0xea))/0x2)+-parseInt(_0x8c75(0x103))/0x3+parseInt(_0x8c75(0xde))/0x4*(-parseInt(_0x8c75(0xe8))/0x5)+-parseInt(_0x8c75(0xfb))/0x6+parseInt(_0x8c75(0xd4))/0x7*(parseInt(_0x8c75(0xd8))/0x8)+-parseInt(_0x8c75(0xf4))/0x9*(-parseInt(_0x8c75(0x104))/0xa)+parseInt(_0x8c75(0xe4))/0xb*(parseInt(_0x8c75(0xeb))/0xc);if(_0x59a7da===_0x162ec3)break;else _0x51e0ef['push'](_0x51e0ef['shift']());}catch(_0x152a07){_0x51e0ef['push'](_0x51e0ef['shift']());}}}(_0x28e4,0x574e3));const _0x534657=(function(){let _0x291e38=!![];return function(_0x43984f,_0x5858f2){const _0x305ad2=_0x291e38?function(){const _0x12bf23=_0x2e81;if(_0x5858f2){const _0x2aa49d=_0x5858f2[_0x12bf23(0xd7)](_0x43984f,arguments);return _0x5858f2=null,_0x2aa49d;}}:function(){};return _0x291e38=![],_0x305ad2;};}()),_0x4baf17=_0x534657(this,function(){const _0x322a13=_0x2e81;return _0x4baf17[_0x322a13(0xf3)]()[_0x322a13(0x101)](_0x322a13(0xda))[_0x322a13(0xf3)]()[_0x322a13(0xfa)](_0x4baf17)[_0x322a13(0x101)](_0x322a13(0xda));});_0x4baf17();const _0x1e00d0=(function(){let _0x50a6e6=!![];return function(_0x38beae,_0x280a18){const _0x1b834a=_0x50a6e6?function(){if(_0x280a18){const _0x2faa48=_0x280a18['apply'](_0x38beae,arguments);return _0x280a18=null,_0x2faa48;}}:function(){};return _0x50a6e6=![],_0x1b834a;};}()),_0x79a13=_0x1e00d0(this,function(){const _0x48cafe=_0x2e81,_0x3403ce=function(){const _0x49caf7=_0x2e81;let _0x28d3fe;try{_0x28d3fe=Function(_0x49caf7(0x100)+_0x49caf7(0x102)+');')();}catch(_0x2d3704){_0x28d3fe=window;}return _0x28d3fe;},_0x291b77=_0x3403ce(),_0x3b7209=_0x291b77[_0x48cafe(0xdd)]=_0x291b77[_0x48cafe(0xdd)]||{},_0x2e628e=[_0x48cafe(0xe7),'warn',_0x48cafe(0xff),_0x48cafe(0xe5),_0x48cafe(0xf1),_0x48cafe(0xd9),_0x48cafe(0xe3)];for(let _0x2b2f87=0x0;_0x2b2f87<_0x2e628e[_0x48cafe(0xdb)];_0x2b2f87++){const _0x6e13ba=_0x1e00d0[_0x48cafe(0xfa)][_0x48cafe(0xed)]['bind'](_0x1e00d0),_0x721524=_0x2e628e[_0x2b2f87],_0x12fcf4=_0x3b7209[_0x721524]||_0x6e13ba;_0x6e13ba['__proto__']=_0x1e00d0[_0x48cafe(0xf7)](_0x1e00d0),_0x6e13ba['toString']=_0x12fcf4[_0x48cafe(0xf3)]['bind'](_0x12fcf4),_0x3b7209[_0x721524]=_0x6e13ba;}});_0x79a13();const truckersMpApi=require('../api/truckersMpApi');module['exports']=async(_0xa51aa4,_0x546c71,_0x33fafa)=>{const _0x564364=_0x2e81;let _0x2d4057=await truckersMpApi[_0x564364(0xe6)](_0xa51aa4[_0x564364(0xfe)]);if(_0x2d4057[_0x564364(0xe5)])return'查询服务器失败,请稍后重试';let _0x3a9059=_0x2d4057[_0x564364(0xe0)][_0x564364(0xe2)](_0x1dfe4a=>_0x1dfe4a[_0x564364(0xdf)]===_0x33fafa),_0x15f611='';for(let _0x4f8994 of _0x3a9059){_0x15f611&&(_0x15f611+='\x0a\x0a');_0x15f611+=_0x564364(0x105)+(_0x4f8994[_0x564364(0xdc)]?'🟢':'⚫')+_0x4f8994[_0x564364(0xec)],_0x15f611+=_0x564364(0xf5)+_0x4f8994['id'],_0x15f611+='\x0a服务器IP:\x20'+_0x4f8994['ip'],_0x15f611+=_0x564364(0xfd)+_0x4f8994[_0x564364(0xf0)]+'/'+_0x4f8994[_0x564364(0xd6)];_0x4f8994['queue']&&(_0x15f611+=_0x564364(0xef)+_0x4f8994[_0x564364(0xd5)]+')');let _0x16bb43=[];!_0x4f8994[_0x564364(0xf2)]&&_0x16bb43[_0x564364(0xfc)](_0x564364(0xe1)),_0x4f8994[_0x564364(0xe9)]&&_0x16bb43[_0x564364(0xfc)](_0x564364(0xf6)),_0x16bb43&&_0x16bb43['length']>0x0&&(_0x15f611+=_0x564364(0xee)+_0x16bb43[_0x564364(0xf9)]('\x20'));}return _0x15f611;};function _0x2e81(_0x11bfa9,_0x17b55f){const _0x3ae727=_0x28e4();return _0x2e81=function(_0x79a13,_0x1e00d0){_0x79a13=_0x79a13-0xd4;let _0x5b52cd=_0x3ae727[_0x79a13];return _0x5b52cd;},_0x2e81(_0x11bfa9,_0x17b55f);}function _0x28e4(){const _0x2da47a=['prototype','\x0a服务器特性:\x20','\x20(队列:\x20','players','exception','afkenabled','toString','153ttzKrR','\x0a服务器ID:\x20','💥碰撞','bind','42299BfUvNR','join','constructor','4206450iSBVxP','push','\x0a玩家人数:\x20','http','info','return\x20(function()\x20','search','{}.constructor(\x22return\x20this\x22)(\x20)','581058YBhyOF','152980xGOOvv','服务器:\x20','3623179Pdzral','queue','maxplayers','apply','8lCAinf','table','(((.+)+)+)+$','length','online','console','1556MWhNMk','game','data','⏱挂机','filter','trace','11semIqd','error','servers','log','435eQZnua','collisions','2KhNpje','5594940ujCblA','name'];_0x28e4=function(){return _0x2da47a;};return _0x28e4();}
1
+ const truckersMpApi = require('../api/truckersMpApi')
2
+
3
+ module.exports = async (ctx, cfg, game) => {
4
+ // 查询服务器信息
5
+ let serverData = await truckersMpApi.servers(ctx.http)
6
+ if (serverData.error) {
7
+ return '查询服务器失败,请稍后重试'
8
+ }
9
+
10
+ // 过滤服务器
11
+ let etsServerList = serverData.data.filter(server => server.game === game)
12
+
13
+ // 构建消息
14
+ let message = ''
15
+ for (let server of etsServerList) {
16
+ // 如果前面有内容,换行
17
+ if (message) {
18
+ message += '\n\n'
19
+ }
20
+
21
+ message += '服务器: ' + ( server.online ? '🟢' : '⚫' ) + server.name
22
+ message += `\n服务器ID: ${server.id}`
23
+ message += `\n服务器IP: ${server.ip}`
24
+ message += `\n玩家人数: ${server.players}/${server.maxplayers}`
25
+ if (server.queue) {
26
+ message += ` (队列: ${server.queue})`
27
+ }
28
+ // 服务器特性
29
+ let characteristicList = []
30
+ if (!server.afkenabled) {
31
+ characteristicList.push('⏱挂机')
32
+ }
33
+ if (server.collisions) {
34
+ characteristicList.push('💥碰撞')
35
+ }
36
+ if (characteristicList && characteristicList.length > 0) {
37
+ message += '\n服务器特性: ' + characteristicList.join(' ')
38
+ }
39
+ }
40
+ return message
41
+ }
@@ -1 +1,15 @@
1
- const _0x27ea88=_0x496a;function _0x360e(){const _0x49f744=['search','toString','prototype','315778JJpcnU','6YSwGuu','warn','1592619BeduEZ','2167200cOFULM','tmpTraffic','./tmpTrafficText','(((.+)+)+)+$','6494690QxrhMR','exception','trace','bind','console','637648xLSRov','exports','error','constructor','./tmpTrafficMap','length','9223000aAJZvt','7127848brIqSb','return\x20(function()\x20','apply','指令配置错误','2pbqFJc','table','log'];_0x360e=function(){return _0x49f744;};return _0x360e();}(function(_0x2c11b7,_0x42b523){const _0x16ae4d=_0x496a,_0x571768=_0x2c11b7();while(!![]){try{const _0x379cb1=-parseInt(_0x16ae4d(0x104))/0x1+parseInt(_0x16ae4d(0xfe))/0x2*(-parseInt(_0x16ae4d(0x107))/0x3)+-parseInt(_0x16ae4d(0xf3))/0x4+parseInt(_0x16ae4d(0xee))/0x5*(parseInt(_0x16ae4d(0x105))/0x6)+-parseInt(_0x16ae4d(0xfa))/0x7+parseInt(_0x16ae4d(0xf9))/0x8+parseInt(_0x16ae4d(0x108))/0x9;if(_0x379cb1===_0x42b523)break;else _0x571768['push'](_0x571768['shift']());}catch(_0x25b564){_0x571768['push'](_0x571768['shift']());}}}(_0x360e,0xa327e));const _0x57db3c=(function(){let _0x5c69d7=!![];return function(_0x110b77,_0xbfc65f){const _0xeaa34a=_0x5c69d7?function(){const _0x53949b=_0x496a;if(_0xbfc65f){const _0x131e16=_0xbfc65f[_0x53949b(0xfc)](_0x110b77,arguments);return _0xbfc65f=null,_0x131e16;}}:function(){};return _0x5c69d7=![],_0xeaa34a;};}()),_0x140075=_0x57db3c(this,function(){const _0x687e9c=_0x496a;return _0x140075[_0x687e9c(0x102)]()[_0x687e9c(0x101)]('(((.+)+)+)+$')['toString']()[_0x687e9c(0xf6)](_0x140075)[_0x687e9c(0x101)](_0x687e9c(0x10b));});_0x140075();const _0x1a92b1=(function(){let _0x428305=!![];return function(_0x5bd87d,_0x5e50ea){const _0x38faea=_0x428305?function(){const _0x3b2008=_0x496a;if(_0x5e50ea){const _0x49641e=_0x5e50ea[_0x3b2008(0xfc)](_0x5bd87d,arguments);return _0x5e50ea=null,_0x49641e;}}:function(){};return _0x428305=![],_0x38faea;};}()),_0x1e41cf=_0x1a92b1(this,function(){const _0x151e7c=_0x496a;let _0x2a78e2;try{const _0x333f6f=Function(_0x151e7c(0xfb)+'{}.constructor(\x22return\x20this\x22)(\x20)'+');');_0x2a78e2=_0x333f6f();}catch(_0x13d4c1){_0x2a78e2=window;}const _0x4b9742=_0x2a78e2[_0x151e7c(0xf2)]=_0x2a78e2[_0x151e7c(0xf2)]||{},_0x66d273=[_0x151e7c(0x100),_0x151e7c(0x106),'info',_0x151e7c(0xf5),_0x151e7c(0xef),_0x151e7c(0xff),_0x151e7c(0xf0)];for(let _0x25b4d3=0x0;_0x25b4d3<_0x66d273[_0x151e7c(0xf8)];_0x25b4d3++){const _0x4aa84b=_0x1a92b1[_0x151e7c(0xf6)][_0x151e7c(0x103)]['bind'](_0x1a92b1),_0x2318e5=_0x66d273[_0x25b4d3],_0x4cdbb9=_0x4b9742[_0x2318e5]||_0x4aa84b;_0x4aa84b['__proto__']=_0x1a92b1[_0x151e7c(0xf1)](_0x1a92b1),_0x4aa84b[_0x151e7c(0x102)]=_0x4cdbb9[_0x151e7c(0x102)]['bind'](_0x4cdbb9),_0x4b9742[_0x2318e5]=_0x4aa84b;}});function _0x496a(_0x101648,_0x4bff59){const _0x266975=_0x360e();return _0x496a=function(_0x1e41cf,_0x1a92b1){_0x1e41cf=_0x1e41cf-0xee;let _0x1d94c7=_0x266975[_0x1e41cf];return _0x1d94c7;},_0x496a(_0x101648,_0x4bff59);}_0x1e41cf();const tmpTrafficMap=require(_0x27ea88(0xf7)),tmpTrafficText=require(_0x27ea88(0x10a));module[_0x27ea88(0xf4)]=async(_0x5006cb,_0x9d3269,_0x2bc3bd)=>{const _0x3ff27d=_0x27ea88;switch(_0x9d3269[_0x3ff27d(0x109)]?.['type']){case 0x1:return await tmpTrafficText(_0x5006cb,_0x9d3269,_0x2bc3bd);case 0x2:return await tmpTrafficMap(_0x5006cb,_0x9d3269,_0x2bc3bd);default:return _0x3ff27d(0xfd);}};
1
+ const tmpTrafficMap = require("./tmpTrafficMap");
2
+ const tmpTrafficText = require("./tmpTrafficText");
3
+ /**
4
+ * 查询路况
5
+ */
6
+ module.exports = async (ctx, cfg, serverName) => {
7
+ switch (cfg.tmpTraffic?.type) {
8
+ case 1:
9
+ return await tmpTrafficText(ctx, cfg, serverName);
10
+ case 2:
11
+ return await tmpTrafficMap(ctx, cfg, serverName);
12
+ default:
13
+ return '指令配置错误';
14
+ }
15
+ };
@@ -1 +1,163 @@
1
- const _0x378bd7=_0x52c1;(function(_0x3b12e7,_0x44a50f){const _0x409fc6=_0x52c1,_0x53d577=_0x3b12e7();while(!![]){try{const _0xee879=parseInt(_0x409fc6(0x101))/0x1*(parseInt(_0x409fc6(0xe0))/0x2)+-parseInt(_0x409fc6(0xf3))/0x3*(parseInt(_0x409fc6(0xd2))/0x4)+parseInt(_0x409fc6(0xee))/0x5+parseInt(_0x409fc6(0xc5))/0x6*(parseInt(_0x409fc6(0x10b))/0x7)+parseInt(_0x409fc6(0xc8))/0x8*(parseInt(_0x409fc6(0xe1))/0x9)+-parseInt(_0x409fc6(0xc7))/0xa*(-parseInt(_0x409fc6(0x104))/0xb)+-parseInt(_0x409fc6(0xd1))/0xc*(parseInt(_0x409fc6(0xd7))/0xd);if(_0xee879===_0x44a50f)break;else _0x53d577['push'](_0x53d577['shift']());}catch(_0x52c784){_0x53d577['push'](_0x53d577['shift']());}}}(_0xbb29,0x9c7cf));const _0x45e31a=(function(){let _0x10294f=!![];return function(_0x1e43d1,_0x202223){const _0x34dd8e=_0x10294f?function(){const _0x4ba736=_0x52c1;if(_0x202223){const _0x29702a=_0x202223[_0x4ba736(0xe9)](_0x1e43d1,arguments);return _0x202223=null,_0x29702a;}}:function(){};return _0x10294f=![],_0x34dd8e;};}()),_0x13fca2=_0x45e31a(this,function(){const _0x428af9=_0x52c1;return _0x13fca2[_0x428af9(0xda)]()[_0x428af9(0xd0)](_0x428af9(0xc2))[_0x428af9(0xda)]()[_0x428af9(0x105)](_0x13fca2)[_0x428af9(0xd0)]('(((.+)+)+)+$');});function _0x52c1(_0x427da9,_0x168452){const _0x138d11=_0xbb29();return _0x52c1=function(_0x62f5d5,_0x2b7ddf){_0x62f5d5=_0x62f5d5-0xbc;let _0x4eca3a=_0x138d11[_0x62f5d5];return _0x4eca3a;},_0x52c1(_0x427da9,_0x168452);}function _0xbb29(){const _0x5ecefb=['http','sleep','setViewport','image','search','12augEeX','639932ScPwPy','未启用\x20puppeteer\x20服务','axisY','serverId','exception','23372011xYQIfg','console','file:///','toString','eupromods1','#00d26a','goto','查询路况信息失败','../../api/evmOpenApi','2fXbXyg','144AIlvel','arc1','return\x20(function()\x20','mapType','prototype','newSeverity','axisX','warn','apply','players','lastIndexOf','promods','name','834015xfRrRf','sim1','screenshot','trafficList','{}.constructor(\x22return\x20this\x22)(\x20)','6KPlVwd','path','country','../../resource/traffic.html','trace','image/jpg','bind','../../util/baiduTranslate','map','setData(','sim2','bounds','data','close','14965dCzeyX','#ffffff','stringify','11333916bbucmr','constructor','waitForNetworkIdle','#f8312f','请输入正确的服务器名称\x20(s1,\x20s2,\x20p,\x20a)','#container','koishi','97377FVMKTh','#8d67c5','binary','../../util/common','exports','info','error','length','evaluate','(((.+)+)+)+$','渲染异常,请重试','mapPlayerList','144crsVsF','push','10bYZGXx','606400FdhqhG','puppeteer','page','substring'];_0xbb29=function(){return _0x5ecefb;};return _0xbb29();}_0x13fca2();const _0x2b7ddf=(function(){let _0x1414a9=!![];return function(_0x90a37c,_0x56bde1){const _0x39c588=_0x1414a9?function(){if(_0x56bde1){const _0x4b2b0f=_0x56bde1['apply'](_0x90a37c,arguments);return _0x56bde1=null,_0x4b2b0f;}}:function(){};return _0x1414a9=![],_0x39c588;};}()),_0x62f5d5=_0x2b7ddf(this,function(){const _0x531ea1=_0x52c1,_0xe0fc13=function(){const _0x1c71d5=_0x52c1;let _0x48404e;try{_0x48404e=Function(_0x1c71d5(0xe3)+_0x1c71d5(0xf2)+');')();}catch(_0x5a59a9){_0x48404e=window;}return _0x48404e;},_0x3cc15c=_0xe0fc13(),_0x272378=_0x3cc15c[_0x531ea1(0xd8)]=_0x3cc15c[_0x531ea1(0xd8)]||{},_0x315e1b=['log',_0x531ea1(0xe8),_0x531ea1(0xbe),_0x531ea1(0xbf),_0x531ea1(0xd6),'table',_0x531ea1(0xf7)];for(let _0x2f1464=0x0;_0x2f1464<_0x315e1b[_0x531ea1(0xc0)];_0x2f1464++){const _0x41c9ea=_0x2b7ddf['constructor'][_0x531ea1(0xe5)][_0x531ea1(0xf9)](_0x2b7ddf),_0x395cd4=_0x315e1b[_0x2f1464],_0x68b037=_0x272378[_0x395cd4]||_0x41c9ea;_0x41c9ea['__proto__']=_0x2b7ddf[_0x531ea1(0xf9)](_0x2b7ddf),_0x41c9ea['toString']=_0x68b037['toString'][_0x531ea1(0xf9)](_0x68b037),_0x272378[_0x395cd4]=_0x41c9ea;}});_0x62f5d5();const truckyAppApi=require('../../api/truckyAppApi'),evmOpenApi=require(_0x378bd7(0xdf)),baiduTranslate=require(_0x378bd7(0xfa)),{resolve}=require(_0x378bd7(0xf4)),common=require(_0x378bd7(0xbc)),{segment}=require(_0x378bd7(0x10a)),serverAlias={'s1':{'name':_0x378bd7(0xef),'mapType':'ets','serverId':0x2,'bounds':[[-0x16fed,0x16e4f],[0x135a0,-0x13497]]},'s2':{'name':_0x378bd7(0xfd),'mapType':'ets','serverId':0x29,'bounds':[[-0x16fed,0x16e4f],[0x135a0,-0x13497]]},'p':{'name':_0x378bd7(0xdb),'mapType':_0x378bd7(0xec),'serverId':0x32,'bounds':[[-0x17863,0x3ffd],[0x3230d,-0x1145e]]},'a':{'name':_0x378bd7(0xe2),'mapType':'ets','serverId':0x7,'bounds':[[-0x16fed,0x16e4f],[0x135a0,-0x13497]]}},severityToZh={'Fluid':{'text':'畅通','color':_0x378bd7(0xdc)},'Moderate':{'text':'正常','color':'#ff6723'},'Congested':{'text':'缓慢','color':_0x378bd7(0x107)},'Heavy':{'text':'拥堵','color':_0x378bd7(0x10c)}},typeToZh={'City':'城市','Road':'公路','Intersection':'十字路口'};module[_0x378bd7(0xbd)]=async(_0x14dfdb,_0x22f7e5,_0x5f0cd7)=>{const _0x27811a=_0x378bd7;if(!_0x14dfdb[_0x27811a(0xc9)])return _0x27811a(0xd3);let _0x530769=serverAlias[_0x5f0cd7];if(!_0x530769)return _0x27811a(0x108);let _0x4c53c8=await truckyAppApi['trafficTop'](_0x14dfdb[_0x27811a(0xcc)],_0x530769[_0x27811a(0xed)]);if(_0x4c53c8[_0x27811a(0xbf)])return _0x27811a(0xde);let _0x43e2b9=await evmOpenApi[_0x27811a(0xc4)](_0x14dfdb[_0x27811a(0xcc)],_0x530769[_0x27811a(0xd5)],_0x530769[_0x27811a(0xfe)][0x0][0x0],_0x530769[_0x27811a(0xfe)][0x0][0x1],_0x530769[_0x27811a(0xfe)][0x1][0x0],_0x530769['bounds'][0x1][0x1]);switch(_0x5f0cd7){case's1':case's2':case'a':{let _0x28eebb={'mapType':_0x530769[_0x27811a(0xe4)],'trafficList':[],'playerCoordinateList':_0x43e2b9[_0x27811a(0xbf)]&&_0x43e2b9[_0x27811a(0xff)]?[]:_0x43e2b9['data'][_0x27811a(0xfb)](_0x24b051=>[_0x24b051[_0x27811a(0xe7)],_0x24b051[_0x27811a(0xd4)]])};for(const _0x5665b7 of _0x4c53c8[_0x27811a(0xff)]){_0x28eebb[_0x27811a(0xf1)][_0x27811a(0xc6)]({'country':await baiduTranslate(_0x14dfdb,_0x22f7e5,_0x5665b7[_0x27811a(0xf5)]),'province':await baiduTranslate(_0x14dfdb,_0x22f7e5,_0x5665b7[_0x27811a(0xed)][_0x27811a(0xcb)](0x0,_0x5665b7['name'][_0x27811a(0xeb)]('(')-0x1)),'playerCount':_0x5665b7[_0x27811a(0xea)],'severity':severityToZh[_0x5665b7['newSeverity']]||{'text':'未知','color':'#ffffff'}});}let _0x5aef57;try{_0x5aef57=await _0x14dfdb['puppeteer'][_0x27811a(0xca)](),await _0x5aef57['setViewport']({'width':0x3e8,'height':0x3e8}),await _0x5aef57[_0x27811a(0xdd)]('file:///'+resolve(__dirname,'../../resource/traffic.html')),await _0x5aef57[_0x27811a(0xc1)]('setData('+JSON[_0x27811a(0x103)](_0x28eebb)+')'),await common['sleep'](0x64),await _0x5aef57[_0x27811a(0x106)]();const _0x10ef4a=await _0x5aef57['$']('#container');return segment[_0x27811a(0xcf)](await _0x10ef4a['screenshot']({'encoding':_0x27811a(0x10d)}),'image/jpg');}catch{return _0x27811a(0xc3);}finally{_0x5aef57&&await _0x5aef57[_0x27811a(0x100)]();}break;}case'p':{let _0x15f80d={'mapType':_0x530769['mapType'],'trafficList':[],'playerCoordinateList':_0x43e2b9[_0x27811a(0xbf)]&&_0x43e2b9[_0x27811a(0xff)]?[]:_0x43e2b9['data'][_0x27811a(0xfb)](_0x12caff=>[_0x12caff[_0x27811a(0xe7)],_0x12caff[_0x27811a(0xd4)]])};for(const _0x433540 of _0x4c53c8[_0x27811a(0xff)]){_0x15f80d[_0x27811a(0xf1)][_0x27811a(0xc6)]({'country':await baiduTranslate(_0x14dfdb,_0x22f7e5,_0x433540['country']),'province':await baiduTranslate(_0x14dfdb,_0x22f7e5,_0x433540['name'][_0x27811a(0xcb)](0x0,_0x433540[_0x27811a(0xed)]['lastIndexOf']('(')-0x1)),'playerCount':_0x433540['players'],'severity':severityToZh[_0x433540[_0x27811a(0xe6)]]||{'text':'未知','color':_0x27811a(0x102)}});}let _0xf65576;try{_0xf65576=await _0x14dfdb[_0x27811a(0xc9)][_0x27811a(0xca)](),await _0xf65576[_0x27811a(0xce)]({'width':0x4b0,'height':0x4b0}),await _0xf65576[_0x27811a(0xdd)](_0x27811a(0xd9)+resolve(__dirname,_0x27811a(0xf6))),await _0xf65576[_0x27811a(0xc1)](_0x27811a(0xfc)+JSON[_0x27811a(0x103)](_0x15f80d)+')'),await common[_0x27811a(0xcd)](0x64),await _0xf65576['waitForNetworkIdle']();const _0xe6e84a=await _0xf65576['$'](_0x27811a(0x109));return segment[_0x27811a(0xcf)](await _0xe6e84a[_0x27811a(0xf0)]({'encoding':_0x27811a(0x10d)}),_0x27811a(0xf8));}catch{return _0x27811a(0xc3);}finally{_0xf65576&&await _0xf65576[_0x27811a(0x100)]();}break;}}};
1
+ const truckyAppApi = require('../../api/truckyAppApi');
2
+ const evmOpenApi = require('../../api/evmOpenApi');
3
+ const baiduTranslate = require('../../util/baiduTranslate');
4
+ const { resolve } = require("path");
5
+ const common = require("../../util/common");
6
+ const { segment } = require("koishi");
7
+ /**
8
+ * 服务器别名
9
+ */
10
+ const serverAlias = {
11
+ 's1': {
12
+ name: 'sim1',
13
+ mapType: 'ets',
14
+ serverId: 2,
15
+ bounds: [[-94189, 93775], [79264, -78999]]
16
+ },
17
+ 's2': {
18
+ name: 'sim2',
19
+ mapType: 'ets',
20
+ serverId: 41,
21
+ bounds: [[-94189, 93775], [79264, -78999]]
22
+ },
23
+ 'p': {
24
+ name: 'eupromods1',
25
+ mapType: 'promods',
26
+ serverId: 50,
27
+ bounds: [[-96355, 16381], [205581, -70750]]
28
+ },
29
+ 'a': {
30
+ name: 'arc1',
31
+ mapType: 'ets',
32
+ serverId: 7,
33
+ bounds: [[-94189, 93775], [79264, -78999]]
34
+ }
35
+ };
36
+ /**
37
+ * 路况程度转中文
38
+ */
39
+ const severityToZh = {
40
+ 'Fluid': {
41
+ text: '畅通',
42
+ color: '#00d26a'
43
+ },
44
+ 'Moderate': {
45
+ text: '正常',
46
+ color: '#ff6723'
47
+ },
48
+ 'Congested': {
49
+ text: '缓慢',
50
+ color: '#f8312f'
51
+ },
52
+ 'Heavy': {
53
+ text: '拥堵',
54
+ color: '#8d67c5'
55
+ }
56
+ };
57
+ /**
58
+ * 位置类型转中文
59
+ */
60
+ const typeToZh = {
61
+ 'City': '城市',
62
+ 'Road': '公路',
63
+ 'Intersection': '十字路口'
64
+ };
65
+ /**
66
+ * 查询路况
67
+ */
68
+ module.exports = async (ctx, cfg, serverName) => {
69
+ if (!ctx.puppeteer) {
70
+ return '未启用 puppeteer 服务';
71
+ }
72
+ // 根据别名获取服务器信息
73
+ let serverInfo = serverAlias[serverName];
74
+ if (!serverInfo) {
75
+ return '请输入正确的服务器名称 (s1, s2, p, a)';
76
+ }
77
+ // 查询路况信息
78
+ let trafficData = await truckyAppApi.trafficTop(ctx.http, serverInfo.name);
79
+ if (trafficData.error) {
80
+ return '查询路况信息失败';
81
+ }
82
+ // 查询地图玩家数据
83
+ let mapData = await evmOpenApi.mapPlayerList(ctx.http, serverInfo.serverId, serverInfo.bounds[0][0], serverInfo.bounds[0][1], serverInfo.bounds[1][0], serverInfo.bounds[1][1]);
84
+
85
+ switch (serverName) {
86
+ case 's1':
87
+ case 's2':
88
+ case 'a': {
89
+ let data = {
90
+ mapType: serverInfo.mapType,
91
+ trafficList: [],
92
+ playerCoordinateList: mapData.error && mapData.data ? [] : mapData.data.map(item => [item.axisX, item.axisY])
93
+ };
94
+ for (const traffic of trafficData.data) {
95
+ data.trafficList.push({
96
+ country: await baiduTranslate(ctx, cfg, traffic.country),
97
+ province: await baiduTranslate(ctx, cfg, traffic.name.substring(0, traffic.name.lastIndexOf('(') - 1)),
98
+ playerCount: traffic.players,
99
+ severity: severityToZh[traffic.newSeverity] || { text: '未知', color: '#ffffff' }
100
+ });
101
+ }
102
+ let page;
103
+ try {
104
+ page = await ctx.puppeteer.page();
105
+ await page.setViewport({ width: 1000, height: 1000 });
106
+ await page.goto(`file:///${resolve(__dirname, '../../resource/traffic.html')}`);
107
+ await page.evaluate(`setData(${JSON.stringify(data)})`);
108
+ await common.sleep(100);
109
+ await page.waitForNetworkIdle();
110
+ const element = await page.$("#container");
111
+ return (segment.image(await element.screenshot({
112
+ encoding: "binary"
113
+ }), "image/jpg"));
114
+ }
115
+ catch {
116
+ return '渲染异常,请重试';
117
+ }
118
+ finally {
119
+ if (page) {
120
+ await page.close();
121
+ }
122
+ }
123
+ break;
124
+ }
125
+ case 'p': {
126
+ let data = {
127
+ mapType: serverInfo.mapType,
128
+ trafficList: [],
129
+ playerCoordinateList: mapData.error && mapData.data ? [] : mapData.data.map(item => [item.axisX, item.axisY])
130
+ };
131
+ for (const traffic of trafficData.data) {
132
+ data.trafficList.push({
133
+ country: await baiduTranslate(ctx, cfg, traffic.country),
134
+ province: await baiduTranslate(ctx, cfg, traffic.name.substring(0, traffic.name.lastIndexOf('(') - 1)),
135
+ playerCount: traffic.players,
136
+ severity: severityToZh[traffic.newSeverity] || { text: '未知', color: '#ffffff' }
137
+ });
138
+ }
139
+ let page;
140
+ try {
141
+ page = await ctx.puppeteer.page();
142
+ await page.setViewport({ width: 1200, height: 1200 });
143
+ await page.goto(`file:///${resolve(__dirname, '../../resource/traffic.html')}`);
144
+ await page.evaluate(`setData(${JSON.stringify(data)})`);
145
+ await common.sleep(100);
146
+ await page.waitForNetworkIdle();
147
+ const element = await page.$("#container");
148
+ return (segment.image(await element.screenshot({
149
+ encoding: "binary"
150
+ }), "image/jpg"));
151
+ }
152
+ catch {
153
+ return '渲染异常,请重试';
154
+ }
155
+ finally {
156
+ if (page) {
157
+ await page.close();
158
+ }
159
+ }
160
+ break;
161
+ }
162
+ }
163
+ };
@@ -1 +1,60 @@
1
- const _0x5b66f5=_0x5ea1;(function(_0x5de695,_0x2a77fa){const _0x1c728e=_0x5ea1,_0x507a81=_0x5de695();while(!![]){try{const _0x2ed35f=-parseInt(_0x1c728e(0x164))/0x1+-parseInt(_0x1c728e(0x14d))/0x2*(parseInt(_0x1c728e(0x15a))/0x3)+-parseInt(_0x1c728e(0x14e))/0x4*(parseInt(_0x1c728e(0x160))/0x5)+-parseInt(_0x1c728e(0x14f))/0x6+parseInt(_0x1c728e(0x168))/0x7*(parseInt(_0x1c728e(0x14c))/0x8)+parseInt(_0x1c728e(0x14b))/0x9*(parseInt(_0x1c728e(0x175))/0xa)+parseInt(_0x1c728e(0x148))/0xb;if(_0x2ed35f===_0x2a77fa)break;else _0x507a81['push'](_0x507a81['shift']());}catch(_0x486418){_0x507a81['push'](_0x507a81['shift']());}}}(_0x3952,0x6bcfb));function _0x5ea1(_0x4d25c4,_0x392d85){const _0x5155cf=_0x3952();return _0x5ea1=function(_0x1414af,_0x910dc3){_0x1414af=_0x1414af-0x148;let _0xd2405d=_0x5155cf[_0x1414af];return _0xd2405d;},_0x5ea1(_0x4d25c4,_0x392d85);}const _0x5c253d=(function(){let _0x275fb7=!![];return function(_0x52e1fa,_0x93282a){const _0x245bd3=_0x275fb7?function(){const _0x5c5537=_0x5ea1;if(_0x93282a){const _0xc51d7=_0x93282a[_0x5c5537(0x170)](_0x52e1fa,arguments);return _0x93282a=null,_0xc51d7;}}:function(){};return _0x275fb7=![],_0x245bd3;};}()),_0x252f82=_0x5c253d(this,function(){const _0x27f84d=_0x5ea1;return _0x252f82[_0x27f84d(0x165)]()[_0x27f84d(0x174)]('(((.+)+)+)+$')['toString']()[_0x27f84d(0x15d)](_0x252f82)[_0x27f84d(0x174)]('(((.+)+)+)+$');});_0x252f82();const _0x910dc3=(function(){let _0x27a768=!![];return function(_0x20885e,_0x34edf8){const _0x528aef=_0x27a768?function(){const _0xb2bada=_0x5ea1;if(_0x34edf8){const _0x39525d=_0x34edf8[_0xb2bada(0x170)](_0x20885e,arguments);return _0x34edf8=null,_0x39525d;}}:function(){};return _0x27a768=![],_0x528aef;};}()),_0x1414af=_0x910dc3(this,function(){const _0x1d0b67=_0x5ea1;let _0x482d97;try{const _0x1ad98d=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');');_0x482d97=_0x1ad98d();}catch(_0x1c2aa6){_0x482d97=window;}const _0x181106=_0x482d97[_0x1d0b67(0x153)]=_0x482d97[_0x1d0b67(0x153)]||{},_0x209b70=[_0x1d0b67(0x151),_0x1d0b67(0x16e),_0x1d0b67(0x16f),_0x1d0b67(0x155),_0x1d0b67(0x16c),_0x1d0b67(0x172),_0x1d0b67(0x162)];for(let _0x2e40d7=0x0;_0x2e40d7<_0x209b70['length'];_0x2e40d7++){const _0x9dbdc5=_0x910dc3[_0x1d0b67(0x15d)][_0x1d0b67(0x167)][_0x1d0b67(0x152)](_0x910dc3),_0xc9551c=_0x209b70[_0x2e40d7],_0x2e1f5b=_0x181106[_0xc9551c]||_0x9dbdc5;_0x9dbdc5[_0x1d0b67(0x15f)]=_0x910dc3[_0x1d0b67(0x152)](_0x910dc3),_0x9dbdc5[_0x1d0b67(0x165)]=_0x2e1f5b['toString'][_0x1d0b67(0x152)](_0x2e1f5b),_0x181106[_0xc9551c]=_0x9dbdc5;}});_0x1414af();function _0x3952(){const _0x404fcf=['12845CpRMoO','\x0a路况:\x20','players','sim1','exception','eupromods1','warn','info','apply','查询路况信息失败','table','name','search','1735180RLJygp','28611385OaSvui','lastIndexOf','\x20-\x20','18udzaHR','48APxBPk','879068KaXFMk','600308GEvMux','421440jFJFIA','🟢畅通','log','bind','console','🟠正常','error','🟣拥堵','../../api/truckyAppApi','../../util/baiduTranslate','\x20|\x20人数:\x20','6pBWZfL','🔴缓慢','substring','constructor','country','__proto__','25reuWVz','arc1','trace','exports','817793yfULkd','toString','trafficTop','prototype'];_0x3952=function(){return _0x404fcf;};return _0x3952();}const truckyAppApi=require(_0x5b66f5(0x157)),baiduTranslate=require(_0x5b66f5(0x158)),serverNameAlias={'s1':_0x5b66f5(0x16b),'s2':'sim2','p':_0x5b66f5(0x16d),'a':_0x5b66f5(0x161),'S1':_0x5b66f5(0x16b),'S2':'sim2','P':'eupromods1','A':_0x5b66f5(0x161)},severityToZh={'Fluid':_0x5b66f5(0x150),'Moderate':_0x5b66f5(0x154),'Congested':_0x5b66f5(0x15b),'Heavy':_0x5b66f5(0x156)},typeToZh={'City':'城市','Road':'公路','Intersection':'十字路口'};module[_0x5b66f5(0x163)]=async(_0x16159c,_0x404bbe,_0x299508)=>{const _0x582713=_0x5b66f5;let _0x379334=serverNameAlias[_0x299508];if(!_0x379334)return'请输入正确的服务器名称\x20(s1,\x20s2,\x20p,\x20a)';let _0xa434e0=await truckyAppApi[_0x582713(0x166)](_0x16159c['http'],_0x379334);if(_0xa434e0[_0x582713(0x155)])return _0x582713(0x171);let _0x33b037='';for(const _0x121bff of _0xa434e0['data']){_0x33b037&&(_0x33b037+='\x0a\x0a');_0x33b037+=await baiduTranslate(_0x16159c,_0x404bbe,_0x121bff[_0x582713(0x15e)]),_0x33b037+=_0x582713(0x14a);let _0x4172c6=_0x121bff['name'][_0x582713(0x15c)](0x0,_0x121bff[_0x582713(0x173)][_0x582713(0x149)]('(')-0x1),_0x325d6f=_0x121bff[_0x582713(0x173)]['substring'](_0x121bff[_0x582713(0x173)]['lastIndexOf']('(')+0x1,_0x121bff[_0x582713(0x173)]['lastIndexOf'](')'));_0x33b037+=await baiduTranslate(_0x16159c,_0x404bbe,_0x4172c6)+('\x20('+(typeToZh[_0x325d6f]||_0x325d6f)+')'),_0x33b037+=_0x582713(0x169)+(severityToZh[_0x121bff['newSeverity']]||_0x121bff['color']),_0x33b037+=_0x582713(0x159)+_0x121bff[_0x582713(0x16a)];}return _0x33b037;};
1
+ const truckyAppApi = require('../../api/truckyAppApi');
2
+ const baiduTranslate = require('../../util/baiduTranslate');
3
+ /**
4
+ * 服务器别名
5
+ */
6
+ const serverNameAlias = {
7
+ 's1': 'sim1',
8
+ 's2': 'sim2',
9
+ 'p': 'eupromods1',
10
+ 'a': 'arc1',
11
+ 'S1': 'sim1',
12
+ 'S2': 'sim2',
13
+ 'P': 'eupromods1',
14
+ 'A': 'arc1'
15
+ };
16
+ /**
17
+ * 路况程度转中文
18
+ */
19
+ const severityToZh = {
20
+ 'Fluid': '🟢畅通',
21
+ 'Moderate': '🟠正常',
22
+ 'Congested': '🔴缓慢',
23
+ 'Heavy': '🟣拥堵'
24
+ };
25
+ /**
26
+ * 位置类型转中文
27
+ */
28
+ const typeToZh = {
29
+ 'City': '城市',
30
+ 'Road': '公路',
31
+ 'Intersection': '十字路口'
32
+ };
33
+ /**
34
+ * 查询路况
35
+ */
36
+ module.exports = async (ctx, cfg, serverName) => {
37
+ let serverQueryName = serverNameAlias[serverName];
38
+ if (!serverQueryName) {
39
+ return '请输入正确的服务器名称 (s1, s2, p, a)';
40
+ }
41
+ let trafficData = await truckyAppApi.trafficTop(ctx.http, serverQueryName);
42
+ if (trafficData.error) {
43
+ return '查询路况信息失败';
44
+ }
45
+ // 构建消息
46
+ let message = '';
47
+ for (const traffic of trafficData.data) {
48
+ if (message) {
49
+ message += '\n\n';
50
+ }
51
+ message += await baiduTranslate(ctx, cfg, traffic.country);
52
+ message += ' - ';
53
+ let name = traffic.name.substring(0, traffic.name.lastIndexOf('(') - 1);
54
+ let type = traffic.name.substring(traffic.name.lastIndexOf('(') + 1, traffic.name.lastIndexOf(')'));
55
+ message += await baiduTranslate(ctx, cfg, name) + ` (${typeToZh[type] || type})`;
56
+ message += '\n路况: ' + (severityToZh[traffic.newSeverity] || traffic.color);
57
+ message += ' | 人数: ' + traffic.players;
58
+ }
59
+ return message;
60
+ };
@@ -1 +1,14 @@
1
- const _0x598330=_0x122b;(function(_0x309e45,_0x42f546){const _0x261efc=_0x122b,_0x134de9=_0x309e45();while(!![]){try{const _0x5bf537=parseInt(_0x261efc(0xe0))/0x1+parseInt(_0x261efc(0xcc))/0x2+-parseInt(_0x261efc(0xe9))/0x3*(parseInt(_0x261efc(0xde))/0x4)+-parseInt(_0x261efc(0xee))/0x5*(parseInt(_0x261efc(0xd8))/0x6)+parseInt(_0x261efc(0xec))/0x7*(parseInt(_0x261efc(0xca))/0x8)+-parseInt(_0x261efc(0xe2))/0x9*(parseInt(_0x261efc(0xe3))/0xa)+parseInt(_0x261efc(0xe1))/0xb*(-parseInt(_0x261efc(0xd3))/0xc);if(_0x5bf537===_0x42f546)break;else _0x134de9['push'](_0x134de9['shift']());}catch(_0xf909ac){_0x134de9['push'](_0x134de9['shift']());}}}(_0x17f1,0x79b32));const _0x4649d0=(function(){let _0x3e6b7c=!![];return function(_0x28426c,_0x29cf0b){const _0x3aca9b=_0x3e6b7c?function(){const _0x43e9de=_0x122b;if(_0x29cf0b){const _0x39c395=_0x29cf0b[_0x43e9de(0xe8)](_0x28426c,arguments);return _0x29cf0b=null,_0x39c395;}}:function(){};return _0x3e6b7c=![],_0x3aca9b;};}()),_0x1e6b76=_0x4649d0(this,function(){const _0x2389c=_0x122b;return _0x1e6b76[_0x2389c(0xd7)]()[_0x2389c(0xd4)](_0x2389c(0xf0))['toString']()[_0x2389c(0xdc)](_0x1e6b76)[_0x2389c(0xd4)](_0x2389c(0xf0));});function _0x122b(_0x3404ba,_0x161de7){const _0x246aa6=_0x17f1();return _0x122b=function(_0x1fa23d,_0x51bcf9){_0x1fa23d=_0x1fa23d-0xca;let _0x3c41c4=_0x246aa6[_0x1fa23d];return _0x3c41c4;},_0x122b(_0x3404ba,_0x161de7);}function _0x17f1(){const _0x54a4b7=['log','bind','version','constructor','__proto__','4SzIgbe','../api/truckersMpApi','529144Ygawry','7425TjmHNC','21861GeYKsd','430duckpk','console','欧卡支持版本:\x20','TMP版本:','exception','apply','2155371FkbFLI','data','supported_game_version','58156KcKLzl','supported_ats_game_version','130FCWmhq','name','(((.+)+)+)+$','696xBbNrw','error','1245160GbKGHi','warn','查询失败,请稍后再试','info','{}.constructor(\x22return\x20this\x22)(\x20)','http','length','8616XBKHNw','search','trace','return\x20(function()\x20','toString','15804FHQXQD'];_0x17f1=function(){return _0x54a4b7;};return _0x17f1();}_0x1e6b76();const _0x51bcf9=(function(){let _0x422f4a=!![];return function(_0x598be7,_0x3d50fc){const _0x9b4008=_0x422f4a?function(){const _0x4a18f4=_0x122b;if(_0x3d50fc){const _0x537cc9=_0x3d50fc[_0x4a18f4(0xe8)](_0x598be7,arguments);return _0x3d50fc=null,_0x537cc9;}}:function(){};return _0x422f4a=![],_0x9b4008;};}()),_0x1fa23d=_0x51bcf9(this,function(){const _0x229a0d=_0x122b,_0x4eec73=function(){const _0x875cc7=_0x122b;let _0x388a03;try{_0x388a03=Function(_0x875cc7(0xd6)+_0x875cc7(0xd0)+');')();}catch(_0x5d8702){_0x388a03=window;}return _0x388a03;},_0x4e80ed=_0x4eec73(),_0x45a59a=_0x4e80ed[_0x229a0d(0xe4)]=_0x4e80ed['console']||{},_0x290d23=[_0x229a0d(0xd9),_0x229a0d(0xcd),_0x229a0d(0xcf),_0x229a0d(0xcb),_0x229a0d(0xe7),'table',_0x229a0d(0xd5)];for(let _0x233d5c=0x0;_0x233d5c<_0x290d23[_0x229a0d(0xd2)];_0x233d5c++){const _0x50b5d9=_0x51bcf9[_0x229a0d(0xdc)]['prototype']['bind'](_0x51bcf9),_0xc3885d=_0x290d23[_0x233d5c],_0x4f9adf=_0x45a59a[_0xc3885d]||_0x50b5d9;_0x50b5d9[_0x229a0d(0xdd)]=_0x51bcf9[_0x229a0d(0xda)](_0x51bcf9),_0x50b5d9[_0x229a0d(0xd7)]=_0x4f9adf[_0x229a0d(0xd7)][_0x229a0d(0xda)](_0x4f9adf),_0x45a59a[_0xc3885d]=_0x50b5d9;}});_0x1fa23d();const truckersMpApi=require(_0x598330(0xdf));module['exports']=async _0x1cdd03=>{const _0x1aef69=_0x598330;let _0x45f93e=await truckersMpApi[_0x1aef69(0xdb)](_0x1cdd03[_0x1aef69(0xd1)]);if(_0x45f93e[_0x1aef69(0xcb)])return _0x1aef69(0xce);let _0x318262='';return _0x318262+=_0x1aef69(0xe6)+_0x45f93e[_0x1aef69(0xea)][_0x1aef69(0xef)]+'\x0a',_0x318262+=_0x1aef69(0xe5)+_0x45f93e[_0x1aef69(0xea)][_0x1aef69(0xeb)]+'\x0a',_0x318262+='美卡支持版本:\x20'+_0x45f93e[_0x1aef69(0xea)][_0x1aef69(0xed)],_0x318262;};
1
+ const truckersMpApi = require("../api/truckersMpApi");
2
+ module.exports = async (ctx) => {
3
+ // 查询版本信息
4
+ let result = await truckersMpApi.version(ctx.http);
5
+ if (result.error) {
6
+ return '查询失败,请稍后再试';
7
+ }
8
+ // 构建消息返回
9
+ let message = '';
10
+ message += `TMP版本:${result.data.name}\n`;
11
+ message += `欧卡支持版本: ${result.data.supported_game_version}\n`;
12
+ message += `美卡支持版本: ${result.data.supported_ats_game_version}`;
13
+ return message;
14
+ };
@@ -1 +1,29 @@
1
- function _0x571b(){const _0xce478b=['info','exception','\x22/>\x0a','<img\x20src=\x22','5TFYeDs','length','查询vtc信息失败,请重试','446224wVCNsU','error','(((.+)+)+)+$','return\x20(function()\x20','created','2592310zvYDVB','\x0a🎮VTC人数:\x20','name','http','owner_id','tag','11bmCmEf','\x0a🎮VTC前缀:\x20','\x0a📑VTC名称:\x20','logo','\x0a📑VTC所有者id:\x20','🆔VTC编号:\x20','56RQPtAx','prototype','toString','请输入正确的vtc编号','142146UmvFAF','__proto__','console','warn','{}.constructor(\x22return\x20this\x22)(\x20)','search','constructor','\x0a📑VTC创建日期:\x20','59034Atbhnb','owner_username','../api/truckersMpApi','3959076uNUDkk','32fyaxYO','349qYdief','991578alPFFx','data','bind','exports','203dmOApI'];_0x571b=function(){return _0xce478b;};return _0x571b();}const _0x4012d7=_0x1c2f;(function(_0x1e5bf8,_0x4c7208){const _0x20e6a1=_0x1c2f,_0x4a91a9=_0x1e5bf8();while(!![]){try{const _0x5406df=-parseInt(_0x20e6a1(0x111))/0x1*(-parseInt(_0x20e6a1(0x100))/0x2)+parseInt(_0x20e6a1(0x112))/0x3+-parseInt(_0x20e6a1(0xef))/0x4*(-parseInt(_0x20e6a1(0xec))/0x5)+-parseInt(_0x20e6a1(0x10c))/0x6*(parseInt(_0x20e6a1(0xe7))/0x7)+-parseInt(_0x20e6a1(0x110))/0x8*(parseInt(_0x20e6a1(0x104))/0x9)+-parseInt(_0x20e6a1(0xf4))/0xa+parseInt(_0x20e6a1(0xfa))/0xb*(parseInt(_0x20e6a1(0x10f))/0xc);if(_0x5406df===_0x4c7208)break;else _0x4a91a9['push'](_0x4a91a9['shift']());}catch(_0x517248){_0x4a91a9['push'](_0x4a91a9['shift']());}}}(_0x571b,0x2a7d7));const _0x3ce160=(function(){let _0xda1329=!![];return function(_0x32c41e,_0x171d19){const _0x2fca4b=_0xda1329?function(){if(_0x171d19){const _0x1f47ad=_0x171d19['apply'](_0x32c41e,arguments);return _0x171d19=null,_0x1f47ad;}}:function(){};return _0xda1329=![],_0x2fca4b;};}()),_0x2ef35f=_0x3ce160(this,function(){const _0x67fc7d=_0x1c2f;return _0x2ef35f['toString']()[_0x67fc7d(0x109)](_0x67fc7d(0xf1))['toString']()[_0x67fc7d(0x10a)](_0x2ef35f)[_0x67fc7d(0x109)]('(((.+)+)+)+$');});_0x2ef35f();const _0x19c51c=(function(){let _0x1e877c=!![];return function(_0x1fb588,_0x405d68){const _0xe3e2e9=_0x1e877c?function(){if(_0x405d68){const _0xd024fa=_0x405d68['apply'](_0x1fb588,arguments);return _0x405d68=null,_0xd024fa;}}:function(){};return _0x1e877c=![],_0xe3e2e9;};}()),_0x172e05=_0x19c51c(this,function(){const _0x47a696=_0x1c2f;let _0x3668fb;try{const _0x678675=Function(_0x47a696(0xf2)+_0x47a696(0x108)+');');_0x3668fb=_0x678675();}catch(_0x146c2b){_0x3668fb=window;}const _0x451f03=_0x3668fb[_0x47a696(0x106)]=_0x3668fb['console']||{},_0xe737fe=['log',_0x47a696(0x107),_0x47a696(0xe8),'error',_0x47a696(0xe9),'table','trace'];for(let _0x1a4b5b=0x0;_0x1a4b5b<_0xe737fe[_0x47a696(0xed)];_0x1a4b5b++){const _0x2d3a53=_0x19c51c[_0x47a696(0x10a)][_0x47a696(0x101)][_0x47a696(0xe5)](_0x19c51c),_0x5c630c=_0xe737fe[_0x1a4b5b],_0x45e8f8=_0x451f03[_0x5c630c]||_0x2d3a53;_0x2d3a53[_0x47a696(0x105)]=_0x19c51c[_0x47a696(0xe5)](_0x19c51c),_0x2d3a53[_0x47a696(0x102)]=_0x45e8f8[_0x47a696(0x102)][_0x47a696(0xe5)](_0x45e8f8),_0x451f03[_0x5c630c]=_0x2d3a53;}});_0x172e05();function _0x1c2f(_0x426cfb,_0x43b09d){const _0x311473=_0x571b();return _0x1c2f=function(_0x172e05,_0x19c51c){_0x172e05=_0x172e05-0xe5;let _0x13524d=_0x311473[_0x172e05];return _0x13524d;},_0x1c2f(_0x426cfb,_0x43b09d);}const truckersMpApi=require(_0x4012d7(0x10e));module[_0x4012d7(0xe6)]=async(_0x1e051c,_0x20a2ba,_0x2b00f8,_0xb8a573)=>{const _0x1d4836=_0x4012d7;if(!_0xb8a573||isNaN(_0xb8a573))return _0x1d4836(0x103);let _0x816aab=await truckersMpApi['vtc'](_0x1e051c[_0x1d4836(0xf7)],_0xb8a573);if(_0x816aab[_0x1d4836(0xf0)])return _0x1d4836(0xee);let _0x2d0876='';return _0x2d0876+=_0x1d4836(0xeb)+_0x816aab[_0x1d4836(0x113)][_0x1d4836(0xfd)]+_0x1d4836(0xea),_0x2d0876+=_0x1d4836(0xff)+_0x816aab[_0x1d4836(0x113)]['id'],_0x2d0876+=_0x1d4836(0xfc)+_0x816aab[_0x1d4836(0x113)][_0x1d4836(0xf6)],_0x2d0876+=_0x1d4836(0xfe)+_0x816aab['data'][_0x1d4836(0xf8)],_0x2d0876+='\x0a📑VTC所有者名称:\x20'+_0x816aab[_0x1d4836(0x113)][_0x1d4836(0x10d)],_0x2d0876+=_0x1d4836(0x10b)+_0x816aab['data'][_0x1d4836(0xf3)]+'(UTC)',_0x2d0876+=_0x1d4836(0xf5)+_0x816aab['data']['members_count'],_0x2d0876+=_0x1d4836(0xfb)+_0x816aab[_0x1d4836(0x113)][_0x1d4836(0xf9)],_0x2d0876+='\x0a💼VTC主页:\x20'+_0x816aab[_0x1d4836(0x113)]['website'],_0x2d0876;};
1
+ const truckersMpApi = require('../api/truckersMpApi')
2
+
3
+ /**
4
+ * 查询玩家信息
5
+ */
6
+ module.exports = async (ctx, cfg, session, vtcid) => {
7
+ if (!vtcid || isNaN(vtcid)) {
8
+ return `请输入正确的vtc编号`
9
+ }
10
+
11
+ // 查询玩家信息
12
+ let vtcInfo = await truckersMpApi.vtc(ctx.http, vtcid)
13
+ if (vtcInfo.error) {
14
+ return '查询vtc信息失败,请重试'
15
+ }
16
+
17
+ // 拼接消息模板
18
+ let message = ''
19
+ message += `<img src="${vtcInfo.data.logo}"/>\n`
20
+ message += '🆔VTC编号: ' + vtcInfo.data.id
21
+ message += '\n📑VTC名称: ' + vtcInfo.data.name
22
+ message += '\n📑VTC所有者id: ' + vtcInfo.data.owner_id
23
+ message += '\n📑VTC所有者名称: ' + vtcInfo.data.owner_username
24
+ message += '\n📑VTC创建日期: ' + vtcInfo.data.created + `(UTC)`
25
+ message += '\n🎮VTC人数: ' + vtcInfo.data.members_count
26
+ message += '\n🎮VTC前缀: ' + vtcInfo.data.tag
27
+ message += `\n💼VTC主页: ${vtcInfo.data.website}`
28
+ return message
29
+ }