public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteBits(Events, 9);
     buf.WriteBits(Data.Length, 20);
     buf.WriteBytes(Data);
     return(Task.CompletedTask);
 }
 public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteBits(EntityIndex, 11);
     buf.WriteBits(ClassId, 9);
     buf.WriteBits(Data.Length, 11);
     buf.WriteBytes(Data);
     return(Task.CompletedTask);
 }
Example #3
0
 public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteBits(MaxEntries, 11);
     buf.WriteBoolean(IsDelta);
     if (IsDelta)
     {
         buf.WriteInt32(DeltaFrom);
     }
     buf.WriteBoolean(BaseLine);
     buf.WriteBits(UpdatedEntries, 11);
     buf.WriteBits(Data.Length, 20);
     buf.WriteBoolean(UpdateBaseline);
     buf.WriteBytes(Data);
     return(Task.CompletedTask);
 }
 public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteBits(TableId, 5);
     if (NumChangedEntries.HasValue)
     {
         buf.WriteBoolean(true);
         buf.WriteInt16(NumChangedEntries.Value);
     }
     else
     {
         buf.WriteBoolean(false);
     }
     buf.WriteBits(StringData.Length, 20);
     buf.WriteBytes(StringData);
     return(Task.CompletedTask);
 }
Example #5
0
 public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteString(TableName.AsSpan());
     buf.WriteUInt16(MaxEntries);
     buf.WriteUBits(Entries, (int)System.Math.Log(MaxEntries, 2) + 1);
     buf.WriteBits(Data.Length, 20);
     buf.WriteBoolean(UserDataFixedSize);
     if (UserDataFixedSize)
     {
         buf.WriteBits(UserDataSize, 12);
     }
     if (UserDataFixedSize)
     {
         buf.WriteBits(UserDataSizeBits, 4);
     }
     buf.WriteBits(Flags, demo.Protocol == 4 ? 2 : 1);
     return(Task.CompletedTask);
 }
 public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteBits(ConVars.Count, 8);
     foreach (var convar in ConVars)
     {
         buf.WriteString(convar.Name.AsSpan());
         buf.WriteString(convar.Value.AsSpan());
     }
     return(Task.CompletedTask);
 }
Example #7
0
 public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteBoolean(ReliableSound);
     if (ReliableSound)
     {
         buf.WriteUBits(Sounds, 8);
     }
     buf.WriteBits(Data.Length, (ReliableSound) ? 8 : 16);
     buf.WriteBytes(Data);
     return(Task.CompletedTask);
 }
Example #8
0
        public override Task Write(SourceBufferWriter buf, SourceDemo demo)
        {
            var length = (short)ServerClasses.Count;

            buf.WriteInt16(length);
            buf.WriteBoolean(CreateOnClient);
            if (!CreateOnClient)
            {
                foreach (var sclass in ServerClasses)
                {
                    --length;
                    buf.WriteBits(sclass.ClassId, (int)System.Math.Log(length, 2) + 1);
                    buf.WriteString(sclass.ClassName.AsSpan());
                    buf.WriteString(sclass.DataTableName.AsSpan());
                }
            }
            return(Task.CompletedTask);
        }
 public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteBits(SoundIndex, 13);
     return(Task.CompletedTask);
 }
Example #10
0
 public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteOneBit(Unk);
     buf.WriteBits(Data.Length, 11);
     return(Task.CompletedTask);
 }