koishi-plugin-tmp-bot 1.18.5 → 1.18.7

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.
@@ -1,5 +1,4 @@
1
- const BASE_API_V3 = 'https://api.truckyapp.com/v3';
2
- const BASE_API_V2 = 'https://api.truckyapp.com/v2';
1
+ const BASE_API = 'https://api.codetabs.com/v1/proxy/?quest=https://api.truckyapp.com';
3
2
  module.exports = {
4
3
  /**
5
4
  * 查询线上信息
@@ -7,7 +6,7 @@ module.exports = {
7
6
  async online(http, tmpId) {
8
7
  let result = null;
9
8
  try {
10
- result = await http.get(`${BASE_API_V3}/map/online?playerID=${tmpId}`);
9
+ result = await http.get(`${BASE_API}/v3/map/online?playerID=${tmpId}`);
11
10
  }
12
11
  catch {
13
12
  return {
@@ -29,7 +28,7 @@ module.exports = {
29
28
  async trafficTop(http, serverName) {
30
29
  let result = null;
31
30
  try {
32
- result = await http.get(`${BASE_API_V2}/traffic/top?game=ets2&server=${serverName}`);
31
+ result = await http.get(`${BASE_API}/v2/traffic/top?game=ets2&server=${serverName}`);
33
32
  }
34
33
  catch {
35
34
  return {
@@ -117,8 +117,8 @@
117
117
  ets: {
118
118
  tileUrl: 'https://ets-map.oss-cn-beijing.aliyuncs.com/ets2/05102019/{z}/{x}/{y}.png',
119
119
  multipliers: {
120
- x: 71282,
121
- y: 56532
120
+ x: 70272,
121
+ y: 76157
122
122
  },
123
123
  breakpoints: {
124
124
  uk: {
@@ -135,8 +135,8 @@
135
135
  // 游戏地转地图坐标
136
136
  calculateMapCoordinate (x, y) {
137
137
  return [
138
- x / 1.325928 + mapConfig.ets.multipliers.x,
139
- y / 1.325928 + mapConfig.ets.multipliers.y
138
+ x / 1.609055 + mapConfig.ets.multipliers.x,
139
+ y / 1.609055 + mapConfig.ets.multipliers.y
140
140
  ];
141
141
  }
142
142
  },
@@ -85,8 +85,8 @@
85
85
  ets: {
86
86
  tileUrl: 'https://ets-map.oss-cn-beijing.aliyuncs.com/ets2/05102019/{z}/{x}/{y}.png',
87
87
  multipliers: {
88
- x: 71282,
89
- y: 56532
88
+ x: 70272,
89
+ y: 76157
90
90
  },
91
91
  breakpoints: {
92
92
  uk: {
@@ -103,8 +103,8 @@
103
103
  // 游戏地转地图坐标
104
104
  calculateMapCoordinate (x, y) {
105
105
  return [
106
- x / 1.325928 + mapConfig.ets.multipliers.x,
107
- y / 1.325928 + mapConfig.ets.multipliers.y
106
+ x / 1.609055 + mapConfig.ets.multipliers.x,
107
+ y / 1.609055 + mapConfig.ets.multipliers.y
108
108
  ];
109
109
  }
110
110
  },
@@ -140,7 +140,8 @@
140
140
  let map = L.map('map', {
141
141
  attributionControl: false,
142
142
  crs: L.CRS.Simple,
143
- zoomControl: false
143
+ zoomControl: false,
144
+ zoomSnap: 0.1
144
145
  });
145
146
 
146
147
  function setData(data) {
@@ -152,8 +153,10 @@
152
153
 
153
154
  // 瓦片地图
154
155
  L.tileLayer(mapConfig[data.mapType].tileUrl, {
155
- minZoom: 1,
156
+ minZoom: 0,
156
157
  maxZoom: 8,
158
+ minNativeZoom: 1,
159
+ maxNativeZoom: 8,
157
160
  tileSize: 512,
158
161
  bounds: bounds,
159
162
  reuseTiles: true
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-tmp-bot",
3
3
  "description": "欧洲卡车模拟2 TMP查询插件,不会部署的可以直接使用此机器人->QQ:3523283907",
4
- "version": "1.18.5",
4
+ "version": "1.18.7",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "homepage": "https://github.com/79887143/koishi-plugin-tmp-bot",