Exemplo n.º 1
0
        public override void Write(IStarboundStream stream)
        {
            stream.WriteBoolean(Success);
            stream.WriteVLQ(ClientId);
            stream.WriteString(RejectionReason);
            stream.WriteVLQ((ulong)CelestialInfos.Count);

            foreach (CelestialInfo cInfo in CelestialInfos)
            {
                cInfo.WriteTo(stream);
            }
        }
Exemplo n.º 2
0
 public void WriteTo(IStarboundStream stream)
 {
     if (Value == null)
     {
         stream.WriteUInt8(1);
     }
     else if (Value is double)
     {
         stream.WriteInt8(2);
         stream.WriteDouble((double)Value);
     }
     else if (Value is bool)
     {
         stream.WriteInt8(3);
         stream.WriteBoolean((bool)Value);
     }
     else if (Value is ulong)
     {
         stream.WriteInt8(4);
         stream.WriteVLQ((ulong)Value);
     }
     else if (Value is string)
     {
         stream.WriteInt8(5);
         stream.WriteString((string)Value);
     }
     else if (Value is Variant[])
     {
         stream.WriteInt8(6);
         var array = (Variant[])Value;
         stream.WriteVLQ((ulong)array.Length);
         for (int i = 0; i < array.Length; i++)
         {
             array[i].WriteTo(stream);
         }
     }
     else if (Value is VariantDict)
     {
         stream.WriteInt8(7);
         var dict = (VariantDict)Value;
         stream.WriteVLQ((ulong)dict.Count);
         foreach (var kvp in dict)
         {
             stream.WriteString(kvp.Key);
             kvp.Value.WriteTo(stream);
         }
     }
 }
Exemplo n.º 3
0
 public void WriteTo(IStarboundStream stream)
 {
     if (Value == null)
     {
         stream.WriteUInt8(0);
     }
     else if (Value is float)
     {
         stream.WriteInt8(1);
         stream.WriteSingle((float)Value);
     }
     else if (Value is bool)
     {
         stream.WriteInt8(2);
         stream.WriteBoolean((bool)Value);
     }
     else if (Value is int)
     {
         stream.WriteInt8(3);
         stream.WriteInt32((int)Value);
     }
     else if (Value is string)
     {
         stream.WriteInt8(4);
         stream.WriteString((string)Value);
     }
     else if (Value is Json[])
     {
         stream.WriteInt8(5);
         var array = (Json[])Value;
         stream.WriteVLQ((ulong)array.Length);
         for (var i = 0; i < array.Length; i++)
         {
             array[i].WriteTo(stream);
         }
     }
     else if (Value is JsonDict)
     {
         stream.WriteInt8(7);
         var dict = (JsonDict)Value;
         stream.WriteVLQ((ulong)dict.Count);
         foreach (var kvp in dict)
         {
             stream.WriteString(kvp.Key);
             kvp.Value.WriteTo(stream);
         }
     }
 }
Exemplo n.º 4
0
 public override void Write(IStarboundStream stream)
 {
     stream.WriteVLQ((ulong)Position.Count);
     Position.ForEach(p => p.WriteTo(stream));
     stream.WriteUInt8((byte)Layer);
     SourcePos.WriteTo(stream);
     TileDamage.WriteTo(stream);
 }
Exemplo n.º 5
0
 public override void Write(IStarboundStream stream)
 {
     stream.WriteVLQ(CurrentStep);
 }
Exemplo n.º 6
0
 public override void Write(IStarboundStream stream)
 {
     stream.WriteInt32(EntityId);
     item.WriteTo(stream);
     stream.WriteVLQ(slot);
 }
Exemplo n.º 7
0
 public void WriteTo(IStarboundStream stream)
 {
     stream.WriteString(name);
     stream.WriteVLQ(count);
     parameters.WriteTo(stream);
 }