@quake2ts/server 0.0.869 → 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.
- package/dist/cjs/index.cjs +25 -13
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +25 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
package/dist/cjs/index.cjs
CHANGED
|
@@ -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
|
-
|
|
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
|
|
38
|
-
this
|
|
39
|
-
this
|
|
40
|
-
this
|
|
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
|
|
469
|
-
this
|
|
470
|
-
this
|
|
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
|
|
509
|
-
this
|
|
510
|
-
this
|
|
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
|
|
513
|
-
this
|
|
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,
|