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.
@@ -7514,6 +7514,8 @@ var NetworkMessageParser = class _NetworkMessageParser {
7514
7514
  if (cmd <= ServerCommand.frame) {
7515
7515
  return cmd;
7516
7516
  }
7517
+ if (cmd === 22) return ServerCommand.playerinfo;
7518
+ if (cmd === 23) return ServerCommand.packetentities;
7517
7519
  return ServerCommand.bad;
7518
7520
  }
7519
7521
  if (this.protocolVersion === 0) {
@@ -8110,6 +8112,12 @@ var NetworkMessageParser = class _NetworkMessageParser {
8110
8112
  throw new Error(`Expected svc_playerinfo after svc_frame, got ${piCmd} (translated)`);
8111
8113
  }
8112
8114
  const playerState = this.parsePlayerState();
8115
+ let peCmd = this.stream.readByte();
8116
+ peCmd = this.translateCommand(peCmd);
8117
+ if (peCmd !== ServerCommand.packetentities) {
8118
+ throw new Error(`Expected svc_packetentities after svc_playerinfo, got ${peCmd} (translated)`);
8119
+ }
8120
+ const entities = this.collectPacketEntities();
8113
8121
  if (this.isDemo === RECORD_RELAY) {
8114
8122
  const connectedCount = this.stream.readByte();
8115
8123
  for (let i = 0; i < connectedCount; i++) {
@@ -8128,8 +8136,9 @@ var NetworkMessageParser = class _NetworkMessageParser {
8128
8136
  areaBits,
8129
8137
  playerState,
8130
8138
  packetEntities: {
8131
- delta: false,
8132
- entities: []
8139
+ delta: true,
8140
+ // Frame packet entities are usually delta compressed
8141
+ entities
8133
8142
  }
8134
8143
  });
8135
8144
  }