@quake2ts/server 0.0.868 → 0.0.873

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.
@@ -31,13 +31,15 @@ var WebSocket__default = /*#__PURE__*/_interopDefault(WebSocket);
31
31
  var fs__default = /*#__PURE__*/_interopDefault(fs);
32
32
  var path__namespace = /*#__PURE__*/_interopNamespace(path);
33
33
 
34
- // src/net/nodeWsDriver.ts
34
+ var __defProp = Object.defineProperty;
35
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
35
37
  var WebSocketNetDriver = class {
36
38
  constructor() {
37
- this.socket = null;
38
- this.messageCallback = null;
39
- this.closeCallback = null;
40
- this.errorCallback = null;
39
+ __publicField(this, "socket", null);
40
+ __publicField(this, "messageCallback", null);
41
+ __publicField(this, "closeCallback", null);
42
+ __publicField(this, "errorCallback", null);
41
43
  }
42
44
  async connect(url) {
43
45
  return new Promise((resolve2, reject) => {
@@ -242,6 +244,8 @@ function createEmptyPlayerState() {
242
244
  }
243
245
  var ClientMessageParser = class {
244
246
  constructor(stream, handler) {
247
+ __publicField(this, "stream");
248
+ __publicField(this, "handler");
245
249
  this.stream = stream;
246
250
  this.handler = handler;
247
251
  }
@@ -465,9 +469,9 @@ function writeTempEntity(writer, type, args) {
465
469
  }
466
470
  var WebSocketTransport = class {
467
471
  constructor() {
468
- this.wss = null;
469
- this.connectionCallback = null;
470
- this.errorCallback = null;
472
+ __publicField(this, "wss", null);
473
+ __publicField(this, "connectionCallback", null);
474
+ __publicField(this, "errorCallback", null);
471
475
  }
472
476
  async listen(port) {
473
477
  return new Promise((resolve2) => {
@@ -505,12 +509,20 @@ var FRAME_RATE = 10;
505
509
  var FRAME_TIME_MS = 1e3 / FRAME_RATE;
506
510
  var DedicatedServer = class {
507
511
  constructor(optionsOrPort = {}) {
508
- this.game = null;
509
- this.frameTimeout = null;
510
- this.entityIndex = null;
512
+ __publicField(this, "transport");
513
+ __publicField(this, "svs");
514
+ __publicField(this, "sv");
515
+ __publicField(this, "game", null);
516
+ __publicField(this, "frameTimeout", null);
517
+ __publicField(this, "entityIndex", null);
511
518
  // History buffer: Map<EntityIndex, HistoryArray>
512
- this.history = /* @__PURE__ */ new Map();
513
- this.backup = /* @__PURE__ */ new Map();
519
+ __publicField(this, "history", /* @__PURE__ */ new Map());
520
+ __publicField(this, "backup", /* @__PURE__ */ new Map());
521
+ // Events
522
+ __publicField(this, "onClientConnected");
523
+ __publicField(this, "onClientDisconnected");
524
+ __publicField(this, "onServerError");
525
+ __publicField(this, "options");
514
526
  const options = typeof optionsOrPort === "number" ? { port: optionsOrPort } : optionsOrPort;
515
527
  this.options = {
516
528
  port: 27910,