public static Humanoid LoadFromBin(BinaryReader reader)
        {
            Humanoid result = new Humanoid();

            result.Name                 = StringIO.LoadFromBin(reader);
            result.Species              = StringIO.LoadFromBin(reader);
            result.Gender               = reader.ReadByte();
            result.HairGroup            = StringIO.LoadFromBin(reader);
            result.HairType             = StringIO.LoadFromBin(reader);
            result.HairDirectives       = StringIO.LoadFromBin(reader);
            result.BodyDirectives       = StringIO.LoadFromBin(reader);
            result.FacialHairGroup      = StringIO.LoadFromBin(reader);
            result.FacialHairType       = StringIO.LoadFromBin(reader);
            result.FacialHairDirectives = StringIO.LoadFromBin(reader);
            result.FacialMaskGroup      = StringIO.LoadFromBin(reader);
            result.FacialMaskType       = StringIO.LoadFromBin(reader);
            result.FacialMaskDirectives = StringIO.LoadFromBin(reader);
            result.Idle                 = StringIO.LoadFromBin(reader);
            result.ArmIdle              = StringIO.LoadFromBin(reader);
            result.HeadOffsetX          = reader.ReadSingle();
            result.HeadOffsetY          = reader.ReadSingle();
            result.ArmOffsetX           = reader.ReadSingle();
            result.ArmOffsetY           = reader.ReadSingle();

            result.Color = new byte[4];

            for (int i = 0; i < 4; i++)
            {
                result.Color[i] = reader.ReadByte();
            }

            return(result);
        }
Exemple #2
0
        public static TechController LoadFromBin(BinaryReader reader)
        {
            TechController result = new TechController();

            PackedInt sizeOfData = PackedInt.LoadFromBin(reader);
            long      endPos     = reader.BaseStream.Position + (long)sizeOfData.Value;

            PackedInt numTechs = PackedInt.LoadFromBin(reader);

            for (ulong i = 0; i < numTechs.Value; i++)
            {
                result.Tech.Add(StringIO.LoadFromBin(reader));
            }

            long numUnkBytes = endPos - reader.BaseStream.Position;

            result.UNK_ARR_1 = new byte[(int)numUnkBytes];

            for (long i = 0; i < numUnkBytes; i++)
            {
                result.UNK_ARR_1[i] = reader.ReadByte();
            }

            return(result);
        }
        public static Player LoadFromBin(BinaryReader reader)
        {
            Player result = new Player();

            PackedInt lengthOfData = PackedInt.LoadFromBin(reader);

            result.HasUUID = reader.ReadBoolean();
            if (result.HasUUID)
            {
                result.UUID = new byte[UUID_LENGTH];

                for (int i = 0; i < UUID_LENGTH; i++)
                {
                    result.UUID[i] = reader.ReadByte();
                }
            }

            result.HumanoidEntity = Humanoid.LoadFromBin(reader);
            result.DefaultStatus  = EntityStatus.LoadFromBin(reader);
            result.CurrentStatus  = Status.LoadFromBin(reader);
            result.Description    = StringIO.LoadFromBin(reader);
            result.PlayingTime    = reader.ReadDouble();
            result.Inventory      = PlayerInventory.LoadFromBin(reader);
            result.Blueprints     = BlueprintData.LoadFromBin(reader);
            result.Tech           = TechController.LoadFromBin(reader);
            result.EquippedArmor  = Armor.LoadFromBin(reader);
            result.LeftHandItem   = Item.LoadFromBin(reader);
            result.RightHandItem  = Item.LoadFromBin(reader);

            return(result);
        }
        public static EntityStatus LoadFromBin(BinaryReader reader)
        {
            EntityStatus result = new EntityStatus();

            result.Admin = reader.ReadBoolean();
            result.MinBodyTemperature = reader.ReadSingle();
            result.MaxBodyTemperature = reader.ReadSingle();
            result.IdealTemperature   = reader.ReadSingle();
            result.MaxWarmth          = reader.ReadSingle();
            result.UNK_VAL_01         = reader.ReadSingle();
            result.WarmthRate         = reader.ReadSingle();
            result.ConfortRegen       = reader.ReadSingle();
            result.MaxHealth          = reader.ReadSingle();
            result.MaxEnergy          = reader.ReadSingle();
            result.EnergyRate         = reader.ReadSingle();
            result.MaxFood            = reader.ReadSingle();
            result.MaxBreath          = reader.ReadSingle();
            result.BreathRate         = reader.ReadSingle();
            result.DrownRate          = reader.ReadSingle();
            result.WindChill          = reader.ReadSingle();
            result.BodyMaterial       = StringIO.LoadFromBin(reader);
            result.DamageConfig       = StringIO.LoadFromBin(reader);

            return(result);
        }
        public static Item LoadFromBin(BinaryReader reader)
        {
            Item result = new Item();

            result.Name       = StringIO.LoadFromBin(reader);
            result.Stack      = PackedInt.LoadFromBin(reader);
            result.ItemParams = Variant.LoadFromBin(reader);

            return(result);
        }
Exemple #6
0
        public static VariantDict LoadFromBin(BinaryReader reader)
        {
            VariantDict result = new VariantDict();

            PackedInt numDictKeys = PackedInt.LoadFromBin(reader);

            for (ulong i = 0; i < numDictKeys.Value; i++)
            {
                string  key     = StringIO.LoadFromBin(reader);
                Variant variant = Variant.LoadFromBin(reader);
                result.Dict.Add(key, variant);
            }

            return(result);
        }
        public static Status LoadFromBin(BinaryReader reader)
        {
            Status result = new Status();

            result.CurrentHealth = reader.ReadSingle();
            result.MaxHealth     = reader.ReadSingle();
            result.CurrentEnergy = reader.ReadSingle();
            result.MaxEnergy     = reader.ReadSingle();
            result.CurrentWarmth = reader.ReadSingle();
            result.MaxWarmth     = reader.ReadSingle();
            result.CurrentFood   = reader.ReadSingle();
            result.MaxFood       = reader.ReadSingle();
            result.CurrentBreath = reader.ReadSingle();
            result.MaxBreath     = reader.ReadSingle();
            result.Invulnerable  = reader.ReadBoolean();

            result.GlowColor = new float[3];

            for (int i = 0; i < 3; i++)
            {
                result.GlowColor[i] = reader.ReadSingle();
            }

            PackedInt numActiveEffects = PackedInt.LoadFromBin(reader);

            for (ulong i = 0; i < numActiveEffects.Value; i++)
            {
                result.ActiveEffects.Add(StringIO.LoadFromBin(reader));
            }

            PackedInt numEffectSources = PackedInt.LoadFromBin(reader);

            for (ulong i = 0; i < numEffectSources.Value; i++)
            {
                result.EffectSources.Add(StringIO.LoadFromBin(reader));
            }

            return(result);
        }
        public static Variant LoadFromBin(BinaryReader reader)
        {
            Variant result = new Variant();

            result.DataType = reader.ReadByte();

            switch (result.DataType)
            {
            case 2: result.Data = reader.ReadDouble(); break;

            case 3: result.Data = reader.ReadBoolean(); break;

            case 4: result.Data = PackedInt.LoadFromBin(reader); break;

            case 5: result.Data = StringIO.LoadFromBin(reader); break;

            case 6: result.Data = PackedVariant.LoadFromBin(reader); break;

            case 7: result.Data = VariantDict.LoadFromBin(reader); break;
            }

            return(result);
        }