protected override void BeginObjectLoad(Guid objectGuid) { var filePath = JsonDiskSaveProvider.GetSavePath(objectGuid); var binaryText = File.ReadAllText(filePath); //decrypt the file and write it back to the file File.WriteAllText(filePath, JsonBinaryDiskSaveProvider.DecryptString(binaryText)); //let the baseclass read it base.BeginObjectLoad(objectGuid); //encrypt it again File.WriteAllText(filePath, binaryText); }
protected override void BeginObjectLoad(Guid objectGuid) { var serializerSettings = new JsonSerializerSettings { Converters = new List <JsonConverter> { new DictionaryConverter() } }; using (StreamReader streamReader = File.OpenText(JsonDiskSaveProvider.GetSavePath(objectGuid))) using (JsonTextReader reader = new JsonTextReader(streamReader)) { _openObject = (JObject)JToken.ReadFrom(reader); _objectEnumerator = _openObject.GetEnumerator(); } }
protected override bool DoesSaveExist(GuidComponent guidComponent) { return(File.Exists(JsonDiskSaveProvider.GetSavePath(guidComponent.GetGuid()))); }