Example #1
0
        private void Action_LoadFileFromSaveDataPath()
        {
            _isSaveDataPathValid = File.Exists(_saveDataPath);
            if (_isSaveDataPathValid.HasValue && _isSaveDataPathValid.Value)
            {
                ES3File file         = new ES3File(_saveDataPath, Default_ES3Settings);
                var     contentBytes = file.LoadRawBytes();

                using (MemoryStream stream = new MemoryStream(contentBytes))
                {
                    StreamReader reader = new StreamReader(ES3Stream.CreateStream(stream, Default_ES3Settings, ES3FileMode.Read));
                    SaveDataContent = reader.ReadToEnd();
                }
            }

            var obj = JsonConvert.DeserializeObject(SaveDataContent);

            SaveDataContent = JsonConvert.SerializeObject(obj, Formatting.Indented);
        }
Example #2
0
 /// <summary>Uploads a local file to the server, overwriting any existing file.</summary>
 /// <param name="es3File">An ES3File containing the data we want to upload.</param>
 /// <param name="user">The unique name of the user this file belongs to, if the file isn't globally accessible.</param>
 /// <param name="password">The password of the user this file belongs to.</param>
 public IEnumerator UploadFile(ES3File es3File, string user, string password)
 {
     return(UploadFile(es3File.LoadRawBytes(), es3File.settings, user, password, DateTimeToUnixTimestamp(DateTime.Now)));
 }
Example #3
0
 /// <summary>Uploads a local file to the server, overwriting any existing file.</summary>
 /// <param name="es3File">An ES3File containing the data we want to upload.</param>
 public IEnumerator UploadFile(ES3File es3File)
 {
     return(UploadFile(es3File.LoadRawBytes(), es3File.settings, "", "", DateTimeToUnixTimestamp(DateTime.Now)));
 }
Example #4
0
 /// <summary>Uploads a local file to the server, overwriting any existing file.</summary>
 /// <param name="es3File">An ES3File containing the data we want to upload.</param>
 /// <param name="user">The unique name of the user this file belongs to, if the file isn't globally accessible.</param>
 /// <param name="password">The password of the user this file belongs to.</param>
 public IEnumerator UploadFile(ES3File es3File, string user, string password)
 {
     return(UploadFile(es3File.LoadRawBytes(), es3File.settings, user, password));
 }
Example #5
0
 /// <summary>Uploads a local file to the server, overwriting any existing file.</summary>
 /// <param name="es3File">An ES3File containing the data we want to upload.</param>
 public IEnumerator UploadFile(ES3File es3File)
 {
     return(UploadFile(es3File.LoadRawBytes(), es3File.settings, "", ""));
 }