示例#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);
 }
示例#2
0
 public virtual Task WriteHeader(SourceBufferWriter buf)
 {
     buf.Write(HeaderId);
     buf.Write(Protocol);
     buf.Write(NetworkProtocol);
     buf.WriteString(ServerName.AsSpan(), 260);
     buf.WriteString(ClientName.AsSpan(), 260);
     buf.WriteString(MapName.AsSpan(), 260);
     buf.WriteString(GameDirectory.AsSpan(), 260);
     buf.Write(PlaybackTime);
     buf.Write(PlaybackTicks);
     buf.Write(PlaybackFrames);
     buf.Write(SignOnLength);
     return(Task.CompletedTask);
 }