quake2ts 0.0.296 → 0.0.297

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.
@@ -11534,6 +11534,8 @@ var NetworkMessageParser = class _NetworkMessageParser {
11534
11534
  if (cmd <= ServerCommand.frame) {
11535
11535
  return cmd;
11536
11536
  }
11537
+ if (cmd === 22) return ServerCommand.playerinfo;
11538
+ if (cmd === 23) return ServerCommand.packetentities;
11537
11539
  return ServerCommand.bad;
11538
11540
  }
11539
11541
  if (this.protocolVersion === 0) {
@@ -12130,6 +12132,12 @@ var NetworkMessageParser = class _NetworkMessageParser {
12130
12132
  throw new Error(`Expected svc_playerinfo after svc_frame, got ${piCmd} (translated)`);
12131
12133
  }
12132
12134
  const playerState = this.parsePlayerState();
12135
+ let peCmd = this.stream.readByte();
12136
+ peCmd = this.translateCommand(peCmd);
12137
+ if (peCmd !== ServerCommand.packetentities) {
12138
+ throw new Error(`Expected svc_packetentities after svc_playerinfo, got ${peCmd} (translated)`);
12139
+ }
12140
+ const entities = this.collectPacketEntities();
12133
12141
  if (this.isDemo === RECORD_RELAY) {
12134
12142
  const connectedCount = this.stream.readByte();
12135
12143
  for (let i = 0; i < connectedCount; i++) {
@@ -12148,8 +12156,9 @@ var NetworkMessageParser = class _NetworkMessageParser {
12148
12156
  areaBits,
12149
12157
  playerState,
12150
12158
  packetEntities: {
12151
- delta: false,
12152
- entities: []
12159
+ delta: true,
12160
+ // Frame packet entities are usually delta compressed
12161
+ entities
12153
12162
  }
12154
12163
  });
12155
12164
  }