quake2ts 0.0.263 → 0.0.266
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 +13 -13
- package/packages/client/dist/browser/index.global.js.map +1 -1
- package/packages/client/dist/cjs/index.cjs +25 -12
- package/packages/client/dist/cjs/index.cjs.map +1 -1
- package/packages/client/dist/esm/index.js +25 -12
- package/packages/client/dist/esm/index.js.map +1 -1
- package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/engine/dist/browser/index.global.js +6 -6
- package/packages/engine/dist/browser/index.global.js.map +1 -1
- package/packages/engine/dist/cjs/index.cjs +25 -12
- package/packages/engine/dist/cjs/index.cjs.map +1 -1
- package/packages/engine/dist/esm/index.js +25 -12
- package/packages/engine/dist/esm/index.js.map +1 -1
- package/packages/engine/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/engine/dist/types/demo/parser.d.ts +2 -0
- package/packages/engine/dist/types/demo/parser.d.ts.map +1 -1
- package/packages/engine/dist/types/demo/playback.d.ts +1 -0
- package/packages/engine/dist/types/demo/playback.d.ts.map +1 -1
- package/packages/game/dist/browser/index.global.js +3 -2
- package/packages/game/dist/browser/index.global.js.map +1 -1
- package/packages/game/dist/cjs/index.cjs +984 -284
- package/packages/game/dist/cjs/index.cjs.map +1 -1
- package/packages/game/dist/esm/index.js +986 -286
- package/packages/game/dist/esm/index.js.map +1 -1
- package/packages/game/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/game/dist/types/combat/weapons/animation.d.ts +9 -0
- package/packages/game/dist/types/combat/weapons/animation.d.ts.map +1 -1
- package/packages/game/dist/types/combat/weapons/firing.d.ts.map +1 -1
- package/packages/game/dist/types/combat/weapons/switching.d.ts +1 -0
- package/packages/game/dist/types/combat/weapons/switching.d.ts.map +1 -1
- package/packages/game/dist/types/entities/entity.d.ts +2 -1
- package/packages/game/dist/types/entities/entity.d.ts.map +1 -1
- package/packages/game/dist/types/entities/monsters/actor.d.ts +6 -0
- package/packages/game/dist/types/entities/monsters/actor.d.ts.map +1 -0
- package/packages/game/dist/types/entities/monsters/index.d.ts.map +1 -1
- package/packages/game/dist/types/entities/monsters/jorg.d.ts.map +1 -1
- package/packages/game/dist/types/entities/monsters/makron.d.ts.map +1 -1
- package/packages/game/dist/types/entities/player.d.ts +2 -0
- package/packages/game/dist/types/entities/player.d.ts.map +1 -1
- package/packages/game/dist/types/entities/player_anim.d.ts +50 -0
- package/packages/game/dist/types/entities/player_anim.d.ts.map +1 -0
- package/packages/game/dist/types/index.d.ts.map +1 -1
|
@@ -11190,24 +11190,29 @@ var NetworkMessageParser = class _NetworkMessageParser {
|
|
|
11190
11190
|
this.stream = stream;
|
|
11191
11191
|
this.handler = handler;
|
|
11192
11192
|
}
|
|
11193
|
+
setProtocolVersion(version) {
|
|
11194
|
+
this.protocolVersion = version;
|
|
11195
|
+
}
|
|
11196
|
+
getProtocolVersion() {
|
|
11197
|
+
return this.protocolVersion;
|
|
11198
|
+
}
|
|
11193
11199
|
translateCommand(cmd) {
|
|
11194
11200
|
if (this.protocolVersion === 0) {
|
|
11195
11201
|
if (cmd === 7) return ServerCommand.serverdata;
|
|
11196
11202
|
if (cmd === 12) return ServerCommand.serverdata;
|
|
11197
11203
|
}
|
|
11198
|
-
if (this.protocolVersion === 25) {
|
|
11199
|
-
if (cmd >= 7 && cmd <= 15) return cmd + 5;
|
|
11200
|
-
if (cmd === 1) return ServerCommand.print;
|
|
11201
|
-
if (cmd === 2) return ServerCommand.stufftext;
|
|
11202
|
-
if (cmd === 3) return ServerCommand.sound;
|
|
11203
|
-
if (cmd === 4) return ServerCommand.nop;
|
|
11204
|
-
if (cmd === 5) return ServerCommand.disconnect;
|
|
11205
|
-
if (cmd === 6) return ServerCommand.reconnect;
|
|
11206
|
-
if (cmd === 16) return ServerCommand.temp_entity;
|
|
11207
|
-
}
|
|
11208
11204
|
if (this.protocolVersion === PROTOCOL_VERSION_RERELEASE) {
|
|
11209
11205
|
return cmd;
|
|
11210
11206
|
}
|
|
11207
|
+
if (this.protocolVersion === 34 || this.protocolVersion === 25) {
|
|
11208
|
+
if (cmd <= ServerCommand.frame) {
|
|
11209
|
+
return cmd;
|
|
11210
|
+
}
|
|
11211
|
+
return ServerCommand.bad;
|
|
11212
|
+
}
|
|
11213
|
+
if (this.protocolVersion === 0) {
|
|
11214
|
+
return cmd;
|
|
11215
|
+
}
|
|
11211
11216
|
return cmd;
|
|
11212
11217
|
}
|
|
11213
11218
|
parseMessage() {
|
|
@@ -11220,6 +11225,8 @@ var NetworkMessageParser = class _NetworkMessageParser {
|
|
|
11220
11225
|
cmd = this.translateCommand(cmd);
|
|
11221
11226
|
try {
|
|
11222
11227
|
switch (cmd) {
|
|
11228
|
+
case ServerCommand.bad:
|
|
11229
|
+
return;
|
|
11223
11230
|
case ServerCommand.nop:
|
|
11224
11231
|
break;
|
|
11225
11232
|
case ServerCommand.disconnect:
|
|
@@ -11791,9 +11798,10 @@ var NetworkMessageParser = class _NetworkMessageParser {
|
|
|
11791
11798
|
const surpressCount = this.stream.readByte();
|
|
11792
11799
|
const areaBytes = this.stream.readByte();
|
|
11793
11800
|
const areaBits = this.stream.readData(areaBytes);
|
|
11794
|
-
|
|
11801
|
+
let piCmd = this.stream.readByte();
|
|
11802
|
+
piCmd = this.translateCommand(piCmd);
|
|
11795
11803
|
if (piCmd !== ServerCommand.playerinfo) {
|
|
11796
|
-
throw new Error(`Expected svc_playerinfo after svc_frame, got ${piCmd}`);
|
|
11804
|
+
throw new Error(`Expected svc_playerinfo after svc_frame, got ${piCmd} (translated)`);
|
|
11797
11805
|
}
|
|
11798
11806
|
const playerState = this.parsePlayerState();
|
|
11799
11807
|
if (this.isDemo === RECORD_RELAY) {
|
|
@@ -12033,6 +12041,7 @@ var DemoPlaybackController = class {
|
|
|
12033
12041
|
this.reader = null;
|
|
12034
12042
|
this.state = 0 /* Stopped */;
|
|
12035
12043
|
this.playbackSpeed = 1;
|
|
12044
|
+
this.currentProtocolVersion = 0;
|
|
12036
12045
|
// Timing
|
|
12037
12046
|
this.accumulatedTime = 0;
|
|
12038
12047
|
this.frameDuration = 100;
|
|
@@ -12044,6 +12053,7 @@ var DemoPlaybackController = class {
|
|
|
12044
12053
|
this.reader = new DemoReader(buffer);
|
|
12045
12054
|
this.state = 0 /* Stopped */;
|
|
12046
12055
|
this.accumulatedTime = 0;
|
|
12056
|
+
this.currentProtocolVersion = 0;
|
|
12047
12057
|
}
|
|
12048
12058
|
play() {
|
|
12049
12059
|
if (this.reader) {
|
|
@@ -12061,6 +12071,7 @@ var DemoPlaybackController = class {
|
|
|
12061
12071
|
this.reader.reset();
|
|
12062
12072
|
}
|
|
12063
12073
|
this.accumulatedTime = 0;
|
|
12074
|
+
this.currentProtocolVersion = 0;
|
|
12064
12075
|
}
|
|
12065
12076
|
setFrameDuration(ms) {
|
|
12066
12077
|
this.frameDuration = ms;
|
|
@@ -12081,7 +12092,9 @@ var DemoPlaybackController = class {
|
|
|
12081
12092
|
return;
|
|
12082
12093
|
}
|
|
12083
12094
|
const parser = new NetworkMessageParser(block.data, this.handler);
|
|
12095
|
+
parser.setProtocolVersion(this.currentProtocolVersion);
|
|
12084
12096
|
parser.parseMessage();
|
|
12097
|
+
this.currentProtocolVersion = parser.getProtocolVersion();
|
|
12085
12098
|
this.accumulatedTime -= this.frameDuration;
|
|
12086
12099
|
}
|
|
12087
12100
|
}
|