Skip to content

Commit f66fea1

Browse files
authored
Merge branch 'release-3.3.5' into fix/populate-platform-deployment-from-product
2 parents c2beaf5 + 5a6a11b commit f66fea1

File tree

7 files changed

+37
-17
lines changed

7 files changed

+37
-17
lines changed

Assets/Plugins/Source/Editor/ConfigEditors/ConfigEditor.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,12 @@ public void Load()
179179
Task.Run(LoadAsync).GetAwaiter().GetResult();
180180
}
181181

182-
public async Task Save(bool prettyPrint = true)
182+
public void Save(bool prettyPrint = true)
183+
{
184+
config.Write(prettyPrint);
185+
}
186+
187+
public async Task SaveAsync(bool prettyPrint = true)
183188
{
184189
await config.WriteAsync(prettyPrint);
185190
}

Assets/Plugins/Source/Editor/ConfigEditors/IConfigEditor.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,20 @@ public interface IConfigEditor : IDisposable
6161
void Load();
6262

6363
/// <summary>
64-
/// Saves the configuration to disk.
64+
/// Saves the configuration to disk synchronously.
65+
/// </summary>
66+
/// <param name="prettyPrint">
67+
/// Whether to format the JSON in a more human-readable manner.
68+
/// </param>
69+
void Save(bool prettyPrint = true);
70+
71+
/// <summary>
72+
/// Saves the configuration to disk asynchronously.
6573
/// </summary>
6674
/// <param name="prettyPrint">
6775
/// Whether or not to format the JSON in a more human-readable manner.
6876
/// </param>
69-
Task Save(bool prettyPrint = true);
77+
Task SaveAsync(bool prettyPrint = true);
7078

7179
/// <summary>
7280
/// Render the editor for the configuration values.

Assets/Plugins/Source/Editor/EditorWindows/EOSPluginSettingsWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private void Save()
155155
{
156156
foreach (var configurationSectionEditor in configEditors)
157157
{
158-
configurationSectionEditor.Save();
158+
configurationSectionEditor.SaveAsync();
159159
}
160160

161161
AssetDatabase.SaveAssets();

Assets/Plugins/Source/Editor/EditorWindows/EOSSettingsWindow.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
// Uncomment the following line to see all platforms, even ones that are not
2424
// available
25-
#define DEBUG_SHOW_UNAVAILABLE_PLATFORMS
25+
//#define DEBUG_SHOW_UNAVAILABLE_PLATFORMS
2626

2727
#if !EOS_DISABLE
2828

@@ -43,7 +43,7 @@ namespace PlayEveryWare.EpicOnlineServices.Editor.Windows
4343
/// Creates the view for showing the eos plugin editor config values.
4444
/// </summary>
4545
[Serializable]
46-
public class NEW_EOSSettingsWindow : EOSEditorWindow
46+
public class EOSSettingsWindow : EOSEditorWindow
4747
{
4848
/// <summary>
4949
/// The editor for the product information that is shared across all
@@ -84,12 +84,12 @@ public class NEW_EOSSettingsWindow : EOSEditorWindow
8484
fixedHeight = 40
8585
};
8686

87-
public NEW_EOSSettingsWindow() : base("EOS Configuration") { }
87+
public EOSSettingsWindow() : base("EOS Configuration") { }
8888

8989
[MenuItem("EOS Plugin/EOS Configuration", priority = 1)]
9090
public static void ShowWindow()
9191
{
92-
var window = GetWindow<NEW_EOSSettingsWindow>();
92+
var window = GetWindow<EOSSettingsWindow>();
9393
window.SetIsEmbedded(false);
9494
}
9595

@@ -211,18 +211,18 @@ protected override void RenderWindow()
211211
}
212212
}
213213

214-
private async void Save()
214+
private void Save()
215215
{
216216
// Save the product config editor
217-
await _productConfigEditor.Save();
217+
_productConfigEditor.Save();
218218

219219
// reload the product config editor
220220
await _productConfigEditor.LoadAsync();
221221

222222
// Save each of the platform config editors.
223223
foreach (IConfigEditor editor in _platformConfigEditors)
224224
{
225-
await editor.Save();
225+
editor.Save();
226226
}
227227
}
228228
}

Assets/Plugins/Source/Editor/EditorWindows/EOSSettingsWindow_DEPRECATED.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ private async Task Save(bool usePrettyFormat)
204204

205205
foreach (var platformSpecificConfigEditor in platformSpecificConfigEditors)
206206
{
207-
await platformSpecificConfigEditor.Save(usePrettyFormat);
207+
await platformSpecificConfigEditor.SaveAsync(usePrettyFormat);
208208
}
209209

210210
#if ALLOW_CREATION_OF_EOS_CONFIG_AS_C_FILE

Assets/Plugins/Source/Editor/EditorWindows/EOSUnitTestSettingsWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected async override void RenderWindow()
5757

5858
if (GUILayout.Button("Save", GUILayout.Width(100)))
5959
{
60-
await _testConfigEditor.Save();
60+
await _testConfigEditor.SaveAsync();
6161
}
6262
}
6363
}

com.playeveryware.eos/Runtime/Core/Utility/FileSystemUtility.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,12 @@ public static async Task<string> ReadAllTextAsync(string path)
511511
try
512512
{
513513
#if NET_STANDARD_2_0
514-
return await File.ReadAllTextAsync(path);
514+
await using FileStream fileStream = new(path, FileMode.Open, FileAccess.Read, FileShare.Read);
515+
using StreamReader reader = new(fileStream);
516+
string content = await reader.ReadToEndAsync();
517+
return content;
515518
#else
516-
return await Task.Run(() => File.ReadAllText(path));
519+
return await Task.Run(() => ReadAllText(path));
517520
#endif
518521
}
519522
catch (Exception e)
@@ -535,9 +538,13 @@ public static string ReadAllText(string path)
535538
#else
536539
try
537540
{
538-
return File.ReadAllText(path);
541+
// Open the file with explicit FileStream and sharing options
542+
using FileStream fileStream = new(path, FileMode.Open, FileAccess.Read, FileShare.Read);
543+
using StreamReader reader = new(fileStream);
544+
string content = reader.ReadToEnd();
545+
return content;
539546
}
540-
catch (Exception e)
547+
catch (IOException e)
541548
{
542549
Debug.LogException(e);
543550
throw;

0 commit comments

Comments
 (0)