public void Serialize(IBinarySerializer s) { Tag = s.SerializeObject <UbiArtStringID>(Tag, name: nameof(Tag)); UnteaseSeen = s.SerializeBool <uint>(UnteaseSeen, name: nameof(UnteaseSeen)); UnlockSeend = s.SerializeBool <uint>(UnlockSeend, name: nameof(UnlockSeend)); SentUnlockMessage = s.SerializeBool <uint>(SentUnlockMessage, name: nameof(SentUnlockMessage)); }
public void Serialize(IBinarySerializer s) { HasMet = s.SerializeBool <uint>(HasMet, name: nameof(HasMet)); UpdateRequested = s.SerializeBool <uint>(UpdateRequested, name: nameof(UpdateRequested)); HasWonPetCup = s.SerializeBool <uint>(HasWonPetCup, name: nameof(HasWonPetCup)); TeensyLocksOpened = s.Serialize <uint>(TeensyLocksOpened, name: nameof(TeensyLocksOpened)); ChallengeLocksOpened = s.Serialize <uint>(ChallengeLocksOpened, name: nameof(ChallengeLocksOpened)); TutoCount = s.Serialize <uint>(TutoCount, name: nameof(TutoCount)); DisplayQuoteStates = s.SerializeUbiArtArray <bool>(DisplayQuoteStates, name: nameof(DisplayQuoteStates)); }
public void Serialize(IBinarySerializer s) { ISDs = s.SerializeUbiArtObjectArray <UbiArtObjKeyObjValuePair <UbiArtStringID, UbiArtGeneric <Ray_PersistentGameData_ISD> > >(ISDs, name: nameof(ISDs)); CageMapPassedDoors = s.SerializeUbiArtObjectArray <PackedObjectPath>(CageMapPassedDoors, name: nameof(CageMapPassedDoors)); WonChallenges = s.Serialize <uint>(WonChallenges, name: nameof(WonChallenges)); LevelState = s.Serialize <SPOT_STATE>(LevelState, name: nameof(LevelState)); BestTimeAttack = s.Serialize <uint>(BestTimeAttack, name: nameof(BestTimeAttack)); BestLumAttack = s.Serialize <uint>(BestLumAttack, name: nameof(BestLumAttack)); HasWarning = s.SerializeBool <uint>(HasWarning, name: nameof(HasWarning)); IsSkipped = s.SerializeBool <uint>(IsSkipped, name: nameof(IsSkipped)); Trackingdata = s.SerializeObject <Ray_PersistentGameData_LevelTracking>(Trackingdata, name: nameof(Ray_PersistentGameData_LevelTracking)); }
public void Serialize(IBinarySerializer s) { Unknown1 = s.SerializeArray <byte>(Unknown1, 528, name: nameof(Unknown1)); Unknown2 = s.SerializeBool <uint>(Unknown2, name: nameof(Unknown2)); SaveData = s.SerializeObject <PersistentGameData_Universe>(SaveData, name: nameof(SaveData)); Unknown3 = s.SerializeArray <byte>(Unknown3, (int)(s.Stream.Length - s.Stream.Position), name: nameof(Unknown3)); }
public void Serialize(IBinarySerializer s) { Path = s.SerializeObject <UbiArtPath>(Path, name: nameof(Path)); IsFree = s.SerializeBool <uint>(IsFree, name: nameof(IsFree)); IndexType = s.Serialize <Index>(IndexType, name: nameof(IndexType)); VisualType = s.Serialize <Prisoner>(VisualType, name: nameof(VisualType)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { Id = s.SerializeObject <UbiArtStringID>(Id, name: nameof(Id)); BestLumsTaken = s.Serialize <uint>(BestLumsTaken, name: nameof(BestLumsTaken)); BestDistance = s.Serialize <float>(BestDistance, name: nameof(BestDistance)); BestTime = s.Serialize <float>(BestTime, name: nameof(BestTime)); FreedPrisoners = s.SerializeUbiArtObjectArray <PrisonerData>(FreedPrisoners, name: nameof(FreedPrisoners)); Cups = s.Serialize <uint>(Cups, name: nameof(Cups)); Medals = s.Serialize <uint>(Medals, name: nameof(Medals)); Completed = s.SerializeBool <uint>(Completed, name: nameof(Completed)); IsVisited = s.SerializeBool <uint>(IsVisited, name: nameof(IsVisited)); BestTimeSent = s.SerializeBool <uint>(BestTimeSent, name: nameof(BestTimeSent)); Type = s.Serialize <uint>(Type, name: nameof(Type)); LuckyTicketsLeft = s.Serialize <uint>(LuckyTicketsLeft, name: nameof(LuckyTicketsLeft)); SequenceAlreadySeen = s.SerializeUbiArtObjectArray <ObjectPath>(SequenceAlreadySeen, name: nameof(SequenceAlreadySeen)); OnlineSynced = s.Serialize <int>(OnlineSynced, name: nameof(OnlineSynced)); }
public void Serialize(IBinarySerializer s) { if (s.GetSettings <UbiArtSettings>().Game == UbiArtGame.RaymanOrigins) { Id = s.SerializeLengthPrefixedString(Id, name: nameof(Id)); } else { Levels = s.SerializeUbiArtObjectArray <Level>(Levels, name: nameof(Levels)); Id = s.SerializeLengthPrefixedString(Id, name: nameof(Id)); Absolute = s.SerializeBool <uint>(Absolute, name: nameof(Absolute)); } }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { TotalCages = s.Serialize <int>(TotalCages, name: nameof(TotalCages)); TotalScore = s.Serialize <int>(TotalScore, name: nameof(TotalScore)); Levels = s.SerializeObjectArray <Rayman3PCSaveDataLevel>(Levels, 9, name: nameof(Levels)); ForKeyAlgo = s.Serialize <uint>(ForKeyAlgo, name: nameof(ForKeyAlgo)); Dword_7FE504 = s.Serialize <uint>(Dword_7FE504, name: nameof(Dword_7FE504)); Dword_7FE508 = s.Serialize <uint>(Dword_7FE508, name: nameof(Dword_7FE508)); Dword_7FE50C = s.Serialize <uint>(Dword_7FE50C, name: nameof(Dword_7FE50C)); EndOfGameIsDone = s.SerializeBool <uint>(EndOfGameIsDone, name: nameof(EndOfGameIsDone)); MaxIndCurrentEnv = s.Serialize <uint>(MaxIndCurrentEnv, name: nameof(MaxIndCurrentEnv)); UnusedDword1 = s.Serialize <uint>(UnusedDword1, name: nameof(UnusedDword1)); UnusedDword2 = s.Serialize <uint>(UnusedDword2, name: nameof(UnusedDword2)); DummyByte = s.Serialize <byte>(DummyByte, name: nameof(DummyByte)); IsVibrationEnabled = s.Serialize <bool>(IsVibrationEnabled, name: nameof(IsVibrationEnabled)); IsHorizontalInversionEnabled = s.Serialize <bool>(IsHorizontalInversionEnabled, name: nameof(IsHorizontalInversionEnabled)); IsVerticalInversionEnabled = s.Serialize <bool>(IsVerticalInversionEnabled, name: nameof(IsVerticalInversionEnabled)); KeyboardMapping = s.SerializeArray <DirectXKey>(KeyboardMapping, 13, name: nameof(KeyboardMapping)); ControllerMapping = s.SerializeArray <ushort>(ControllerMapping, 13, name: nameof(ControllerMapping)); UserWarnedAboutAutoSave = s.Serialize <int>(UserWarnedAboutAutoSave, name: nameof(UserWarnedAboutAutoSave)); RevisitMode = s.Serialize <int>(RevisitMode, name: nameof(RevisitMode)); RevisitEnvScoreAtBeginingOfLevel = s.Serialize <int>(RevisitEnvScoreAtBeginingOfLevel, name: nameof(RevisitEnvScoreAtBeginingOfLevel)); RevisitGlobalScoreAtBeginingOfLevel = s.Serialize <int>(RevisitGlobalScoreAtBeginingOfLevel, name: nameof(RevisitGlobalScoreAtBeginingOfLevel)); RevisitIndCurrentEnv = s.Serialize <int>(RevisitIndCurrentEnv, name: nameof(RevisitIndCurrentEnv)); RevisitIndEnvironementFromWhereWeCome = s.Serialize <int>(RevisitIndEnvironementFromWhereWeCome, name: nameof(RevisitIndEnvironementFromWhereWeCome)); LevelNameToSave = s.SerializeString(LevelNameToSave, 20, LevelNameToSave); LevelNameAfterReinitToSave = s.SerializeString(LevelNameAfterReinitToSave, 20, LevelNameAfterReinitToSave); Unk1 = s.SerializeArray <byte>(Unk1, 16, name: nameof(Unk1)); SetVolumeSound = s.Serialize <int>(SetVolumeSound, name: nameof(SetVolumeSound)); SetVolumeVoice = s.Serialize <int>(SetVolumeVoice, name: nameof(SetVolumeVoice)); SetVolumeMusic = s.Serialize <int>(SetVolumeMusic, name: nameof(SetVolumeMusic)); SetVolumeAmbiance = s.Serialize <int>(SetVolumeAmbiance, name: nameof(SetVolumeAmbiance)); SetVolumeMenu = s.Serialize <int>(SetVolumeMenu, name: nameof(SetVolumeMenu)); if (s.IsReading) { var temp = new List <Rayman3PCSaveDataEntry>(); var index = 0; while (temp.LastOrDefault()?.KeyLength != 0) { temp.Add(s.SerializeObject <Rayman3PCSaveDataEntry>(default, name: $"{Items}[{index}]"));
public void Serialize(IBinarySerializer s) { Message_handle = s.Serialize <uint>(Message_handle, name: nameof(Message_handle)); Type = s.Serialize <uint>(Type, name: nameof(Type)); Onlinedate = s.SerializeObject <UbiArtDateTime>(Onlinedate, name: nameof(Onlinedate)); LocalDate = s.SerializeObject <UbiArtDateTime>(LocalDate, name: nameof(LocalDate)); PersistentSeconds = s.Serialize <uint>(PersistentSeconds, name: nameof(PersistentSeconds)); Title = s.SerializeObject <SmartLocId>(Title, name: nameof(Title)); Body = s.SerializeObject <SmartLocId>(Body, name: nameof(Body)); IsPrompt = s.SerializeBool <uint>(IsPrompt, name: nameof(IsPrompt)); IsDrc = s.SerializeBool <uint>(IsDrc, name: nameof(IsDrc)); HasBeenRead = s.SerializeBool <uint>(HasBeenRead, name: nameof(HasBeenRead)); IsOnline = s.SerializeBool <uint>(IsOnline, name: nameof(IsOnline)); RemoveAfterRead = s.SerializeBool <uint>(RemoveAfterRead, name: nameof(RemoveAfterRead)); HasBeenInteract = s.SerializeBool <uint>(HasBeenInteract, name: nameof(HasBeenInteract)); RemoveAfterInteract = s.SerializeBool <uint>(RemoveAfterInteract, name: nameof(RemoveAfterInteract)); LockedAfterInteract = s.SerializeBool <uint>(LockedAfterInteract, name: nameof(LockedAfterInteract)); Buttons = s.SerializeUbiArtObjectArray <SmartLocId>(Buttons, name: nameof(Buttons)); Attributes = s.SerializeUbiArtObjectArray <Attribute>(Attributes, name: nameof(Attributes)); Markers = s.SerializeUbiArtObjectArray <Marker>(Markers, name: nameof(Markers)); }
/// <summary> /// Serializes an unknown generic value for UbiArt games /// </summary> /// <typeparam name="T">The type of value to serialize</typeparam> /// <param name="s">The serializer</param> /// <param name="value">The value</param> /// <param name="name">The object value name, for logging</param> /// <returns>The value</returns> public static T SerializeUbiArtGenericValue <T>(this IBinarySerializer s, T value, string name = null) { // Get the type var t = typeof(T); // Check if the value is a boolean or string, which we handle differently if (t == typeof(string)) { return((T)(object)s.SerializeLengthPrefixedString((string)(object)value, name: name)); } else if (t == typeof(bool)) { return((T)(object)s.SerializeBool <uint>((bool)(object)value, name: name)); } else { return(s.Serialize <T>(value, name: name)); } }
public void Serialize(IBinarySerializer s) { State = s.Serialize <SPOT_STATE>(State, name: nameof(State)); HasWarning = s.SerializeBool <uint>(HasWarning, name: nameof(HasWarning)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { IsLocked = s.SerializeBool <byte>(IsLocked, name: nameof(IsLocked)); LumsRecord = s.Serialize <ushort>(LumsRecord, name: nameof(LumsRecord)); RecordTime = s.Serialize <uint>(RecordTime, name: nameof(RecordTime)); }
public void Serialize(IBinarySerializer s) { WorldTag = s.SerializeObject <UbiArtStringID>(WorldTag, name: nameof(WorldTag)); Type = s.Serialize <uint>(Type, name: nameof(Type)); IsNew = s.SerializeBool <uint>(IsNew, name: nameof(IsNew)); }
public void Serialize(IBinarySerializer s) { Levels = s.SerializeUbiArtObjectArray <UbiArtObjKeyObjValuePair <UbiArtStringID, UbiArtGeneric <PersistentGameData_Level> > >(Levels, name: nameof(Levels)); Rewards = s.SerializeObject <SaveSession>(Rewards, name: nameof(Rewards)); Score = s.SerializeObject <PersistentGameData_Score>(Score, name: nameof(Score)); Profile = s.SerializeObject <ProfileData>(Profile, name: nameof(Profile)); BubbleDreamer = s.SerializeObject <PersistentGameData_BubbleDreamerData>(BubbleDreamer, name: nameof(BubbleDreamer)); UnlockedPets = s.SerializeUbiArtArray <int>(UnlockedPets, name: nameof(UnlockedPets)); PetsDailyReward = s.SerializeUbiArtObjectArray <PetRewardData>(PetsDailyReward, name: nameof(PetsDailyReward)); UnlockedCupsForPets = s.SerializeUbiArtObjectArray <St_petCups>(UnlockedCupsForPets, name: nameof(UnlockedCupsForPets)); GivenPetCount = s.Serialize <uint>(GivenPetCount, name: nameof(GivenPetCount)); NewPetsUnlocked = s.SerializeBool <uint>(NewPetsUnlocked, name: nameof(NewPetsUnlocked)); FirstPetShown = s.SerializeBool <uint>(FirstPetShown, name: nameof(FirstPetShown)); HasShownMessageAllPet = s.SerializeBool <uint>(HasShownMessageAllPet, name: nameof(HasShownMessageAllPet)); Messages = s.SerializeUbiArtObjectArray <Message>(Messages, name: nameof(Messages)); MessagesTotalCount = s.Serialize <uint>(MessagesTotalCount, name: nameof(MessagesTotalCount)); Messages_onlineDate = s.SerializeObject <UbiArtDateTime>(Messages_onlineDate, name: nameof(Messages_onlineDate)); Messages_localDate = s.SerializeObject <UbiArtDateTime>(Messages_localDate, name: nameof(Messages_localDate)); Messages_readDrcCount = s.Serialize <uint>(Messages_readDrcCount, name: nameof(Messages_readDrcCount)); Messages_interactDrcCount = s.Serialize <uint>(Messages_interactDrcCount, name: nameof(Messages_interactDrcCount)); Messages_lastSeenMessageHandle = s.Serialize <uint>(Messages_lastSeenMessageHandle, name: nameof(Messages_lastSeenMessageHandle)); Messages_tutoCount = s.Serialize <uint>(Messages_tutoCount, name: nameof(Messages_tutoCount)); Messages_drcCountSinceLastInteract = s.Serialize <uint>(Messages_drcCountSinceLastInteract, name: nameof(Messages_drcCountSinceLastInteract)); PlayerCard_displayedCount = s.Serialize <uint>(PlayerCard_displayedCount, name: nameof(PlayerCard_displayedCount)); PlayerCard_tutoSeen = s.SerializeBool <uint>(PlayerCard_tutoSeen, name: nameof(PlayerCard_tutoSeen)); GameCompleted = s.SerializeBool <uint>(GameCompleted, name: nameof(GameCompleted)); TimeToCompleteGameInSec = s.Serialize <uint>(TimeToCompleteGameInSec, name: nameof(TimeToCompleteGameInSec)); TimeSpendInGameInSec = s.Serialize <uint>(TimeSpendInGameInSec, name: nameof(TimeSpendInGameInSec)); TeensiesBonusCounter = s.Serialize <uint>(TeensiesBonusCounter, name: nameof(TeensiesBonusCounter)); LuckyTicketsCounter = s.Serialize <uint>(LuckyTicketsCounter, name: nameof(LuckyTicketsCounter)); LuckyTicketLevelCount = s.Serialize <uint>(LuckyTicketLevelCount, name: nameof(LuckyTicketLevelCount)); RetroMapUnlockedCounter = s.Serialize <uint>(RetroMapUnlockedCounter, name: nameof(RetroMapUnlockedCounter)); MrDarkUnlockCount = s.SerializeUbiArtObjectArray <UbiArtStringID>(MrDarkUnlockCount, name: nameof(MrDarkUnlockCount)); CatchEmAllIndex = s.Serialize <uint>(CatchEmAllIndex, name: nameof(CatchEmAllIndex)); NewCostumes = s.SerializeUbiArtObjectArray <UbiArtStringID>(NewCostumes, name: nameof(NewCostumes)); CostumeUnlockSeen = s.SerializeUbiArtObjectArray <UbiArtStringID>(CostumeUnlockSeen, name: nameof(CostumeUnlockSeen)); RetroUnlocks = s.SerializeUbiArtObjectArray <UbiArtStringID>(RetroUnlocks, name: nameof(RetroUnlocks)); NewUnlockedDoor = s.SerializeUbiArtObjectArray <UnlockedDoor>(NewUnlockedDoor, name: nameof(NewUnlockedDoor)); LuckyTicketRewardList = s.SerializeUbiArtObjectArray <RO2_LuckyTicketReward>(LuckyTicketRewardList, name: nameof(LuckyTicketRewardList)); NodeData = s.SerializeUbiArtObjectArray <NodeDataStruct>(NodeData, name: nameof(NodeData)); LuckyTicketsRewardGivenCounter = s.Serialize <uint>(LuckyTicketsRewardGivenCounter, name: nameof(LuckyTicketsRewardGivenCounter)); ConsecutiveLuckyTicketCount = s.Serialize <uint>(ConsecutiveLuckyTicketCount, name: nameof(ConsecutiveLuckyTicketCount)); TicketReminderMessageCount = s.Serialize <uint>(TicketReminderMessageCount, name: nameof(TicketReminderMessageCount)); DisplayGhosts = s.Serialize <uint>(DisplayGhosts, name: nameof(DisplayGhosts)); UplayDoneAction0 = s.SerializeBool <uint>(UplayDoneAction0, name: nameof(UplayDoneAction0)); UplayDoneAction1 = s.SerializeBool <uint>(UplayDoneAction1, name: nameof(UplayDoneAction1)); UplayDoneAction2 = s.SerializeBool <uint>(UplayDoneAction2, name: nameof(UplayDoneAction2)); UplayDoneAction3 = s.SerializeBool <uint>(UplayDoneAction3, name: nameof(UplayDoneAction3)); UplayDoneReward0 = s.SerializeBool <uint>(UplayDoneReward0, name: nameof(UplayDoneReward0)); UplayDoneReward1 = s.SerializeBool <uint>(UplayDoneReward1, name: nameof(UplayDoneReward1)); UplayDoneReward2 = s.SerializeBool <uint>(UplayDoneReward2, name: nameof(UplayDoneReward2)); UplayDoneReward3 = s.SerializeBool <uint>(UplayDoneReward3, name: nameof(UplayDoneReward3)); PlayedDiamondCupSequence = s.SerializeUbiArtObjectArray <UbiArtStringID>(PlayedDiamondCupSequence, name: nameof(PlayedDiamondCupSequence)); Costumes = s.SerializeUbiArtObjectArray <UbiArtStringID>(Costumes, name: nameof(Costumes)); PlayedChallenge = s.SerializeUbiArtArray <uint>(PlayedChallenge, name: nameof(PlayedChallenge)); PlayedInvasion = s.SerializeUbiArtObjectArray <UbiArtStringID>(PlayedInvasion, name: nameof(PlayedInvasion)); TvOffOptionEnabledNb = s.Serialize <uint>(TvOffOptionEnabledNb, name: nameof(TvOffOptionEnabledNb)); TvOffOptionActivatedTime = s.Serialize <uint>(TvOffOptionActivatedTime, name: nameof(TvOffOptionActivatedTime)); BarbaraCostumeUnlockSeen = s.SerializeBool <uint>(BarbaraCostumeUnlockSeen, name: nameof(BarbaraCostumeUnlockSeen)); WorldUnlockMessagesSeen = s.SerializeUbiArtObjectArray <UbiArtStringID>(WorldUnlockMessagesSeen, name: nameof(WorldUnlockMessagesSeen)); RetroWorldUnlockMessageSeen = s.SerializeBool <uint>(RetroWorldUnlockMessageSeen, name: nameof(RetroWorldUnlockMessageSeen)); FreedAllTeensiesMessageSeen = s.SerializeBool <uint>(FreedAllTeensiesMessageSeen, name: nameof(FreedAllTeensiesMessageSeen)); MisterDarkCompletionMessageSeen = s.SerializeBool <uint>(MisterDarkCompletionMessageSeen, name: nameof(MisterDarkCompletionMessageSeen)); FirstInvasionMessageSeen = s.SerializeBool <uint>(FirstInvasionMessageSeen, name: nameof(FirstInvasionMessageSeen)); InvitationTutoSeen = s.SerializeBool <uint>(InvitationTutoSeen, name: nameof(InvitationTutoSeen)); MessageSeen8Bit = s.SerializeBool <uint>(MessageSeen8Bit, name: nameof(MessageSeen8Bit)); ChallengeWorldUnlockMessageSeen = s.SerializeBool <uint>(ChallengeWorldUnlockMessageSeen, name: nameof(ChallengeWorldUnlockMessageSeen)); DoorUnlockMessageSeen = s.SerializeUbiArtObjectArray <UbiArtStringID>(DoorUnlockMessageSeen, name: nameof(DoorUnlockMessageSeen)); DoorUnlockDRCMessageRequired = s.SerializeUbiArtObjectArray <UbiArtStringID>(DoorUnlockDRCMessageRequired, name: nameof(DoorUnlockDRCMessageRequired)); LuckyTicketRewardWorldName = s.SerializeObject <UbiArtStringID>(LuckyTicketRewardWorldName, name: nameof(LuckyTicketRewardWorldName)); IsUGCMiiverseWarningSet = s.SerializeBool <uint>(IsUGCMiiverseWarningSet, name: nameof(IsUGCMiiverseWarningSet)); Reward39Failed = s.Serialize <int>(Reward39Failed, name: nameof(Reward39Failed)); UnlockPrivilegesData = s.SerializeLengthPrefixedString(UnlockPrivilegesData, name: nameof(UnlockPrivilegesData)); IsDemoRewardChecked = s.Serialize <int>(IsDemoRewardChecked, name: nameof(IsDemoRewardChecked)); PrisonerDataDummy = s.SerializeObject <PrisonerData>(PrisonerDataDummy, name: nameof(PrisonerDataDummy)); PersistentGameDataLevelDummy = s.SerializeObject <PersistentGameData_Level>(PersistentGameDataLevelDummy, name: nameof(PersistentGameDataLevelDummy)); MessageDummy = s.SerializeObject <Message>(MessageDummy, name: nameof(MessageDummy)); UnlockedDoorDummy = s.SerializeObject <UnlockedDoor>(UnlockedDoorDummy, name: nameof(UnlockedDoorDummy)); BubbleDreamerDataDummy = s.SerializeObject <PersistentGameData_BubbleDreamerData>(BubbleDreamerDataDummy, name: nameof(BubbleDreamerDataDummy)); DummmyNodeData = s.SerializeObject <NodeDataStruct>(DummmyNodeData, name: nameof(DummmyNodeData)); }
public void Serialize(IBinarySerializer s) { Name = s.SerializeLengthPrefixedString(Name, name: nameof(Name)); Parent = s.SerializeBool <uint>(Parent); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { DefaultText = s.SerializeLengthPrefixedString(DefaultText, name: nameof(DefaultText)); LocId = s.SerializeObject <LocalisationId>(LocId, name: nameof(LocId)); UseText = s.SerializeBool <uint>(UseText, name: nameof(UseText)); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { // Serialize and verify the magic header MagicHeader = s.Serialize <uint>(MagicHeader, name: nameof(MagicHeader)); if (MagicHeader != 0x50EC12BA) { throw new Exception("The IPK header is not valid"); } // Serialize version Version = s.Serialize <uint>(Version, name: nameof(Version)); // Serialize first unknown value Unknown1 = s.Serialize <uint>(Unknown1, name: nameof(Unknown1)); // Serialize second unknown value if version is above or equal to 8 if (Version >= 8) { Unknown2 = s.Serialize <uint>(Unknown2, name: nameof(Unknown2)); } // Serialize offset and file count BaseOffset = s.Serialize <uint>(BaseOffset, name: nameof(BaseOffset)); FilesCount = s.Serialize <uint>(FilesCount, name: nameof(FilesCount)); // Serialize unknown values Unknown3 = s.SerializeBool <uint>(Unknown3, name: nameof(Unknown3)); Unknown4 = s.SerializeBool <uint>(Unknown4, name: nameof(Unknown4)); Unknown5 = s.SerializeBool <uint>(Unknown5, name: nameof(Unknown5)); Unknown6 = s.Serialize <uint>(Unknown6, name: nameof(Unknown6)); if (s.GetSettings <UbiArtSettings>().Game == UbiArtGame.ValiantHearts) { Unknown9 = s.Serialize <uint>(Unknown9, name: nameof(Unknown9)); } Unknown7 = s.Serialize <uint>(Unknown7, name: nameof(Unknown7)); EngineVersion = s.Serialize <uint>(EngineVersion, name: nameof(EngineVersion)); if (SupportsCompressedBlock) { BlockSize = s.Serialize <uint>(BlockSize, name: nameof(BlockSize)); BlockCompressedSize = s.Serialize <uint>(BlockCompressedSize, name: nameof(BlockCompressedSize)); } // Serialize the file array size Files = s.SerializeArraySize <UbiArtIPKFileEntry, uint>(Files, name: nameof(Files)); // NOTE: So far this only appears to be the case for the bundle_pc32.ipk file used in Child of Light // TODO: Add logging when migrated to BinarySerializer //if (Files.Length != FilesCount) // Logger.Warn("The initial file count {0} does not match the file array size {1}", FilesCount, Files.Length); // Serialize the file entries Files = s.SerializeObjectArray <UbiArtIPKFileEntry>(Files, Files.Length, (s, o) => o.IPKVersion = Version, name: nameof(Files)); // TODO: Add logging when migrated to BinarySerializer //if (!IsSerializingHeaderSize && s.Stream.Position != BaseOffset) // Logger.Warn("Offset value {0} doesn't match file entry end offset {1}", BaseOffset, s.Stream.Position); }