Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save game version 11 support #4

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion SavegameToolkit/ArkSavegame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,18 @@ private void readBinaryHeader(ArkArchive archive)
{
SaveVersion = archive.ReadShort();

if (SaveVersion < 5 || SaveVersion > 9)
if (SaveVersion < 5 || SaveVersion > 11)
{
throw new NotSupportedException("Found unknown Version " + SaveVersion);
}

if (SaveVersion >= 11)
{
// Version 11 added eight 64-bit fields here: some unidentified pointers with nulls in-between. Some
// seem to tend to point at the end of the file.
archive.Position += 64;
}

if (SaveVersion > 6)
{
hibernationOffset = archive.ReadInt();
Expand Down Expand Up @@ -408,8 +415,11 @@ private void extractBinaryObjectCryopods(ReadingOptions options)

var soulTrapContainer = new Dictionary<int, string>(); // used for cached lookup of owner

int ixx = 0;
foreach (var cryo in cryopods)
{
ixx++;
if (cryo.GetPropertyValue<IArkArray>("CustomItemDatas").Type == )
ArkArrayStruct customItemDatas = cryo.GetPropertyValue<IArkArray, ArkArrayStruct>("CustomItemDatas");
StructPropertyList customDinoData = (StructPropertyList)customItemDatas?.FirstOrDefault(cd => ((StructPropertyList)cd).GetTypedProperty<PropertyName>("CustomDataName").Value.Name == "Dino");
PropertyStruct customDataBytes = customDinoData?.Properties.FirstOrDefault(p => p.NameString == "CustomDataBytes") as PropertyStruct;
Expand Down