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); }
/// <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))); }
/// <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))); }
/// <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)); }
/// <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, "", "")); }