public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteVectorBitCoord(Position);
     buf.WriteUBits(DecalTextureIndex, 9);
     if (EntityIndex.HasValue && ModelIndex.HasValue)
     {
         buf.WriteBoolean(true);
         buf.WriteUBits(EntityIndex.Value, 11);
         buf.WriteUBits(ModelIndex.Value, 11);
     }
     else
     {
         buf.WriteBoolean(false);
     }
     buf.WriteBoolean(LowPriority);
     return(Task.CompletedTask);
 }
 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);
 }
Beispiel #3
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);
 }