protected override void Parse(ref BitStreamReader bsr) { EntryCount = bsr.ReadByte(); uint bitLen = DemoInfo.Game == SourceGame.PORTAL_1_1910503 ? bsr.ReadVarUInt32() : bsr.ReadUInt(DemoInfo.IsLeft4Dead2() ? 18 : 17); _data = bsr.SplitAndSkip(bitLen); // todo }
protected override void Parse(ref BitStreamReader bsr) { TableName = bsr.ReadNullTerminatedString(); MaxEntries = (short)bsr.ReadUShort(); NumEntries = (int)bsr.ReadUInt(BitUtils.HighestBitIndex(MaxEntries) + 1); uint dataLen = bsr.ReadUInt(DemoInfo.IsLeft4Dead2() ? 21 : 20); UserDataFixedSize = bsr.ReadBool(); UserDataSize = (int)(UserDataFixedSize ? bsr.ReadUInt(12) : 0); UserDataSizeBits = (int)(UserDataFixedSize ? bsr.ReadUInt(4) : 0); if (DemoRef.Header.NetworkProtocol >= 15) { Flags = (StringTableFlags)bsr.ReadUInt(DemoInfo.NewDemoProtocol ? 2 : 1); } DemoRef.StringTablesManager.CreateStringTable(this); TableUpdates = new StringTableUpdates(DemoRef, TableName, NumEntries, true); TableUpdates.ParseStream(bsr.SplitAndSkip(dataLen)); }
protected override void Parse(ref BitStreamReader bsr) { var soundIndexBits = DemoInfo.IsLeft4Dead2() ? DemoInfo.Game >= SourceGame.L4D2_2091 ? 15 : 14 : 13; SoundIndex = (int)bsr.ReadUInt(soundIndexBits); var mgr = DemoRef.StringTablesManager; if (mgr.TableReadable.GetValueOrDefault(TableNames.SoundPreCache)) { if (SoundIndex >= mgr.Tables[TableNames.SoundPreCache].Entries.Count) { DemoRef.LogError($"{GetType().Name} - sound index out of range: {SoundIndex}"); } else if (SoundIndex != 0) { SoundName = mgr.Tables[TableNames.SoundPreCache].Entries[SoundIndex].EntryName; } } }