Ejemplo n.º 1
0
 public override void Read(IStarboundStream stream)
 {
     WarptoWorld       = stream.ReadString();
     WarptoPlayer      = stream.ReadString();
     WarpAlias         = (WarpAlias)stream.ReadInt32();
     WarpActionInvalid = stream.ReadBoolean();
 }
Ejemplo n.º 2
0
        public override void Read(IStarboundStream stream)
        {
            EntityId = stream.ReadSignedVLQ();
            Death    = stream.ReadBoolean();

            Unknown = new byte[stream.Length - stream.Position];

            stream.Read(Unknown, 0, (int)(stream.Length - stream.Position));
        }
Ejemplo n.º 3
0
        public static Variant FromStream(IStarboundStream stream)
        {
            var  variant = new Variant();
            byte type    = stream.ReadUInt8();

            switch (type)
            {
            case 1:
                variant.Value = null;
                break;

            case 2:
                variant.Value = stream.ReadDouble();
                break;

            case 3:
                variant.Value = stream.ReadBoolean();
                break;

            case 4:
                variant.Value = stream.ReadVLQ();
                break;

            case 5:
                variant.Value = stream.ReadString();
                break;

            case 6:
                var array = new Variant[stream.ReadVLQ()];
                for (int i = 0; i < array.Length; i++)
                {
                    array[i] = FromStream(stream);
                }
                variant.Value = array;
                break;

            case 7:
                var dict   = new VariantDict();
                var length = stream.ReadVLQ();
                while (length-- > 0)
                {
                    dict[stream.ReadString()] = FromStream(stream);
                }

                variant.Value = dict;
                break;

            default:
                throw new InvalidOperationException(string.Format("Unknown Variant type: 0x{0:X2}", type));
            }
            return(variant);
        }
Ejemplo n.º 4
0
        public override void Read(IStarboundStream stream)
        {
            Success         = stream.ReadBoolean();
            ClientId        = stream.ReadVLQ();
            RejectionReason = stream.ReadString();
            CelestialInfos  = new List <CelestialInfo>();

            ulong length = stream.ReadVLQ();

            for (ulong i = 0; i < length; i++)
            {
                CelestialInfos.Add(CelestialInfo.FromStream(stream));
            }
        }
Ejemplo n.º 5
0
        public static Json FromStream(IStarboundStream stream)
        {
            var json = new Json();
            var type = stream.ReadUInt8();

            switch (type)
            {
            case 0:
                json.Value = null;
                break;

            case 1:
                json.Value = stream.ReadSingle();
                break;

            case 2:
                json.Value = stream.ReadBoolean();
                break;

            case 3:
                json.Value = stream.ReadInt32();
                break;

            case 4:
                json.Value = stream.ReadString();
                break;

            case 5:
                var array = new Json[stream.ReadVLQ()];
                for (int i = 0; i < array.Length; i++)
                {
                    array[i] = FromStream(stream);
                }
                json.Value = array;
                break;

            case 6:
                var dict   = new JsonDict();
                var length = stream.ReadVLQ();
                while (length-- > 0)
                {
                    dict[stream.ReadString()] = FromStream(stream);
                }

                json.Value = dict;
                break;

            case 7:
                var dict1   = new JsonDict();
                var length2 = stream.ReadVLQ();
                while (length2-- > 0)
                {
                    dict1[stream.ReadString()] = FromStream(stream);
                }

                json.Value = dict1;
                break;

            default:
                throw new InvalidOperationException(string.Format("Unknown Json type: 0x{0:X2}", type));
            }
            return(json);
        }
Ejemplo n.º 6
0
        }                                         //todo finish the rest when docs aren't ambiguous
        //public bool WarpActionInvalid { get; set; }

        public override void Read(IStarboundStream stream)
        {
            success       = stream.ReadBoolean();
            finishwriting = stream.ReadToEnd();
            //WarpActionInvalid = stream.ReadBoolean();
        }
Ejemplo n.º 7
0
 public override void Read(IStarboundStream stream)
 {
     DungeonId   = stream.ReadUInt16();
     IsProtected = stream.ReadBoolean();
 }