internal void Hibernate(IMemoryFileController fileController, bool saveMemoryBackup = false) { fileController.WriteToFile(UniqueId, MyMemory, saveMemoryBackup); if (!fileController.FileExists(UniqueId)) { throw new RnpcMemoryException( $"An error has prevented memory file for character {MyName} with guid {UniqueId} from being written."); } }
internal void WakeUp(IMemoryFileController fileController, bool useMemoryBackupAsFailsafe = false) { var memory = fileController.ReadFromFile(UniqueId, useMemoryBackupAsFailsafe); if (memory == null) { throw new RnpcMemoryException("Memory file could not be loaded for character with guid" + UniqueId); } MyMemory = memory; }