Пример #1
0
        public void Read(StarboundStream stream)
        {
            AssetDigest = stream.ReadString();
            Claim       = stream.ReadVariant();
            bool uuid = stream.ReadBoolean();

            if (uuid)
            {
                UUID = stream.ReadUInt8Array(16);
            }
            PlayerName = stream.ReadString();
            Species    = stream.ReadString();
            Shipworld  = stream.ReadUInt8Array();
            Account    = stream.ReadString();
        }
Пример #2
0
        public static SpawnedEntity FromStream(IStarboundStream stream)
        {
            SpawnedEntity se;
            EntityType    et = (EntityType)stream.ReadUInt8();

            byte[] storeData = stream.ReadUInt8Array((int)(stream.Length - stream.Position));


            using (StarboundStream ss = new StarboundStream(storeData))
            {
                if (et == EntityType.Projectile)
                {
                    var sp = new SpawnedProjectile();
                    sp.ProjectileKey = ss.ReadString();
                    sp.Parameters    = ss.ReadVariant();

                    se = sp;
                }
                else
                {
                    se = new SpawnedEntity();
                }
            }

            se.EntityType = et;
            se.StoreData  = storeData;

            return(se);
        }
Пример #3
0
        public static CelestialLog FromStream(IStarboundStream stream)
        {
            CelestialLog log = new CelestialLog();

            byte[] logDat = stream.ReadUInt8Array();

            using (StarboundStream s = new StarboundStream(logDat))
            {
                uint visited = s.ReadUInt32();

                for (int i = 0; i < visited; i++)
                {
                    log.Visited.Add(s.ReadSystemCoordinate());
                }

                uint sectors = s.ReadUInt32();

                for (int i = 0; i < sectors; i++)
                {
                    log.Sectors.Add(new LogSector {
                        SectorName = s.ReadString(), Unknown = s.ReadBoolean()
                    });
                }

                s.ReadUInt8(); //unknown

                log.CurrentSystem   = s.ReadSystemCoordinate();
                log.CurrentLocation = s.ReadWorldCoordinate();
                log.HomeCoordinate  = s.ReadWorldCoordinate();
            }

            return(log);
        }
        public void Read(StarboundStream stream)
        {
            int discarded;

            Success         = stream.ReadBoolean();
            ClientId        = stream.ReadVLQ(out discarded);
            RejectionReason = stream.ReadString();
        }
 public void Read(StarboundStream stream)
 {
     ClaimMessage = stream.ReadString();
     Salt         = stream.ReadString();
     Rounds       = stream.ReadInt32();
 }
Пример #6
0
        public static Entity FromStream(IStarboundStream stream)
        {
            EntityType et = (EntityType)stream.ReadUInt8();

            byte[] storeData = stream.ReadUInt8Array();

            Entity ent;

            if (et == EntityType.Projectile)
            {
                ProjectileEntity pent = new ProjectileEntity();

                using (StarboundStream s = new StarboundStream(storeData))
                {
                    pent.Projectile      = s.ReadString();
                    pent.Information     = s.ReadVariant().Value as VariantDict;
                    pent.Unknown1        = s.ReadUInt8Array(17);
                    pent.ThrowerEntityId = s.ReadSignedVLQ();
                    pent.Unknown2        = s.ReadUInt8Array((int)(s.Length - s.Position));
                }

                ent = pent;
            }
            else if (et == EntityType.Player)
            {
                PlayerEntity pent = new PlayerEntity();

                using (StarboundStream s = new StarboundStream(storeData))
                {
                    /*
                     * bool uuid = s.ReadBoolean();
                     *
                     * if (uuid)
                     * {
                     */
                    byte[] uuidDat = s.ReadUInt8Array(16);

                    pent.UUID = BitConverter.ToString(uuidDat, 0).Replace("-", "").ToLower();

                    //}
                }

                ent = pent;
            }
            else if (et == EntityType.Object)
            {
                ObjectEntity oent = new ObjectEntity();

                using (StarboundStream s = new StarboundStream(storeData))
                {
                    oent.Object      = s.ReadString();
                    oent.Information = s.ReadVariant();
                    oent.Unknown     = s.ReadUInt8Array((int)(s.Length - s.Position));
                }

                ent = oent;
            }
            else
            {
                ent = new Entity();
            }

            ent.EntityType = et;
            ent.StoreData  = storeData;
            ent.EntityId   = stream.ReadSignedVLQ();

            return(ent);
        }
 public void Read(StarboundStream stream)
 {
     ClaimMessage = stream.ReadString();
     PasswordHash = stream.ReadString();
 }