Exemplo n.º 1
0
 /// <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);
     }
 }
Exemplo n.º 2
0
 /// <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);
     }
 }
Exemplo n.º 3
0
 /// <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);
         };
     }
 }
Exemplo n.º 4
0
        /// <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;
                };
            }
        }
Exemplo n.º 5
0
 /// <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);
             };
         }
     }
 }
Exemplo n.º 6
0
 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);
     }
 }
Exemplo n.º 7
0
 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);
         };
     }
 }
Exemplo n.º 8
0
        /// <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;
                };
            }
        }