h1z1-server 0.25.3-0 → 0.25.3-2

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,58 +1,66 @@
1
1
  [
2
2
  {
3
- "iv": "6378e550250bea288db4c30e435a6566",
4
- "encryptedData": "e02d51753ea018b4f0e0e8f28a7f3438"
3
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
4
+ "encryptedData": "947e47e8df9e2f731162884274e4e3d1"
5
5
  },
6
6
  {
7
- "iv": "6378e550250bea288db4c30e435a6566",
8
- "encryptedData": "0f2f3958decb755b99ae2093a43e0d12"
7
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
8
+ "encryptedData": "4954430770cb8335663b2c7603905a9b"
9
9
  },
10
10
  {
11
- "iv": "6378e550250bea288db4c30e435a6566",
12
- "encryptedData": "ad0d552e2a991960d0e9954b6103ebb8"
11
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
12
+ "encryptedData": "dd4b5855c9051fa0df4568217ed32a33"
13
13
  },
14
14
  {
15
- "iv": "6378e550250bea288db4c30e435a6566",
16
- "encryptedData": "b303c9d7d5e26f4502181de97e57cd99"
15
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
16
+ "encryptedData": "59703a77bfcc16fd80bfd66bb227a3e3"
17
17
  },
18
18
  {
19
- "iv": "6378e550250bea288db4c30e435a6566",
20
- "encryptedData": "df2323b28c4f45aae38a8689eef3e688"
19
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
20
+ "encryptedData": "d13c8ffed1f28b19dc8333a99e09200d"
21
21
  },
22
22
  {
23
- "iv": "6378e550250bea288db4c30e435a6566",
24
- "encryptedData": "fa4cdc7a9379b26b8f42006a75f0c6dc"
23
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
24
+ "encryptedData": "2616f54828387e0fb0d92c6689a8a9cf"
25
25
  },
26
26
  {
27
- "iv": "6378e550250bea288db4c30e435a6566",
28
- "encryptedData": "71bb386f2338be1d47caaeab7ea04b8b"
27
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
28
+ "encryptedData": "6153f99f87d648497b06ab6d2e934860"
29
29
  },
30
30
  {
31
- "iv": "6378e550250bea288db4c30e435a6566",
32
- "encryptedData": "753d3b26b8eca2afc1f04eed589088d0"
31
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
32
+ "encryptedData": "bf05833bb819c4ae1fbb1fb2293e3b51"
33
33
  },
34
34
  {
35
- "iv": "6378e550250bea288db4c30e435a6566",
36
- "encryptedData": "fa1418782d81d44670f25833a509728a"
35
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
36
+ "encryptedData": "ab69bf026aa0feafb6df1e27d80f3707"
37
37
  },
38
38
  {
39
- "iv": "6378e550250bea288db4c30e435a6566",
40
- "encryptedData": "056a57813f1fdafb26050504b1792f8b"
39
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
40
+ "encryptedData": "0722c7b737c42ad953a7389bd95aaf0f"
41
41
  },
42
42
  {
43
- "iv": "6378e550250bea288db4c30e435a6566",
44
- "encryptedData": "e8e4ee451153d1fa924481bdc9138a58"
43
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
44
+ "encryptedData": "46fef4dab38ea5f2442b840e3dc007bb"
45
45
  },
46
46
  {
47
- "iv": "6378e550250bea288db4c30e435a6566",
48
- "encryptedData": "4dad473d52e6e7e06f22ee17c05072bd"
47
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
48
+ "encryptedData": "4e6f01bad798b569e1dae68676d8cefd"
49
49
  },
50
50
  {
51
- "iv": "6378e550250bea288db4c30e435a6566",
52
- "encryptedData": "548a45b16d334154cc861e0a57422035"
51
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
52
+ "encryptedData": "1f562e064e059540d0a0aa42ae19284c"
53
53
  },
54
54
  {
55
- "iv": "6378e550250bea288db4c30e435a6566",
56
- "encryptedData": "86d17964dfee9a17ac0f960178eef68d10aa7a366d9c57c822cb7c422b568679"
55
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
56
+ "encryptedData": "e65f9a873a07982e3b257a00fd3c7aa4620fea877b7eedf5dcb2e0745530667d"
57
+ },
58
+ {
59
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
60
+ "encryptedData": "8085c4bbdf7e82eb5988a67d81f6c348"
61
+ },
62
+ {
63
+ "iv": "9bdd2548821a980912fab12c9aef9c5c",
64
+ "encryptedData": "0c79c3c3203083bb993840b74b91a09571a7d95cf9286db439e46fad5c212ac3"
57
65
  }
58
66
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "h1z1-server",
3
- "version": "0.25.3-0",
3
+ "version": "0.25.3-2",
4
4
  "description": "Library for emulating h1z1 servers",
5
5
  "author": "Quentin Gruber <quentingruber@gmail.com> (http://github.com/quentingruber)",
6
6
  "license": "GPL-3.0-only",
@@ -2402,65 +2402,70 @@ export class ZoneServer2016 extends EventEmitter {
2402
2402
  sequenceTime: number,
2403
2403
  position: Float32Array
2404
2404
  ): boolean {
2405
- if (client.isAdmin || !this._useFairPlay || this._isSaving) return false;
2406
- const distance = getDistance2d(client.oldPos.position, position);
2407
- if (Number(client.character.lastLoginDate) + 20000 < new Date().getTime()) {
2408
- const drift = Math.abs(sequenceTime - this.getServerTime());
2409
- if (drift > 10000) {
2410
- this.kickPlayer(client);
2411
- this.sendAlertToAll(`FairPlay: kicking ${client.character.name}`);
2412
- this.sendChatTextToAdmins(
2413
- `FairPlay: ${client.character.name} has been kicked for sequence time drifting by ${drift}`,
2414
- false
2415
- );
2416
- return true;
2417
- }
2418
- if (!client.isLoading && client.enableChecks) {
2419
- if (distance > 6) {
2405
+ if (client.isAdmin || !this._useFairPlay) return false;
2406
+ if (!this.isSaving) {
2407
+ const distance = getDistance2d(client.oldPos.position, position);
2408
+ if (
2409
+ Number(client.character.lastLoginDate) + 20000 <
2410
+ new Date().getTime()
2411
+ ) {
2412
+ const drift = Math.abs(sequenceTime - this.getServerTime());
2413
+ if (drift > 10000) {
2420
2414
  this.kickPlayer(client);
2421
2415
  this.sendAlertToAll(`FairPlay: kicking ${client.character.name}`);
2422
2416
  this.sendChatTextToAdmins(
2423
- `FairPlay: ${client.character.name} has been kicked for suspeced teleport by ${distance} from [${client.oldPos.position[0]} ${client.oldPos.position[1]} ${client.oldPos.position[2]}] to [${position[0]} ${position[1]} ${position[2]}]`,
2417
+ `FairPlay: ${client.character.name} has been kicked for sequence time drifting by ${drift}`,
2424
2418
  false
2425
2419
  );
2426
2420
  return true;
2427
2421
  }
2422
+ if (!client.isLoading && client.enableChecks) {
2423
+ if (distance > 6) {
2424
+ this.kickPlayer(client);
2425
+ this.sendAlertToAll(`FairPlay: kicking ${client.character.name}`);
2426
+ this.sendChatTextToAdmins(
2427
+ `FairPlay: ${client.character.name} has been kicked for suspeced teleport by ${distance} from [${client.oldPos.position[0]} ${client.oldPos.position[1]} ${client.oldPos.position[2]}] to [${position[0]} ${position[1]} ${position[2]}]`,
2428
+ false
2429
+ );
2430
+ return true;
2431
+ }
2432
+ }
2428
2433
  }
2429
- }
2430
2434
 
2431
- const speed =
2432
- (distance / 1000 / (sequenceTime - client.oldPos.time)) * 3600000;
2433
- const verticalSpeed =
2434
- (getDistance1d(client.oldPos.position[1], position[1]) /
2435
- 1000 /
2436
- (sequenceTime - client.oldPos.time)) *
2437
- 3600000;
2438
- if (speed > 35 && verticalSpeed < 20) {
2439
- const soeClient = this.getSoeClient(client.soeClientId);
2440
- if (soeClient) {
2441
- if (soeClient.avgPing >= 250) return false;
2435
+ const speed =
2436
+ (distance / 1000 / (sequenceTime - client.oldPos.time)) * 3600000;
2437
+ const verticalSpeed =
2438
+ (getDistance1d(client.oldPos.position[1], position[1]) /
2439
+ 1000 /
2440
+ (sequenceTime - client.oldPos.time)) *
2441
+ 3600000;
2442
+ if (speed > 35 && verticalSpeed < 20) {
2443
+ const soeClient = this.getSoeClient(client.soeClientId);
2444
+ if (soeClient) {
2445
+ if (soeClient.avgPing >= 250) return false;
2446
+ }
2447
+ client.speedWarnsNumber += 1;
2448
+ } else if (client.speedWarnsNumber > 0) {
2449
+ client.speedWarnsNumber -= 1;
2442
2450
  }
2443
- client.speedWarnsNumber += 1;
2444
- } else if (client.speedWarnsNumber > 0) {
2445
- client.speedWarnsNumber -= 1;
2446
- }
2447
- if (client.speedWarnsNumber > 35) {
2448
- this.kickPlayer(client);
2449
- client.speedWarnsNumber = 0;
2450
- if (!this._soloMode) {
2451
- logClientActionToMongo(
2452
- this._db?.collection(DB_COLLECTIONS.FAIRPLAY) as Collection,
2453
- client,
2454
- this._worldId,
2455
- { type: "SpeedHack" }
2451
+ if (client.speedWarnsNumber > 35) {
2452
+ this.kickPlayer(client);
2453
+ client.speedWarnsNumber = 0;
2454
+ if (!this._soloMode) {
2455
+ logClientActionToMongo(
2456
+ this._db?.collection(DB_COLLECTIONS.FAIRPLAY) as Collection,
2457
+ client,
2458
+ this._worldId,
2459
+ { type: "SpeedHack" }
2460
+ );
2461
+ }
2462
+ this.sendAlertToAll(`FairPlay: kicking ${client.character.name}`);
2463
+ this.sendChatTextToAdmins(
2464
+ `FairPlay: ${client.character.name} has been kicking for speed hacking: ${speed} m/s at position [${position[0]} ${position[1]} ${position[2]}]`,
2465
+ false
2456
2466
  );
2467
+ return true;
2457
2468
  }
2458
- this.sendAlertToAll(`FairPlay: kicking ${client.character.name}`);
2459
- this.sendChatTextToAdmins(
2460
- `FairPlay: ${client.character.name} has been kicking for speed hacking: ${speed} m/s at position [${position[0]} ${position[1]} ${position[2]}]`,
2461
- false
2462
- );
2463
- return true;
2464
2469
  }
2465
2470
  client.oldPos = { position: position, time: sequenceTime };
2466
2471
  return false;
@@ -2472,52 +2477,53 @@ export class ZoneServer2016 extends EventEmitter {
2472
2477
  position: Float32Array,
2473
2478
  vehicle: Vehicle
2474
2479
  ): boolean {
2475
- if (client.isAdmin || !this._useFairPlay || this._isSaving) return false;
2476
-
2477
- const drift = Math.abs(sequenceTime - this.getServerTime());
2478
- if (drift > 10000) {
2479
- this.kickPlayer(client);
2480
- this.sendAlertToAll(`FairPlay: kicking ${client.character.name}`);
2481
- this.sendChatTextToAdmins(
2482
- `FairPlay: ${client.character.name} has been kicked for sequence time drifting by ${drift}`,
2483
- false
2484
- );
2485
- return true;
2486
- }
2487
- const distance = getDistance2d(vehicle.oldPos.position, position);
2488
- const speed =
2489
- (distance / 1000 / (sequenceTime - vehicle.oldPos.time)) * 3600000;
2490
- const verticalSpeed =
2491
- (getDistance1d(vehicle.oldPos.position[1], position[1]) /
2492
- 1000 /
2493
- (sequenceTime - vehicle.oldPos.time)) *
2494
- 3600000;
2495
- if (speed > 130 && verticalSpeed < 20) {
2496
- const soeClient = this.getSoeClient(client.soeClientId);
2497
- if (soeClient) {
2498
- if (soeClient.avgPing >= 250) return false;
2480
+ if (client.isAdmin || !this._useFairPlay) return false;
2481
+ if (!this.isSaving) {
2482
+ const drift = Math.abs(sequenceTime - this.getServerTime());
2483
+ if (drift > 10000) {
2484
+ this.kickPlayer(client);
2485
+ this.sendAlertToAll(`FairPlay: kicking ${client.character.name}`);
2486
+ this.sendChatTextToAdmins(
2487
+ `FairPlay: ${client.character.name} has been kicked for sequence time drifting by ${drift}`,
2488
+ false
2489
+ );
2490
+ return true;
2499
2491
  }
2500
- client.speedWarnsNumber += 1;
2501
- } else if (client.speedWarnsNumber > 0) {
2502
- client.speedWarnsNumber -= 1;
2503
- }
2504
- if (client.speedWarnsNumber > 5) {
2505
- this.kickPlayer(client);
2506
- client.speedWarnsNumber = 0;
2507
- if (!this._soloMode) {
2508
- logClientActionToMongo(
2509
- this._db?.collection(DB_COLLECTIONS.FAIRPLAY) as Collection,
2510
- client,
2511
- this._worldId,
2512
- { type: "SpeedHack" }
2492
+ const distance = getDistance2d(vehicle.oldPos.position, position);
2493
+ const speed =
2494
+ (distance / 1000 / (sequenceTime - vehicle.oldPos.time)) * 3600000;
2495
+ const verticalSpeed =
2496
+ (getDistance1d(vehicle.oldPos.position[1], position[1]) /
2497
+ 1000 /
2498
+ (sequenceTime - vehicle.oldPos.time)) *
2499
+ 3600000;
2500
+ if (speed > 130 && verticalSpeed < 20) {
2501
+ const soeClient = this.getSoeClient(client.soeClientId);
2502
+ if (soeClient) {
2503
+ if (soeClient.avgPing >= 250) return false;
2504
+ }
2505
+ client.speedWarnsNumber += 1;
2506
+ } else if (client.speedWarnsNumber > 0) {
2507
+ client.speedWarnsNumber -= 1;
2508
+ }
2509
+ if (client.speedWarnsNumber > 5) {
2510
+ this.kickPlayer(client);
2511
+ client.speedWarnsNumber = 0;
2512
+ if (!this._soloMode) {
2513
+ logClientActionToMongo(
2514
+ this._db?.collection(DB_COLLECTIONS.FAIRPLAY) as Collection,
2515
+ client,
2516
+ this._worldId,
2517
+ { type: "SpeedHack" }
2518
+ );
2519
+ }
2520
+ this.sendAlertToAll(`FairPlay: kicking ${client.character.name}`);
2521
+ this.sendChatTextToAdmins(
2522
+ `FairPlay: ${client.character.name} has been kicking for vehicle speed hacking: ${speed} m/s at position [${position[0]} ${position[1]} ${position[2]}]`,
2523
+ false
2513
2524
  );
2525
+ return true;
2514
2526
  }
2515
- this.sendAlertToAll(`FairPlay: kicking ${client.character.name}`);
2516
- this.sendChatTextToAdmins(
2517
- `FairPlay: ${client.character.name} has been kicking for vehicle speed hacking: ${speed} m/s at position [${position[0]} ${position[1]} ${position[2]}]`,
2518
- false
2519
- );
2520
- return true;
2521
2527
  }
2522
2528
  vehicle.oldPos = { position: position, time: sequenceTime };
2523
2529
  return false;