Beispiel #1
0
        public static IProperty ReadBinary(ArkArchive archive)
        {
            ArkName name = archive.ReadName();

            if (name == null || string.IsNullOrEmpty(name.ToString()))
            {
                archive.HasUnknownData = true;
                throw new UnreadablePropertyException(
                          $"Property name is {(name == null ? "null" : "empty")}, indicating a corrupt file. Ignoring remaining properties.");
            }

            if (name == ArkName.NameNone)
            {
                return(null);
            }

            ArkName type = archive.ReadName();

            if (type != null && typeMap.TryGetValue(type, out PropertyConstructor constructor))
            {
                return(constructor.BinaryConstructor(archive, name));
            }

            archive.DebugMessage($"Unknown property type {name}");
            archive.HasUnknownNames = true;
            return(new PropertyUnknown(archive, name));
        }
        public IExtraData ReadBinary(GameObject gameObject, ArkArchive archive, int length)
        {
            ExtraDataBlob extraData = new ExtraDataBlob();

            archive.DebugMessage($"Unknown extended data for {gameObject.ClassString} with length {length}");
            extraData.Data          = archive.ReadBytes(length);
            archive.HasUnknownNames = true;

            return(extraData);
        }