quake2ts 0.0.290 → 0.0.292
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/package.json +1 -1
- package/packages/client/dist/browser/index.global.js +11 -11
- package/packages/client/dist/browser/index.global.js.map +1 -1
- package/packages/client/dist/cjs/index.cjs +24 -12
- package/packages/client/dist/cjs/index.cjs.map +1 -1
- package/packages/client/dist/esm/index.js +24 -12
- package/packages/client/dist/esm/index.js.map +1 -1
- package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/client/dist/types/net/connection.d.ts +1 -0
- package/packages/client/dist/types/net/connection.d.ts.map +1 -1
- package/packages/engine/dist/browser/index.global.js +1 -1
- package/packages/engine/dist/browser/index.global.js.map +1 -1
- package/packages/engine/dist/cjs/index.cjs +1 -0
- package/packages/engine/dist/cjs/index.cjs.map +1 -1
- package/packages/engine/dist/esm/index.js +1 -0
- package/packages/engine/dist/esm/index.js.map +1 -1
- package/packages/engine/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/game/dist/browser/index.global.js +4 -3
- package/packages/game/dist/browser/index.global.js.map +1 -1
- package/packages/game/dist/cjs/index.cjs +116 -4
- package/packages/game/dist/cjs/index.cjs.map +1 -1
- package/packages/game/dist/esm/index.js +116 -4
- package/packages/game/dist/esm/index.js.map +1 -1
- package/packages/game/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/game/dist/types/entities/entity.d.ts +1 -0
- package/packages/game/dist/types/entities/entity.d.ts.map +1 -1
- package/packages/game/dist/types/entities/system.d.ts +7 -0
- package/packages/game/dist/types/entities/system.d.ts.map +1 -1
- package/packages/game/dist/types/entities/targets.d.ts.map +1 -1
- package/packages/game/dist/types/imports.d.ts +1 -0
- package/packages/game/dist/types/imports.d.ts.map +1 -1
- package/packages/game/dist/types/index.d.ts +2 -0
- package/packages/game/dist/types/index.d.ts.map +1 -1
- package/packages/game/dist/types/save/rerelease.d.ts.map +1 -1
- package/packages/game/dist/types/save/save.d.ts.map +1 -1
- package/packages/server/dist/index.cjs +4 -1
- package/packages/server/dist/index.js +4 -1
- package/packages/shared/dist/browser/index.global.js +1 -1
- package/packages/shared/dist/browser/index.global.js.map +1 -1
- package/packages/shared/dist/cjs/index.cjs +1 -0
- package/packages/shared/dist/cjs/index.cjs.map +1 -1
- package/packages/shared/dist/esm/index.js +1 -0
- package/packages/shared/dist/esm/index.js.map +1 -1
- package/packages/shared/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/shared/dist/types/protocol/configstrings.d.ts +1 -0
- package/packages/shared/dist/types/protocol/configstrings.d.ts.map +1 -1
- package/packages/tools/dist/tsconfig.tsbuildinfo +1 -1
|
@@ -1970,6 +1970,7 @@ var ConfigStringIndex = ((ConfigStringIndex22) => {
|
|
|
1970
1970
|
ConfigStringIndex22[ConfigStringIndex22["SkyAxis"] = 3] = "SkyAxis";
|
|
1971
1971
|
ConfigStringIndex22[ConfigStringIndex22["SkyRotate"] = 4] = "SkyRotate";
|
|
1972
1972
|
ConfigStringIndex22[ConfigStringIndex22["StatusBar"] = 5] = "StatusBar";
|
|
1973
|
+
ConfigStringIndex22[ConfigStringIndex22["HealthBarName"] = 55] = "HealthBarName";
|
|
1973
1974
|
ConfigStringIndex22[ConfigStringIndex22["CONFIG_N64_PHYSICS"] = 56] = "CONFIG_N64_PHYSICS";
|
|
1974
1975
|
ConfigStringIndex22[ConfigStringIndex22["CONFIG_CTF_TEAMS"] = 57] = "CONFIG_CTF_TEAMS";
|
|
1975
1976
|
ConfigStringIndex22[ConfigStringIndex22["CONFIG_COOP_RESPAWN_STRING"] = 58] = "CONFIG_COOP_RESPAWN_STRING";
|
|
@@ -8625,6 +8626,7 @@ var ConfigStringIndex2 = ((ConfigStringIndex22) => {
|
|
|
8625
8626
|
ConfigStringIndex22[ConfigStringIndex22["SkyAxis"] = 3] = "SkyAxis";
|
|
8626
8627
|
ConfigStringIndex22[ConfigStringIndex22["SkyRotate"] = 4] = "SkyRotate";
|
|
8627
8628
|
ConfigStringIndex22[ConfigStringIndex22["StatusBar"] = 5] = "StatusBar";
|
|
8629
|
+
ConfigStringIndex22[ConfigStringIndex22["HealthBarName"] = 55] = "HealthBarName";
|
|
8628
8630
|
ConfigStringIndex22[ConfigStringIndex22["CONFIG_N64_PHYSICS"] = 56] = "CONFIG_N64_PHYSICS";
|
|
8629
8631
|
ConfigStringIndex22[ConfigStringIndex22["CONFIG_CTF_TEAMS"] = 57] = "CONFIG_CTF_TEAMS";
|
|
8630
8632
|
ConfigStringIndex22[ConfigStringIndex22["CONFIG_COOP_RESPAWN_STRING"] = 58] = "CONFIG_COOP_RESPAWN_STRING";
|
|
@@ -9571,6 +9573,7 @@ _NetChan3.MAX_MSGLEN = 1400;
|
|
|
9571
9573
|
_NetChan3.FRAGMENT_SIZE = 1024;
|
|
9572
9574
|
_NetChan3.PACKET_HEADER = 10;
|
|
9573
9575
|
_NetChan3.HEADER_OVERHEAD = _NetChan3.PACKET_HEADER + 2;
|
|
9576
|
+
var NetChan = _NetChan3;
|
|
9574
9577
|
var AmmoType2 = /* @__PURE__ */ ((AmmoType22) => {
|
|
9575
9578
|
AmmoType22[AmmoType22["Bullets"] = 0] = "Bullets";
|
|
9576
9579
|
AmmoType22[AmmoType22["Shells"] = 1] = "Shells";
|
|
@@ -11598,6 +11601,7 @@ var MultiplayerConnection = class {
|
|
|
11598
11601
|
this.commandHistory = [];
|
|
11599
11602
|
this.driver = new BrowserWebSocketNetDriver();
|
|
11600
11603
|
this.options = options;
|
|
11604
|
+
this.netchan = new NetChan();
|
|
11601
11605
|
this.driver.onMessage((data) => this.handleMessage(data));
|
|
11602
11606
|
this.driver.onClose(() => this.handleDisconnect());
|
|
11603
11607
|
this.driver.onError((err2) => console.error("Network Error:", err2));
|
|
@@ -11608,6 +11612,7 @@ var MultiplayerConnection = class {
|
|
|
11608
11612
|
}
|
|
11609
11613
|
console.log(`Connecting to ${url}...`);
|
|
11610
11614
|
this.state = 1 /* Connecting */;
|
|
11615
|
+
this.netchan.reset();
|
|
11611
11616
|
try {
|
|
11612
11617
|
await this.driver.connect(url);
|
|
11613
11618
|
console.log("WebSocket connected.");
|
|
@@ -11639,13 +11644,12 @@ var MultiplayerConnection = class {
|
|
|
11639
11644
|
this.commandHistory.shift();
|
|
11640
11645
|
}
|
|
11641
11646
|
const writer = new BinaryWriter2();
|
|
11642
|
-
writer.writeLong(0);
|
|
11643
|
-
writer.writeLong(0);
|
|
11644
11647
|
writer.writeByte(ClientCommand.move);
|
|
11645
11648
|
writer.writeByte(0);
|
|
11646
11649
|
writer.writeLong(this.latestServerFrame);
|
|
11647
11650
|
writeUserCommand(writer, commandWithFrame);
|
|
11648
|
-
this.
|
|
11651
|
+
const packet = this.netchan.transmit(writer.getData());
|
|
11652
|
+
this.driver.send(packet);
|
|
11649
11653
|
}
|
|
11650
11654
|
handleMessage(data) {
|
|
11651
11655
|
let buffer = data.buffer;
|
|
@@ -11654,11 +11658,15 @@ var MultiplayerConnection = class {
|
|
|
11654
11658
|
new Uint8Array(newBuffer).set(data);
|
|
11655
11659
|
buffer = newBuffer;
|
|
11656
11660
|
}
|
|
11657
|
-
const
|
|
11658
|
-
|
|
11659
|
-
|
|
11660
|
-
|
|
11661
|
-
|
|
11661
|
+
const processedData = this.netchan.process(new Uint8Array(buffer));
|
|
11662
|
+
if (!processedData) {
|
|
11663
|
+
return;
|
|
11664
|
+
}
|
|
11665
|
+
if (processedData.byteLength > 0) {
|
|
11666
|
+
const stream = new BinaryStream2(processedData.buffer);
|
|
11667
|
+
this.parser = new NetworkMessageParser(stream, this);
|
|
11668
|
+
this.parser.parseMessage();
|
|
11669
|
+
}
|
|
11662
11670
|
}
|
|
11663
11671
|
handleDisconnect() {
|
|
11664
11672
|
console.log("Disconnected from server.");
|
|
@@ -11668,14 +11676,16 @@ var MultiplayerConnection = class {
|
|
|
11668
11676
|
const builder = new NetworkMessageBuilder();
|
|
11669
11677
|
builder.writeByte(ClientCommand.stringcmd);
|
|
11670
11678
|
builder.writeString("getchallenge");
|
|
11671
|
-
this.
|
|
11679
|
+
const packet = this.netchan.transmit(builder.getData());
|
|
11680
|
+
this.driver.send(packet);
|
|
11672
11681
|
}
|
|
11673
11682
|
sendConnect(challenge) {
|
|
11674
11683
|
const builder = new NetworkMessageBuilder();
|
|
11675
11684
|
builder.writeByte(ClientCommand.stringcmd);
|
|
11676
11685
|
const userinfo = `\\name\\${this.options.username}\\model\\${this.options.model}\\skin\\${this.options.skin}\\hand\\${this.options.hand ?? 0}\\fov\\${this.options.fov ?? 90}`;
|
|
11677
11686
|
builder.writeString(`connect ${PROTOCOL_VERSION_RERELEASE} ${challenge} ${userinfo}`);
|
|
11678
|
-
this.
|
|
11687
|
+
const packet = this.netchan.transmit(builder.getData());
|
|
11688
|
+
this.driver.send(packet);
|
|
11679
11689
|
}
|
|
11680
11690
|
isConnected() {
|
|
11681
11691
|
return this.state === 5 /* Active */;
|
|
@@ -11694,7 +11704,8 @@ var MultiplayerConnection = class {
|
|
|
11694
11704
|
const builder = new NetworkMessageBuilder();
|
|
11695
11705
|
builder.writeByte(ClientCommand.stringcmd);
|
|
11696
11706
|
builder.writeString("new");
|
|
11697
|
-
this.
|
|
11707
|
+
const packet = this.netchan.transmit(builder.getData());
|
|
11708
|
+
this.driver.send(packet);
|
|
11698
11709
|
this.state = 4 /* Loading */;
|
|
11699
11710
|
}
|
|
11700
11711
|
onConfigString(index, str3) {
|
|
@@ -11721,7 +11732,8 @@ var MultiplayerConnection = class {
|
|
|
11721
11732
|
const builder = new NetworkMessageBuilder();
|
|
11722
11733
|
builder.writeByte(ClientCommand.stringcmd);
|
|
11723
11734
|
builder.writeString("begin");
|
|
11724
|
-
this.
|
|
11735
|
+
const packet = this.netchan.transmit(builder.getData());
|
|
11736
|
+
this.driver.send(packet);
|
|
11725
11737
|
this.state = 5 /* Active */;
|
|
11726
11738
|
}
|
|
11727
11739
|
onFrame(frame) {
|