public override Task Write(SourceBufferWriter buf, SourceDemo demo) { buf.WriteInt16(Protocol); buf.WriteInt32(ServerCount); buf.WriteBoolean(IsHltv); buf.WriteBoolean(IsDedicated); buf.WriteInt32(ClientCrc); buf.WriteUInt16(MaxClasses); buf.WriteInt32(MapCrc); buf.WriteByte(PlayerSlot); buf.WriteByte(MaxClients); if (Unk.HasValue) { if (demo.Protocol == 4) { buf.WriteInt32(Unk.Value); } else if (demo.NetworkProtocol == 24) { buf.WriteInt32(Unk.Value); } } buf.WriteString(GameDir.AsSpan()); buf.WriteString(MapName.AsSpan()); buf.WriteString(SkyName.AsSpan()); buf.WriteString(HostName.AsSpan()); return(Task.CompletedTask); }
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); }
public override Task Write(SourceBufferWriter buf, SourceDemo demo) { buf.WriteBoolean(NeedsDecoder); buf.WriteInt16(Length); buf.WriteBytes(Data); return(Task.CompletedTask); }
public override Task Write(SourceBufferWriter buf, SourceDemo demo) { buf.WriteBoolean(Relative); buf.WriteInt16((short)Angle.X); buf.WriteInt16((short)Angle.Y); buf.WriteInt16((short)Angle.Z); return(Task.CompletedTask); }
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); }
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.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.WriteBoolean(Paused); return(Task.CompletedTask); }