@sanctumterra/raknet 1.4.8 → 1.4.9

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.
@@ -28,7 +28,7 @@ class Client extends shared_1.EventEmitter {
28
28
  isDisconnected = false;
29
29
  constructor(options = {}) {
30
30
  super();
31
- this.options = { ...client_options_1.defaultClientOptions, ...options };
31
+ this.options = { ...(0, client_options_1.createDefaultClientOptions)(), ...options };
32
32
  this.status = shared_1.ConnectionStatus.Disconnected;
33
33
  this.tick = 0;
34
34
  this.socket = (0, node_dgram_1.createSocket)("udp4");
@@ -14,6 +14,6 @@ export type ClientOptions = {
14
14
  timeout: number;
15
15
  proxy?: ProxyOptions;
16
16
  };
17
- export declare const getRandomGuid: () => bigint;
18
- export declare const defaultClientOptions: ClientOptions;
17
+ export declare const generateGuid: () => bigint;
18
+ export declare const createDefaultClientOptions: () => ClientOptions;
19
19
  //# sourceMappingURL=client-options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client-options.d.ts","sourceRoot":"","sources":["../../../src/client/types/client-options.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,YAAY,CAAC;CACrB,CAAC;AACF,eAAO,MAAM,aAAa,cACgC,CAAC;AAE3D,eAAO,MAAM,oBAAoB,EAAE,aAQlC,CAAC"}
1
+ {"version":3,"file":"client-options.d.ts","sourceRoot":"","sources":["../../../src/client/types/client-options.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,YAAY,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,MAC0B,CAAC;AAE3D,eAAO,MAAM,0BAA0B,QAAO,aAQ5C,CAAC"}
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultClientOptions = exports.getRandomGuid = void 0;
4
- const getRandomGuid = () => BigInt(Math.floor(Date.now() + Math.random() * 10000000));
5
- exports.getRandomGuid = getRandomGuid;
6
- exports.defaultClientOptions = {
3
+ exports.createDefaultClientOptions = exports.generateGuid = void 0;
4
+ const generateGuid = () => BigInt(Math.floor(Date.now() + Math.random() * 10000000));
5
+ exports.generateGuid = generateGuid;
6
+ const createDefaultClientOptions = () => ({
7
7
  mtu: 1492,
8
8
  address: "127.0.0.1",
9
9
  port: 19132,
10
- guid: (0, exports.getRandomGuid)(),
10
+ guid: (0, exports.generateGuid)(),
11
11
  tickRate: 20,
12
12
  pingRate: 40,
13
13
  timeout: 30000,
14
- };
14
+ });
15
+ exports.createDefaultClientOptions = createDefaultClientOptions;
@@ -15,7 +15,7 @@ class Server extends shared_1.EventEmitter {
15
15
  constructor(options = {}) {
16
16
  super();
17
17
  this.socket = (0, node_dgram_1.createSocket)("udp4");
18
- this.options = { ...types_1.defaultRaknetServerOptions, ...options };
18
+ this.options = { ...(0, types_1.createDefaultServerOptions)(), ...options };
19
19
  this.connections = new Map();
20
20
  this.advertisement = {
21
21
  gamemode: "Survival",
@@ -8,5 +8,5 @@ export type RaknetServerOptions = {
8
8
  mtu: number;
9
9
  enableServerLogs: boolean;
10
10
  };
11
- export declare const defaultRaknetServerOptions: RaknetServerOptions;
11
+ export declare const createDefaultServerOptions: () => RaknetServerOptions;
12
12
  //# sourceMappingURL=server-options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-options.d.ts","sourceRoot":"","sources":["../../../src/server/types/server-options.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,mBASxC,CAAC"}
1
+ {"version":3,"file":"server-options.d.ts","sourceRoot":"","sources":["../../../src/server/types/server-options.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,0BAA0B,QAAO,mBAS5C,CAAC"}
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultRaknetServerOptions = void 0;
3
+ exports.createDefaultServerOptions = void 0;
4
4
  const client_1 = require("../../client");
5
- exports.defaultRaknetServerOptions = {
5
+ const createDefaultServerOptions = () => ({
6
6
  port: 19132,
7
7
  address: "0.0.0.0",
8
- guid: (0, client_1.getRandomGuid)(),
8
+ guid: (0, client_1.generateGuid)(),
9
9
  motd: "SanctumTerra",
10
10
  maxConnections: 100,
11
11
  tickRate: 20,
12
12
  mtu: 1492,
13
13
  enableServerLogs: true,
14
- };
14
+ });
15
+ exports.createDefaultServerOptions = createDefaultServerOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanctumterra/raknet",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "description": "",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",