Exemple #1
0
 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(ConVars.Count, 8);
     foreach (var convar in ConVars)
     {
         buf.WriteString(convar.Name.AsSpan());
         buf.WriteString(convar.Value.AsSpan());
     }
     return(Task.CompletedTask);
 }
Exemple #3
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);
        }
Exemple #4
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);
 }
Exemple #5
0
 public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteByte(SignonState);
     buf.WriteInt32(SpawnCount);
     if (demo.Protocol == 4)
     {
         buf.WriteInt32(NumServerPlayers);
         if (PlayerNetworkIds.Length > 0)
         {
             buf.WriteInt32(PlayerNetworkIds.Length);
             buf.WriteBytes(PlayerNetworkIds);
         }
         if (MapName.Length > 0)
         {
             buf.WriteInt32(MapName.Length);
             buf.WriteString(MapName.AsSpan());
         }
     }
     return(Task.CompletedTask);
 }
Exemple #6
0
 public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteString(Message.AsSpan());
     return(Task.CompletedTask);
 }
 public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteInt32(Cookie);
     buf.WriteString(CvarName.AsSpan());
     return(Task.CompletedTask);
 }