public virtual void readBinary(ArkArchive archive) { TribeVersion = archive.GetInt(); if (TribeVersion != 1) { throw new System.NotSupportedException($@"Unknown Tribe Version {TribeVersion} in ""{_fileName}""" + (TribeVersion == 0 ? " (possibly corrupt)" : "")); } var tribesCount = archive.GetInt(); for (int i = 0; i < tribesCount; i++) { Objects.Add(new GameObject(archive, _arkNameCache)); } for (int i = 0; i < tribesCount; i++) { GameObject obj = Objects[i]; if (obj.ClassName.Token.Equals("PrimalTribeData")) { Tribe = obj; } obj.loadProperties(archive, i < tribesCount - 1 ? Objects[i + 1] : null, 0); } }
public ArkArchive(ArkArchive toClone, MemoryMappedViewAccessor va) { _va = va; _size = toClone._size; _nameTable = toClone._nameTable; _arkNameCache = toClone._arkNameCache; }
public void readBinary(ArkArchive archive) { ProfileVersion = archive.GetInt(); if (ProfileVersion != 1) { throw new NotSupportedException($@"Unknown Profile Version {ProfileVersion} in ""{_fileName}""" + (ProfileVersion == 0 ? " (possibly corrupt)" : "")); } var profilesCount = archive.GetInt(); for (var i = 0; i < profilesCount; i++) { Objects.Add(new GameObject(archive, _arkNameCache)); } for (var i = 0; i < profilesCount; i++) { var obj = Objects[i]; if (obj.ClassName.Token.Equals("PrimalPlayerData") || obj.ClassName.Token.Equals("PrimalPlayerDataBP_C")) { _profile = obj; } obj.loadProperties(archive, i < profilesCount - 1 ? Objects[i + 1] : null, 0); } }
public ArkCloudInventoryDinoData(float version, ArkArrayByte dinoData, ArkNameCache arkNameCache = null, ArkNameTree exclusivePropertyNameTree = null) : this() { //if (version != 3.0) throw new NotSupportedException("Unknown Cloud Inventory Dino Data Version " + version); DinoDataVersion = version; if (dinoData == null || dinoData.Any(x => !x.HasValue)) { throw new NotSupportedException("DinoData was null or contained null-values."); } if (arkNameCache != null) { _arkNameCache = arkNameCache; } _exclusivePropertyNameTree = exclusivePropertyNameTree; //since the ArkArchive implementation we have takes a MemoryMappedViewAccessor for reading operations lets do the lazy thing and write this managed byte[] data to a new memory mapped file using (MemoryMappedFile mmf = MemoryMappedFile.CreateNew("ArkCloudInventoryDinoData", dinoData.Count, MemoryMappedFileAccess.ReadWrite)) { using (MemoryMappedViewAccessor va = mmf.CreateViewAccessor(0L, 0L, MemoryMappedFileAccess.ReadWrite)) { va.WriteArray(0, dinoData.Select(x => x.Value).ToArray(), 0, dinoData.Count); ArkArchive archive = new ArkArchive(va, dinoData.Count, _arkNameCache, exclusivePropertyNameTree: _exclusivePropertyNameTree); readBinary(archive); } } }
public void readBinary(ArkArchive archive) { var objectCount = archive.GetInt(); for (var i = 0; i < objectCount; i++) { Objects.Add(new GameObject(archive, _arkNameCache)); } for (var i = 0; i < objectCount; i++) { var obj = Objects[i]; obj.loadProperties(archive, i < objectCount - 1 ? Objects[i + 1] : null, 0); if (obj.IsCreature) { Creature = obj; } else if (obj.IsDinoStatusComponent) { Status = obj; } else if (obj.IsTamedCreatureInventory) { Inventory = obj; } } }
//public IDictionary<ArkName, IProperty> Properties //{ // get // { // return properties; // } // set // { // if (value == null) throw new NullReferenceException("Null pointer exception from java"); // properties = value; // } //} //protected internal IDictionary<ArkName, IProperty> properties = new Dictionary<ArkName, IProperty>(); public int getSize(ArkArchive archive) { _isitemOffset = _classNameOffset + archive.GetNameLength(Offset + _classNameOffset); _namesOffset = _isitemOffset + 4; var names = archive.GetInt(Offset + _namesOffset); _unkboolOffset = _namesOffset + 4; for (var i = 0; i < names; i++) { _unkboolOffset += archive.GetNameLength(Offset + _unkboolOffset); } _unkindexOffset = _unkboolOffset + 4; _locationsOffset = _unkindexOffset + 4; var locations = archive.GetInt(Offset + _locationsOffset); if (locations > 1) { _logger.Warn($"countLocationData > 1 at {Offset + _locationsOffset:X}"); } _propertiesoffsetOffset = _locationsOffset + 4 + locations * 6 * 4; _shouldbezeroOffset = _propertiesoffsetOffset + 4; return(_shouldbezeroOffset + 4); //var size = /* uuid */ 16 + archive.GetNameLength(archive.Position + 16) + /* isitem */ 4; //var names = archive.GetInt(archive.Position + size); //size += /* names count */ 4; //for (var i = 0; i < names; i++) size += archive.GetNameLength(archive.Position + size); //size += /* unkbool */ 4 + /* unkindex */ 4; //var locations = archive.GetInt(archive.Position + size); //if (locations > 1) _logger.Warn($"countLocationData > 1 at {archive.Position + size:X}"); //size += /* locations */ 4 + /* location */ locations * 6 * 4 + /* properties offset */ 4 + /* shouldbezero */ 4; //return size; }
public GameObjectReader(ArkArchive archive, ArkNameCache arkNameCache = null) { _archive = archive; _arkNameCache = arkNameCache ?? new ArkNameCache(); Offset = archive.Position; Size = getSize(archive); }
public void readBinary(ArkArchive archive) { LocalProfileVersion = archive.GetInt(); if (LocalProfileVersion != 1) { throw new NotSupportedException($@"Unknown Local Profile Version {LocalProfileVersion} in ""{_fileName}""" + (LocalProfileVersion == 0 ? " (possibly corrupt)" : "")); } var unknownDataSize = archive.GetInt(); unknownData = archive.GetBytes(unknownDataSize); var profilesCount = archive.GetInt(); for (int i = 0; i < profilesCount; i++) { Objects.Add(new GameObject(archive, _arkNameCache)); } for (int i = 0; i < profilesCount; i++) { GameObject obj = Objects[i]; if (obj.ClassName.Token.Equals("PrimalLocalProfile")) { _localprofile = obj; } obj.loadProperties(archive, i < profilesCount - 1 ? Objects[i + 1] : null, 0); } }
public ArkTribe(string fileName, ArkNameCache arkNameCache = null, ArkNameTree exclusivePropertyNameTree = null) : this() { _fileName = fileName; if (arkNameCache != null) { _arkNameCache = arkNameCache; } _exclusivePropertyNameTree = exclusivePropertyNameTree; var fi = new FileInfo(fileName); SaveTime = fi.LastWriteTimeUtc; var size = fi.Length; if (size == 0) { return; } using (MemoryMappedFile mmf = MemoryMappedFile.CreateFromFile(fileName, FileMode.Open, null, 0L, MemoryMappedFileAccess.Read)) { using (MemoryMappedViewAccessor va = mmf.CreateViewAccessor(0L, 0L, MemoryMappedFileAccess.Read)) { ArkArchive archive = new ArkArchive(va, size, _arkNameCache, exclusivePropertyNameTree: _exclusivePropertyNameTree); readBinary(archive); } } }
public ArkCloudInventory(string fileName, ArkNameCache arkNameCache = null) : this() { if (arkNameCache != null) { _arkNameCache = arkNameCache; } var fi = new FileInfo(fileName); SteamId = Path.GetFileNameWithoutExtension(fileName); SaveTime = fi.LastWriteTimeUtc; var size = fi.Length; if (size == 0) { return; } using (MemoryMappedFile mmf = MemoryMappedFile.CreateFromFile(fileName, FileMode.Open, null, 0L, MemoryMappedFileAccess.Read)) { using (MemoryMappedViewAccessor va = mmf.CreateViewAccessor(0L, 0L, MemoryMappedFileAccess.Read)) { ArkArchive archive = new ArkArchive(va, size, _arkNameCache); readBinary(archive); } } }
//public int getSize(bool nameTable) //{ // // UUID item names.size() unkBool unkIndex (locationData!=null) propertiesOffset unkInt // int size = 16 + Integer.BYTES * 7; // size += ArkArchive.getNameLength(className, nameTable); // if (names != null) // { // size += names.Select(n => ArkArchive.getNameLength(n, nameTable)).Sum(); // } // if (locationData != null) // { // size += (int)locationData.Size; // } // return size; //} //public int getPropertiesSize(bool nameTable) //{ // int size = ArkArchive.getNameLength(qowyn.ark.properties.Property_Fields.NONE_NAME, nameTable); // size += properties.Select(p => p.calculateSize(nameTable)).Sum(); // if (extraData != null) // { // size += extraData.calculateSize(nameTable); // } // return size; //} public void read(ArkArchive archive) { var uuidMostSig = archive.GetLong(); var uuidLeastSig = archive.GetLong(); var key = Tuple.Create(uuidMostSig, uuidLeastSig); Guid uuid = Guid.Empty; if (!_uuidCache.TryGetValue(key, out uuid)) { var bytes = new byte[16]; Array.Copy(BitConverter.GetBytes(uuidMostSig), bytes, 8); Array.Copy(BitConverter.GetBytes(uuidLeastSig), 0, bytes, 8, 8); uuid = new Guid(bytes); _uuidCache.Add(key, uuid); } Uuid = uuid; ClassName = archive.GetName(); IsItem = archive.GetBoolean(); var countNames = archive.GetInt(); Names = new List <ArkName>(); for (int nameIndex = 0; nameIndex < countNames; nameIndex++) { var instanceName = archive.GetName(); Names.Add(instanceName); } UnkBool = archive.GetBoolean(); UnkIndex = archive.GetInt(); var countLocationData = archive.GetInt(); if (countLocationData > 1) { _logger.Warn($"countLocationData > 1 at {archive.Position - 4:X}"); } if (countLocationData != 0) { Location = new LocationData(archive); } _propertiesOffset = archive.GetInt(); var shouldBeZero = archive.GetInt(); if (shouldBeZero != 0) { _logger.Warn($"Expected int after propertiesOffset to be 0 but found {shouldBeZero} at {archive.Position - 4:X}"); } }
public ArkArchive(ArkArchive toClone, MemoryMappedViewAccessor va) { _va = va; _size = toClone._size; _nameTable = toClone._nameTable; _arkNameCache = toClone._arkNameCache; _arkStringCache = toClone._arkStringCache; _exclusivePropertyNameTree = toClone._exclusivePropertyNameTree; }
protected void readBinaryHeader(ArkArchive archive) { SaveVersion = archive.GetShort(); if (SaveVersion == 5) { GameTime = archive.GetFloat(); propertiesBlockOffset = 0; } else if (SaveVersion == 6) { nameTableOffset = archive.GetInt(); propertiesBlockOffset = archive.GetInt(); GameTime = archive.GetFloat(); } else if (SaveVersion == 7 || SaveVersion == 8) { binaryDataOffset = archive.GetInt(); var unknownValue = archive.GetInt(); if (unknownValue != 0) { var msg = $"Found unexpected Value {unknownValue} at {archive.Position - 4:X}"; _logger.Error(msg); throw new System.NotSupportedException(msg); } nameTableOffset = archive.GetInt(); propertiesBlockOffset = archive.GetInt(); GameTime = archive.GetFloat(); } else if (SaveVersion == 9) { binaryDataOffset = archive.GetInt(); var unknownValue = archive.GetInt(); if (unknownValue != 0) { var msg = $"Found unexpected Value {unknownValue} at {archive.Position - 4:X}"; _logger.Error(msg); throw new System.NotSupportedException(msg); } nameTableOffset = archive.GetInt(); propertiesBlockOffset = archive.GetInt(); GameTime = archive.GetFloat(); //note: unknown integer value was added in v268.22 with SaveVersion=9 [0x25 (37) on The Island, 0x26 (38) on ragnarok/center/scorched] archive.GetInt(); //unknownValue2 } else { var msg = $"Found unknown Version {SaveVersion}"; _logger.Error(msg); throw new System.NotSupportedException(msg); } }
/// <summary>Creates a subArchive of an existing archive (slice)</summary> /// <param name="toClone">the archive to clone</param> /// <param name="offset">position of the sub archive</param> /// <param name="size">size of the sub archive</param> public ArkArchive Slice(long offset, int size) { ArkArchive sliced = new ArkArchive(this, this._va); _nameTable = null; sliced._size = size + 1; sliced._offset = offset; //sliced._isSlice = true; return(sliced); }
protected void readBinaryObjectProperties(ArkArchive archive, MemoryMappedFile mmf, Func <GameObject, bool> objectFilter = null, bool gameObjects = true, bool gameObjectProperties = true) { if (gameObjects && gameObjectProperties) { var success = true; try { var cb = new ConcurrentBag <ArkArchive>(); cb.Add(archive); var indices = Enumerable.Range(0, Objects.Count); if (objectFilter != null) { indices = indices.Where(x => objectFilter(Objects[x])); } Parallel.ForEach(indices, _savegameMaxDegreeOfParallelism.HasValue ? new ParallelOptions { MaxDegreeOfParallelism = _savegameMaxDegreeOfParallelism.Value } : new ParallelOptions { }, () => { ArkArchive arch = null; var va = cb.TryTake(out arch) ? null : mmf.CreateViewAccessor(0L, 0L, MemoryMappedFileAccess.Read); return(new { va = va, a = arch ?? new ArkArchive(archive, va) }); }, (item, loopState, taskLocals) => { readBinaryObjectPropertiesImpl(item, taskLocals.a); return(taskLocals); }, (taskLocals) => { if (taskLocals?.va != null) { taskLocals.va.Dispose(); } } ); } catch (AggregateException ae) { success = false; ae.Handle(ex => { if (ex is IOException && ex.Message.IndexOf("Not enough storage is available to process this command.", StringComparison.OrdinalIgnoreCase) != -1) { _logger.Error($"Not enough memory available to load properties with this degree of parallelism."); return(true); } return(false); }); } if (!success) { throw new ApplicationException("Failed to load properties for all gameobjects."); } } }
public void readBinary(ArkArchive archive, MemoryMappedFile mmf) { if (!_baseRead) { readBinaryBase(archive); } else { archive.Position = _gameObjectsOffset; } readBinaryObjects(archive); readBinaryObjectProperties(archive, mmf); }
public ArkSavegame(string fileName, ArkNameCache arkNameCache = null) { _fileName = fileName; _arkNameCache = arkNameCache ?? new ArkNameCache(); var fi = new FileInfo(_fileName); var size = fi.Length; SaveTime = fi.LastWriteTimeUtc; //if (size == 0) return false; _mmf = MemoryMappedFile.CreateFromFile(_fileName, FileMode.Open, null, 0L, MemoryMappedFileAccess.Read); _va = _mmf.CreateViewAccessor(0L, 0L, MemoryMappedFileAccess.Read); _archive = new ArkArchive(_va, size, _arkNameCache); }
protected void readBinaryObjects(ArkArchive archive, bool gameObjects = true) { if (gameObjects) { var count = archive.GetInt(); Objects.Clear(); for (var n = 0; n < count; n++) { var gameObject = new GameObject(archive, _arkNameCache); gameObject.ObjectId = n; Objects.Add(gameObject); } } }
private void readBinaryObjects(ArkArchive archive) { var objectCount = archive.GetInt(); for (int i = 0; i <= objectCount - 1; i++) { var go = new GameObject(archive); go.ObjectId = i; _objects.Add(go); } archive.SetNameTable(_nameTable, 0, true); for (int n = 0; n <= objectCount - 1; n++) { var go = _objects[n]; _objects[n].loadProperties(archive, (n < _objects.Count - 1) ? _objects[n + 1] : null, 0); } }
public ArkSavegame(string fileName, ArkNameCache arkNameCache = null, int?savegameMaxDegreeOfParallelism = null, ArkNameTree exclusivePropertyNameTree = null) { _fileName = fileName; _arkNameCache = arkNameCache ?? new ArkNameCache(); _arkStringCache = new ArkStringCache(); _savegameMaxDegreeOfParallelism = savegameMaxDegreeOfParallelism; _exclusivePropertyNameTree = exclusivePropertyNameTree; var fi = new FileInfo(_fileName); var size = fi.Length; SaveTime = fi.LastWriteTimeUtc; //if (size == 0) return false; _mmf = MemoryMappedFile.CreateFromFile(_fileName, FileMode.Open, null, 0L, MemoryMappedFileAccess.Read); _va = _mmf.CreateViewAccessor(0L, 0L, MemoryMappedFileAccess.Read); _archive = new ArkArchive(_va, size, _arkNameCache, _arkStringCache, _exclusivePropertyNameTree); }
protected void readBinaryNameTable(ArkArchive archive) { var position = archive.Position; archive.Position = nameTableOffset; var nameCount = archive.GetInt(); var nameTable = new List <string>(nameCount); for (var n = 0; n < nameCount; n++) { nameTable.Add(archive.GetString()); } archive.NameTable = nameTable; archive.Position = position; }
protected void readBinaryHibernation(ArkArchive archive) { archive.Position = hibernationDataOffset; var unk1 = archive.GetInt(); var unk2 = archive.GetInt(); var unk3 = archive.GetInt(); var unk4 = archive.GetInt(); if (archive.Position == nameTableOffset) { return; } var unk5 = archive.GetInt(); var unk6 = archive.GetInt(); var classCount = archive.GetInt(); _hibernationClassNames.Clear(); for (int i = 0; i <= classCount - 1; i++) { _hibernationClassNames.Add(archive.GetString()); } var indicesCount = archive.GetInt(); if (classCount != indicesCount) { throw new NotSupportedException($"Hibernation classCount:{classCount}<>indicesCount:{indicesCount}"); } _hibernationIndices.Clear(); for (int i = 0; i <= indicesCount - 1; i++) { _hibernationIndices.Add(archive.GetInt()); } var entriesCount = archive.GetInt(); _hibernationEntries.Clear(); // needs more refactoring to use parallel execution for (int i = 0; i <= entriesCount - 1; i++) { _hibernationEntries.Add(new HibernationEntry(archive)); } }
public void readBinary(ArkArchive archive) { InventoryVersion = archive.GetInt(); //if (InventoryVersion != 1) // throw new NotSupportedException("Unknown Cloud Inventory Version " + InventoryVersion); var objectCount = archive.GetInt(); for (var i = 0; i < objectCount; i++) { Objects.Add(new GameObject(archive, _arkNameCache)); } for (var i = 0; i < objectCount; i++) { var obj = Objects[i]; if (obj.ClassName.Token.Equals("ArkCloudInventoryData")) { _inventoryData = obj; } obj.loadProperties(archive, i < objectCount - 1 ? Objects[i + 1] : null, 0); } var mydata = InventoryData?.GetPropertyValue <Structs.StructPropertyList>(_myArkData); var dinos = mydata?.GetPropertyValue <Arrays.ArkArrayStruct>(_arkTamedDinosData); if (dinos != null) { InventoryDinoData = dinos.OfType <Structs.StructPropertyList>().Select(x => { var version = x.GetPropertyValue <float?>(_version); if (!version.HasValue) { return(null); } var data = x.GetPropertyValue <Arrays.ArkArrayByte>(_dinoData); return(new ArkCloudInventoryDinoData(version.Value, data, exclusivePropertyNameTree: archive.ExclusivePropertyNameTree)); }).ToArray(); } }
protected void readBinaryDataFiles(ArkArchive archive, bool dataFiles = true) { var count = archive.GetInt(); if (dataFiles) { DataFiles.Clear(); for (var n = 0; n < count; n++) { DataFiles.Add(archive.GetString()); } } else { for (var n = 0; n < count; n++) { archive.SkipString(); } } }
protected void readBinaryEmbeddedData(ArkArchive archive, bool embeddedData = true) { var count = archive.GetInt(); if (embeddedData) { EmbeddedData.Clear(); for (var n = 0; n < count; n++) { EmbeddedData.Add(new EmbeddedData(archive)); } } else { for (int n = 0; n < count; n++) { Types.EmbeddedData.Skip(archive); } } }
public void readBinary(ArkArchive archive) { var x = archive.GetFloat(); var y = archive.GetFloat(); var z = archive.GetFloat(); var unkByte = archive.GetByte(); var unkFloat = archive.GetFloat(); var nameArchiveSize = archive.GetInt(); var nameArchive = archive.Slice(archive.Position, nameArchiveSize); readBinaryNameTable(nameArchive); archive.Position += nameArchiveSize; var objectArchiveSize = archive.GetInt(); var objectArchive = archive.Slice(archive.Position, objectArchiveSize); readBinaryObjects(objectArchive); archive.Position += objectArchiveSize; var unkInt1 = archive.GetInt(); _classIndex = archive.GetInt(); }
private void readBinaryBase(ArkArchive archive) { readBinaryHeader(archive); if (SaveVersion > 5) { // Name table is located after the objects block, but will be needed to read the objects block readBinaryNameTable(archive); } readBinaryDataFiles(archive); SaveState = new SaveState { GameTime = GameTime, SaveTime = SaveTime, MapName = DataFiles.FirstOrDefault() }; readBinaryEmbeddedData(archive); var unknownValue = archive.GetInt(); if (unknownValue != 0) { //if (unknownValue > 2) //{ // var msg = $"Found unexpected Value {unknownValue} at {archive.Position - 4:X}"; // _logger.Error(msg); // throw new System.NotSupportedException(msg); //} for (int n = 0; n < unknownValue; n++) { archive.GetInt(); //unknownFlags archive.GetInt(); //objectCount archive.GetString(); //name } } _baseRead = true; _gameObjectsOffset = archive.Position; }
private void readBinaryNameTable(ArkArchive archive) { var version = archive.GetInt(); if (version != 3) { throw new NotSupportedException($"hibernation version not supported <>3"); } var nameCount = archive.GetInt(); for (int i = 0; i <= nameCount - 1; i++) { _nameTable.Add(archive.GetString()); } var zoneCount = archive.GetInt(); for (int i = 0; i <= zoneCount - 1; i++) { _zoneVolumes.Add(archive.GetString()); } }
public void loadProperties(ArkArchive archive, GameObject next, long propertiesBlockOffset, int?nextGameObjectPropertiesOffset = null) { var offset = propertiesBlockOffset + _propertiesOffset; var nextOffset = nextGameObjectPropertiesOffset != null ? propertiesBlockOffset + nextGameObjectPropertiesOffset.Value : (next != null) ? propertiesBlockOffset + next._propertiesOffset : archive.Size - 1; archive.Position = offset; properties.Clear(); try { var property = PropertyRegistry.readProperty(archive, null); while (property != null) { if (property != ExcludedProperty.Instance) { properties.Add(_arkNameCache.Create(property.Name.Token, property.Index), property); } property = PropertyRegistry.readProperty(archive, archive.ExclusivePropertyNameTree); } } catch (UnreadablePropertyException) { // Stop reading and ignore possible extra data for now, needs a new field in ExtraDataHandler return; } finally { //these are in order of most common to least common to keep lookups at a minimum if (Properties.ContainsKey(_ownerName) || Properties.ContainsKey(_bHasResetDecayTime) || ClassName.Name == "CherufeNest_C") { if (ClassName.Token.StartsWith("DeathItemCache_")) { _isFlags |= GameObjectIs.IsDeathItemCache; goto SkipRest; } _isFlags |= GameObjectIs.IsStructure; goto SkipRest; } if (Properties.ContainsKey(_dinoId1)) { _isFlags |= GameObjectIs.IsCreature; } int tamingTeamID = 0; int targetingTeamId = 0; if (IsCreature) { if (Properties.ContainsKey(_tamingTeamID)) { PropertyInt32 tamingTeam = (PropertyInt32)Properties[_tamingTeamID]; tamingTeamID = tamingTeam.Value.GetValueOrDefault(0); } if (Properties.ContainsKey(_targetTeamID)) { PropertyInt32 targetingTeam = (PropertyInt32)Properties[_targetTeamID]; targetingTeamId = targetingTeam.Value.GetValueOrDefault(0); } if (targetingTeamId > 1000000000) { if ((tamingTeamID > 0 && tamingTeamID < 1000000000) & !Properties.ContainsKey(_imprinterName)) { } else { _isFlags |= GameObjectIs.IsTamedCreature; } } } if (IsCreature && !IsTamedCreature) { _isFlags |= GameObjectIs.IsWildCreature; } if (IsTamedCreature && (ClassName.Equals(_raft_bp_c) || ClassName.Equals(_motorraft_bp_c))) { _isFlags |= GameObjectIs.IsRaftCreature; } if (Properties.ContainsKey(_currentStatusValues)) { _isFlags |= GameObjectIs.IsStatusComponent; } if (IsStatusComponent && ClassName.Token.StartsWith("DinoCharacterStatusComponent_")) { _isFlags |= GameObjectIs.IsDinoStatusComponent; } if (IsStatusComponent && !IsDinoStatusComponent && ClassName.Token.StartsWith("PlayerCharacterStatusComponent_")) { _isFlags |= GameObjectIs.IsPlayerCharacterStatusComponent; } if (ClassName.Token.StartsWith("DroppedItemGeneric_") & !ClassName.Name.Contains("NoPhysics")) { if (Properties.ContainsKey(_droppedByPlayerId)) { PropertyInt64 selectedPlayerId = (PropertyInt64)Properties[_droppedByPlayerId]; if (selectedPlayerId.Value != 0) { _isFlags |= GameObjectIs.IsDroppedItem; } } } if (IsItem) { goto SkipRest; } if (IsCreature) { goto SkipRest; } if (IsStatusComponent) { goto SkipRest; } if (Properties.ContainsKey(_bInitializedMe)) { _isFlags |= GameObjectIs.IsInventory; } if (IsInventory && ClassName.Token.StartsWith("PrimalInventoryBP_")) { _isFlags |= GameObjectIs.IsStructureInventory; } if (IsInventory && !IsStructureInventory && ClassName.Token.StartsWith("DinoTamedInventoryComponent_")) { _isFlags |= GameObjectIs.IsTamedCreatureInventory; } if (IsInventory && !(IsStructureInventory || IsTamedCreatureInventory) && ClassName.Token.StartsWith("PrimalInventoryComponent")) { _isFlags |= GameObjectIs.IsPlayerCharacterInventory; } if (IsInventory && !(IsStructureInventory || IsTamedCreatureInventory || IsPlayerCharacterInventory) && ClassName.Token.StartsWith("DinoWildInventoryComponent_")) { _isFlags |= GameObjectIs.IsWildCreatureInventory; } if (IsInventory) { goto SkipRest; } if (ClassName.Equals(_structurePaintingComponent)) { _isFlags |= GameObjectIs.IsStructurePaintingComponent; goto SkipRest; } if (ClassName.Equals(_droppedItem)) { _isFlags |= GameObjectIs.IsDroppedItem; goto SkipRest; } if (ClassName.Equals(_male) || ClassName.Equals(_female)) { _isFlags |= GameObjectIs.IsPlayerCharacter; goto SkipRest; } _isFlags |= GameObjectIs.IsSomethingElse; //IsStructure = (Properties.ContainsKey(_ownerName) || Properties.ContainsKey(_bHasResetDecayTime)); //if (IsStructure) goto SkipRest; //IsCreature = Properties.ContainsKey(_dinoId1); //IsTamedCreature = IsCreature && (Properties.ContainsKey(_tamerString) || Properties.ContainsKey(_tamingTeamID)); //IsWildCreature = IsCreature && !IsTamedCreature; //IsRaftCreature = IsTamedCreature && ClassName.Equals(_raft_bp_c); //if (IsCreature) goto SkipRest; //IsStatusComponent = Properties.ContainsKey(_currentStatusValues); //IsDinoStatusComponent = IsStatusComponent && ClassName.Token.StartsWith("DinoCharacterStatusComponent_"); //IsPlayerCharacterStatusComponent = IsStatusComponent && !IsDinoStatusComponent && ClassName.Token.StartsWith("PlayerCharacterStatusComponent_"); //if (IsStatusComponent) goto SkipRest; //IsInventory = Properties.ContainsKey(_bInitializedMe); //IsStructureInventory = IsInventory && ClassName.Token.StartsWith("PrimalInventoryBP_"); //IsTamedCreatureInventory = IsInventory && !IsStructureInventory && ClassName.Token.StartsWith("DinoTamedInventoryComponent_"); //IsPlayerCharacterInventory = IsInventory && !(IsStructureInventory || IsTamedCreatureInventory) && ClassName.Token.StartsWith("PrimalInventoryComponent"); //IsWildCreatureInventory = IsInventory && !(IsStructureInventory || IsTamedCreatureInventory || IsPlayerCharacterInventory) && ClassName.Token.StartsWith("DinoWildInventoryComponent_"); //if (IsInventory) goto SkipRest; //IsStructurePaintingComponent = ClassName.Equals(_structurePaintingComponent); //if (IsStructurePaintingComponent) goto SkipRest; //IsDroppedItem = ClassName.Equals(_droppedItem); //if (IsDroppedItem) goto SkipRest; //IsPlayerCharacter = ClassName.Equals(_male) || ClassName.Equals(_female); //if (IsPlayerCharacter) goto SkipRest; //IsSomethingElse = true; SkipRest :; } var distance = nextOffset - archive.Position; if (distance > 0) { ExtraData = ExtraDataRegistry.getExtraData(this, archive, distance); } else { ExtraData = null; } }
public GameObject(ArkArchive archive, ArkNameCache arkNameCache = null) { _arkNameCache = arkNameCache ?? new ArkNameCache(); read(archive); }