Exemplo n.º 1
0
 protected override void Parse(ref BitStreamReader bsr)
 {
     FileStamp       = bsr.ReadStringOfLength(8);
     DemoProtocol    = bsr.ReadUInt();
     NetworkProtocol = bsr.ReadUInt();
     ServerName      = bsr.ReadStringOfLength(260);
     ClientName      = bsr.ReadStringOfLength(260);
     MapName         = bsr.ReadStringOfLength(260);
     GameDirectory   = bsr.ReadStringOfLength(260);
     PlaybackTime    = bsr.ReadFloat();
     TickCount       = bsr.ReadSInt();
     FrameCount      = bsr.ReadSInt();
     SignOnLength    = bsr.ReadUInt();
 }
Exemplo n.º 2
0
 protected override void Parse(ref BitStreamReader bsr)
 {
     Name = bsr.ReadNullTerminatedString();
     if (bsr.ReadBool())
     {
         ushort dataLen = bsr.ReadUShort();
         Data = bsr.ReadStringOfLength(dataLen);
     }
 }
Exemplo n.º 3
0
 // we're reading a player_info_t, so take alignment into account
 protected override void Parse(ref BitStreamReader bsr)
 {
     if (DemoInfo.NewDemoProtocol && !DemoInfo.IsLeft4Dead1())
     {
         SteamId = (CSteamId)bsr.ReadULong();
     }
     Name   = bsr.ReadStringOfLength(MaxPlayerNameLength);
     UserId = bsr.ReadSInt();
     Guid   = bsr.ReadStringOfLength(SignedGuidLen + 1);
     bsr.SkipBytes(3);
     FriendsId   = bsr.ReadUInt();
     FriendsName = bsr.ReadStringOfLength(MaxPlayerNameLength);
     FakePlayer  = bsr.ReadByte() != 0;
     IsHlTv      = bsr.ReadByte() != 0;
     bsr.SkipBytes(2);
     CustomFiles     = new[] { bsr.ReadUInt(), bsr.ReadUInt(), bsr.ReadUInt(), bsr.ReadUInt() };
     FilesDownloaded = bsr.ReadByte();
     bsr.SkipBytes(3);
     // for demo protocol 4 there's 4 additional bytes somewhere for some reason
 }
Exemplo n.º 4
0
        protected override void Parse(ref BitStreamReader bsr)
        {
            Command = bsr.ReadStringOfLength(bsr.ReadSInt());
            TimingAdjustment.AdjustFromConsoleCmd(this);
            Match match = KeyPressRegex.Match(Command);

            if (match.Success)
            {
                int val = int.Parse(match.Groups[1].Value);
                if (val >= 0 && val < (int)Packets.ButtonCode.LAST)
                {
                    ButtonCode = (ButtonCode)val;
                }
            }
        }
Exemplo n.º 5
0
 protected override void Parse(ref BitStreamReader bsr)
 {
     SignOnState = (SignOnState)bsr.ReadByte();
     SpawnCount  = bsr.ReadSInt();
     if (DemoInfo.NewDemoProtocol)
     {
         NumServerPlayers = bsr.ReadUInt();
         int length = (int)bsr.ReadUInt();
         if (length > 0)
         {
             PlayerNetworkIds = bsr.ReadBytes(length);
         }
         length = (int)bsr.ReadUInt();
         if (length > 0)                 // the string still seams to be null terminated (sometimes?)
         {
             MapName = bsr.ReadStringOfLength(length).Split(new char[] { '\0' }, 2)[0];
         }
     }
     if (SignOnState == SignOnState.PreSpawn)
     {
         DemoRef.ClientSoundSequence = 1;                 // reset sound sequence number after receiving SignOn sounds
     }
 }
Exemplo n.º 6
0
 protected override void Parse(ref BitStreamReader bsr)
 {
     Str = bsr.ReadStringOfLength(bsr.BitsRemaining / 8);
 }