private void Init(Stream input) { if (input.Length < 0x100) { throw new Exception( "Invalid Savedata!\nData is too short for it to be valid, please select a valid save file"); } long val = input.ReadInt32(true); if (val != (long)PackageHeader.Mc02) { input.Position -= 4; val = input.ReadInt64(true); if (val != (long)PackageHeader.Fb) { throw new Exception("Invalid Package Header!"); } } PackageHeader = (PackageHeader)val; bool isbigendian = PackageHeader == PackageHeader.Mc02; if (PackageHeader == PackageHeader.Mc02) { InitMcPackage(input); } else { InitFbPackage(input); } uint hash = input.ReadUInt32(isbigendian); Header = input.ReadBytes(HeaderLength - 4); var crc = new DA3CRC(); if (crc.Compute(Header) != hash) { throw new Exception( "Header data did not pass intergrity check!\nPlease choose a valid unmodified save to proceed"); } hash = input.ReadUInt32(isbigendian); var data = input.ReadBytes(DataLength - 4); uint xhash = crc.Compute(data); if (hash != xhash) { throw new Exception( "Save data did not pass the intergrity check!\nPlease choose a valid unmodified save to proceed"); } var xio = new DAIIO(data, isbigendian); DataStructure = new SaveDataStructure().Read(xio); xio.Close(); }
public StoreInventory(SaveDataStructure xstruct) { SStructure = xstruct; }
public LootManager(SaveDataStructure strx) { SStStructure = strx; }
public PartyPlayerManager(SaveDataStructure xstruc) { SStructure = xstruc; }
public TerrainPart(SaveDataStructure xstruct) { SStructure = xstruct; }
public WorldStateManager(SaveDataStructure xstruct) { SStructure = xstruct; }
public BWMapManager(SaveDataStructure xstruc) { SStructure = xstruc; }
public MissionArray(SaveDataStructure xstruc, bool isfirst) { SStructure = xstruc; _isfirst = isfirst; }
public OwnerInfo(SaveDataStructure xstruct) { SStructure = xstruct; }
public SaveEntity(SaveDataStructure xstr) { xstruct = xstr; }
public MissionManager(SaveDataStructure xstruc) { SStructure = xstruc; }
public WarTableEntry(SaveDataStructure xstruc, bool isfirst) { SStructure = xstruc; _isfirst = isfirst; }
public ImpactEntityDestructionComplex(SaveDataStructure xstruct) { SStructure = xstruct; }
public AgentEntity(SaveDataStructure xstruct) { SStructure = xstruct; }
public EntityMeta(SaveDataStructure xstr) { xstruct = xstr; }
public PartDestructionComplex(SaveDataStructure xstruct) { SStructure = xstruct; }
public TerrainManager(SaveDataStructure xstruct) { SStructure = xstruct; }