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
|
@@ -2002,6 +2002,7 @@ var ConfigStringIndex = ((ConfigStringIndex22) => {
|
|
|
2002
2002
|
ConfigStringIndex22[ConfigStringIndex22["SkyAxis"] = 3] = "SkyAxis";
|
|
2003
2003
|
ConfigStringIndex22[ConfigStringIndex22["SkyRotate"] = 4] = "SkyRotate";
|
|
2004
2004
|
ConfigStringIndex22[ConfigStringIndex22["StatusBar"] = 5] = "StatusBar";
|
|
2005
|
+
ConfigStringIndex22[ConfigStringIndex22["HealthBarName"] = 55] = "HealthBarName";
|
|
2005
2006
|
ConfigStringIndex22[ConfigStringIndex22["CONFIG_N64_PHYSICS"] = 56] = "CONFIG_N64_PHYSICS";
|
|
2006
2007
|
ConfigStringIndex22[ConfigStringIndex22["CONFIG_CTF_TEAMS"] = 57] = "CONFIG_CTF_TEAMS";
|
|
2007
2008
|
ConfigStringIndex22[ConfigStringIndex22["CONFIG_COOP_RESPAWN_STRING"] = 58] = "CONFIG_COOP_RESPAWN_STRING";
|
|
@@ -8657,6 +8658,7 @@ var ConfigStringIndex2 = ((ConfigStringIndex22) => {
|
|
|
8657
8658
|
ConfigStringIndex22[ConfigStringIndex22["SkyAxis"] = 3] = "SkyAxis";
|
|
8658
8659
|
ConfigStringIndex22[ConfigStringIndex22["SkyRotate"] = 4] = "SkyRotate";
|
|
8659
8660
|
ConfigStringIndex22[ConfigStringIndex22["StatusBar"] = 5] = "StatusBar";
|
|
8661
|
+
ConfigStringIndex22[ConfigStringIndex22["HealthBarName"] = 55] = "HealthBarName";
|
|
8660
8662
|
ConfigStringIndex22[ConfigStringIndex22["CONFIG_N64_PHYSICS"] = 56] = "CONFIG_N64_PHYSICS";
|
|
8661
8663
|
ConfigStringIndex22[ConfigStringIndex22["CONFIG_CTF_TEAMS"] = 57] = "CONFIG_CTF_TEAMS";
|
|
8662
8664
|
ConfigStringIndex22[ConfigStringIndex22["CONFIG_COOP_RESPAWN_STRING"] = 58] = "CONFIG_COOP_RESPAWN_STRING";
|
|
@@ -9603,6 +9605,7 @@ _NetChan3.MAX_MSGLEN = 1400;
|
|
|
9603
9605
|
_NetChan3.FRAGMENT_SIZE = 1024;
|
|
9604
9606
|
_NetChan3.PACKET_HEADER = 10;
|
|
9605
9607
|
_NetChan3.HEADER_OVERHEAD = _NetChan3.PACKET_HEADER + 2;
|
|
9608
|
+
var NetChan = _NetChan3;
|
|
9606
9609
|
var AmmoType2 = /* @__PURE__ */ ((AmmoType22) => {
|
|
9607
9610
|
AmmoType22[AmmoType22["Bullets"] = 0] = "Bullets";
|
|
9608
9611
|
AmmoType22[AmmoType22["Shells"] = 1] = "Shells";
|
|
@@ -11630,6 +11633,7 @@ var MultiplayerConnection = class {
|
|
|
11630
11633
|
this.commandHistory = [];
|
|
11631
11634
|
this.driver = new BrowserWebSocketNetDriver();
|
|
11632
11635
|
this.options = options;
|
|
11636
|
+
this.netchan = new NetChan();
|
|
11633
11637
|
this.driver.onMessage((data) => this.handleMessage(data));
|
|
11634
11638
|
this.driver.onClose(() => this.handleDisconnect());
|
|
11635
11639
|
this.driver.onError((err2) => console.error("Network Error:", err2));
|
|
@@ -11640,6 +11644,7 @@ var MultiplayerConnection = class {
|
|
|
11640
11644
|
}
|
|
11641
11645
|
console.log(`Connecting to ${url}...`);
|
|
11642
11646
|
this.state = 1 /* Connecting */;
|
|
11647
|
+
this.netchan.reset();
|
|
11643
11648
|
try {
|
|
11644
11649
|
await this.driver.connect(url);
|
|
11645
11650
|
console.log("WebSocket connected.");
|
|
@@ -11671,13 +11676,12 @@ var MultiplayerConnection = class {
|
|
|
11671
11676
|
this.commandHistory.shift();
|
|
11672
11677
|
}
|
|
11673
11678
|
const writer = new BinaryWriter2();
|
|
11674
|
-
writer.writeLong(0);
|
|
11675
|
-
writer.writeLong(0);
|
|
11676
11679
|
writer.writeByte(ClientCommand.move);
|
|
11677
11680
|
writer.writeByte(0);
|
|
11678
11681
|
writer.writeLong(this.latestServerFrame);
|
|
11679
11682
|
writeUserCommand(writer, commandWithFrame);
|
|
11680
|
-
this.
|
|
11683
|
+
const packet = this.netchan.transmit(writer.getData());
|
|
11684
|
+
this.driver.send(packet);
|
|
11681
11685
|
}
|
|
11682
11686
|
handleMessage(data) {
|
|
11683
11687
|
let buffer = data.buffer;
|
|
@@ -11686,11 +11690,15 @@ var MultiplayerConnection = class {
|
|
|
11686
11690
|
new Uint8Array(newBuffer).set(data);
|
|
11687
11691
|
buffer = newBuffer;
|
|
11688
11692
|
}
|
|
11689
|
-
const
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
|
|
11693
|
+
const processedData = this.netchan.process(new Uint8Array(buffer));
|
|
11694
|
+
if (!processedData) {
|
|
11695
|
+
return;
|
|
11696
|
+
}
|
|
11697
|
+
if (processedData.byteLength > 0) {
|
|
11698
|
+
const stream = new BinaryStream2(processedData.buffer);
|
|
11699
|
+
this.parser = new NetworkMessageParser(stream, this);
|
|
11700
|
+
this.parser.parseMessage();
|
|
11701
|
+
}
|
|
11694
11702
|
}
|
|
11695
11703
|
handleDisconnect() {
|
|
11696
11704
|
console.log("Disconnected from server.");
|
|
@@ -11700,14 +11708,16 @@ var MultiplayerConnection = class {
|
|
|
11700
11708
|
const builder = new NetworkMessageBuilder();
|
|
11701
11709
|
builder.writeByte(ClientCommand.stringcmd);
|
|
11702
11710
|
builder.writeString("getchallenge");
|
|
11703
|
-
this.
|
|
11711
|
+
const packet = this.netchan.transmit(builder.getData());
|
|
11712
|
+
this.driver.send(packet);
|
|
11704
11713
|
}
|
|
11705
11714
|
sendConnect(challenge) {
|
|
11706
11715
|
const builder = new NetworkMessageBuilder();
|
|
11707
11716
|
builder.writeByte(ClientCommand.stringcmd);
|
|
11708
11717
|
const userinfo = `\\name\\${this.options.username}\\model\\${this.options.model}\\skin\\${this.options.skin}\\hand\\${this.options.hand ?? 0}\\fov\\${this.options.fov ?? 90}`;
|
|
11709
11718
|
builder.writeString(`connect ${PROTOCOL_VERSION_RERELEASE} ${challenge} ${userinfo}`);
|
|
11710
|
-
this.
|
|
11719
|
+
const packet = this.netchan.transmit(builder.getData());
|
|
11720
|
+
this.driver.send(packet);
|
|
11711
11721
|
}
|
|
11712
11722
|
isConnected() {
|
|
11713
11723
|
return this.state === 5 /* Active */;
|
|
@@ -11726,7 +11736,8 @@ var MultiplayerConnection = class {
|
|
|
11726
11736
|
const builder = new NetworkMessageBuilder();
|
|
11727
11737
|
builder.writeByte(ClientCommand.stringcmd);
|
|
11728
11738
|
builder.writeString("new");
|
|
11729
|
-
this.
|
|
11739
|
+
const packet = this.netchan.transmit(builder.getData());
|
|
11740
|
+
this.driver.send(packet);
|
|
11730
11741
|
this.state = 4 /* Loading */;
|
|
11731
11742
|
}
|
|
11732
11743
|
onConfigString(index, str3) {
|
|
@@ -11753,7 +11764,8 @@ var MultiplayerConnection = class {
|
|
|
11753
11764
|
const builder = new NetworkMessageBuilder();
|
|
11754
11765
|
builder.writeByte(ClientCommand.stringcmd);
|
|
11755
11766
|
builder.writeString("begin");
|
|
11756
|
-
this.
|
|
11767
|
+
const packet = this.netchan.transmit(builder.getData());
|
|
11768
|
+
this.driver.send(packet);
|
|
11757
11769
|
this.state = 5 /* Active */;
|
|
11758
11770
|
}
|
|
11759
11771
|
onFrame(frame) {
|