private void ParseHeader() { var header = DemoHeader.ParseFrom(BitStream); if (header.Filestamp != "HL2DEMO") { throw new Exception("Invalid File-Type - expecting HL2DEMO"); } if (header.Protocol != 4) { throw new Exception("Invalid Demo-Protocol"); } Header = header; }
/// <summary> /// Parses the header (first few hundret bytes) of the demo. /// </summary> public void ParseHeader() { var header = DemoHeader.ParseFrom(BitStream); if (header.Filestamp != "HL2DEMO") { throw new InvalidDataException("Invalid File-Type - expecting HL2DEMO"); } if (header.Protocol != 4) { throw new InvalidDataException("Invalid Demo-Protocol"); } Header = header; if (HeaderParsed != null) { HeaderParsed(this, new HeaderParsedEventArgs(Header)); } }