/// <summary> /// Loads the data from a given address /// Note that the load operation will only establish the result as the active data if its prefix matches /// </summary> /// <param name="address"></param> /// <returns></returns> public void Load(SteamworksRemoteStorageManager.FileAddress address) { if (!string.IsNullOrEmpty(address.fileName) && address.fileName.StartsWith(filePrefix)) { activeFile = SteamworksRemoteStorageManager.FileReadSteamDataFile(address); activeFile.WriteToLibrary(this); } }
/// <summary> /// Loads the data for the current active file if any /// Note that this will overwrite the data current stored in the library /// </summary> /// <returns>True if the operation completed, false if skiped such as for a blank active file</returns> public void Load() { if (activeFile != null) { activeFile = SteamworksRemoteStorageManager.FileReadSteamDataFile(activeFile.address); activeFile.WriteToLibrary(this); } }
/// <summary> /// Loads the data for the current active file if any /// Note that this will overwrite the data current stored in the library /// </summary> /// <returns>True if the operation completed, false if skiped such as for a blank active file</returns> public void LoadAsync() { if (activeFile != null) { SteamworksRemoteStorageManager.FileReadAsync(activeFile.address).Complete = results => { activeFile = results; activeFile.WriteToLibrary(this); }; } }
/// <summary> /// Saves the current library data to the current active file /// </summary> /// <returns></returns> public void SaveAsync() { activeFile.linkedLibrary = this; var file = SteamworksRemoteStorageManager.FileWriteAsync(activeFile); if (file.result != Steamworks.EResult.k_EResultFail) { file.Complete = results => { activeFile = results; }; } }
/// <summary> /// Loads the data from a given address /// Note that the load operation will only establish the result as the active data if its prefix matches /// </summary> /// <param name="address"></param> /// <returns></returns> public void LoadAsync(SteamworksRemoteStorageManager.FileAddress address) { if (!string.IsNullOrEmpty(address.fileName) && address.fileName.StartsWith(filePrefix)) { var nDataFile = SteamworksRemoteStorageManager.FileReadAsync(address); if (nDataFile.result != Steamworks.EResult.k_EResultFail) { nDataFile.Complete = results => { activeFile = results; activeFile.WriteToLibrary(this); }; } } }
public void Load(string fileName) { if (fileName.StartsWith(filePrefix)) { var result = SteamworksRemoteStorageManager.FileReadSteamDataFile(fileName); activeFile = result; result.WriteToLibrary(this); } else { var result = SteamworksRemoteStorageManager.FileReadSteamDataFile(filePrefix + fileName); activeFile = result; result.WriteToLibrary(this); } }
public void LoadAsync(string fileName) { if (fileName.StartsWith(filePrefix)) { SteamworksRemoteStorageManager.FileReadAsync(fileName).Complete = fileResult => { activeFile = fileResult; fileResult.WriteToLibrary(this); }; } else { SteamworksRemoteStorageManager.FileReadAsync(filePrefix + fileName).Complete = fileResult => { activeFile = fileResult; fileResult.WriteToLibrary(this); }; } }
/// <summary> /// Saves the file with a new name. /// Note that if the provided file name does not start with the filePrefix defined then it will be added /// </summary> /// <param name="fileName">The name to save as /// Note that if the provided file name does not start with the filePrefix defined then it will be added</param> /// <returns></returns> public void SaveAsAsync(string fileName) { if (string.IsNullOrEmpty(fileName)) { return; } if (!fileName.StartsWith(filePrefix)) { fileName = filePrefix + fileName; } var file = SteamworksRemoteStorageManager.FileWriteAsync(fileName, this); if (file.result != Steamworks.EResult.k_EResultFail) { file.Complete = results => { activeFile = results; }; } }