Skip to content

Commit 79e33ef

Browse files
authored
Merge branch 'development' into fix/package-json-author
2 parents 4f64670 + dc4ff13 commit 79e33ef

File tree

7 files changed

+48
-38
lines changed

7 files changed

+48
-38
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,14 @@ public class ConfigEditor<T> : IConfigEditor where T : EpicOnlineServices.Config
7474
/// collapsed, as animating that requires calling the repaint function
7575
/// that is typically called from within EditorWindow.
7676
/// </param>
77-
public ConfigEditor(UnityAction repaintFn = null)
77+
public ConfigEditor(UnityAction repaintFn = null, bool startsExpanded = false)
7878
{
7979
Type configType = typeof(T);
8080

8181
ConfigGroupAttribute attribute = configType.GetCustomAttribute<ConfigGroupAttribute>();
82+
83+
_expanded = startsExpanded;
84+
8285
_animExpanded = new(attribute.Collapsible);
8386

8487
_labelText = attribute.Label;
@@ -112,7 +115,7 @@ private bool Expanded
112115
_expanded = value;
113116
if (_expanded)
114117
{
115-
OnExpanded(this);
118+
OnExpanded?.Invoke(this);
116119
}
117120
}
118121
}
@@ -123,7 +126,7 @@ private bool Expanded
123126
public void Expand()
124127
{
125128
Expanded = true;
126-
OnExpanded(this);
129+
OnExpanded?.Invoke(this);
127130
}
128131

129132
/// <summary>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static void OpenUnitTestSettingsWindow()
4545

4646
protected override async Task AsyncSetup()
4747
{
48-
_testConfigEditor = new ConfigEditor<UnitTestConfig>();
48+
_testConfigEditor = new ConfigEditor<UnitTestConfig>(Repaint, true);
4949
await _testConfigEditor.LoadAsync();
5050
}
5151

Assets/Scripts/EOSPlayerDataStorageManager.cs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,16 @@ public bool StartFileDataUpload(string fileName, Action fileCreatedCallback = nu
188188
CancelCurrentTransfer();
189189
CurrentTransferHandle = req;
190190

191-
EOSTransferInProgress newTransfer = new EOSTransferInProgress();
192-
newTransfer.Download = false;
193-
194-
newTransfer.TotalSize = (uint)fileData.Length;
195-
if (newTransfer.TotalSize > 0)
191+
EOSTransferInProgress newTransfer = new()
196192
{
197-
byte[] utf8ByteArray = System.Text.Encoding.UTF8.GetBytes(fileData);
193+
Download = false
194+
};
198195

199-
newTransfer.Data = utf8ByteArray;
196+
if (null != fileData)
197+
{
198+
newTransfer.Data = System.Text.Encoding.UTF8.GetBytes(fileData);
200199
}
200+
201201
newTransfer.CurrentIndex = 0;
202202

203203
TransfersInProgress[fileName] = newTransfer;
@@ -376,14 +376,9 @@ private ReadResult ReceiveData(string fileName, ArraySegment<byte> data, uint to
376376
}
377377

378378
// First update
379-
if (transfer.CurrentIndex == 0 && transfer.TotalSize == 0)
379+
if (transfer.CurrentIndex == 0)
380380
{
381-
transfer.TotalSize = totalSize;
382-
383-
if (transfer.TotalSize == 0)
384-
{
385-
return ReadResult.ContinueReading;
386-
}
381+
transfer.Data = new byte[totalSize];
387382
}
388383

389384
// If more data has been received than was anticipated, fail the request

Assets/Scripts/EOSTitleStorageManager.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,9 @@ private ReadResult ReceiveData(string fileName, ArraySegment<byte> data, uint to
370370
}
371371

372372
// First update
373-
if (transfer.CurrentIndex == 0 && transfer.TotalSize == 0)
373+
if (transfer.CurrentIndex == 0)
374374
{
375-
transfer.TotalSize = totalSize;
376-
377-
if (transfer.TotalSize == 0)
378-
{
379-
return ReadResult.RrContinuereading;
380-
}
375+
transfer.Data = new byte[totalSize];
381376
}
382377

383378
// Make sure we have enough space

Assets/Scripts/EOSTransferInProgress.cs

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
namespace PlayEveryWare.EpicOnlineServices.Samples
2828
{
29+
using Editor.Utility;
30+
2931
/// <summary>
3032
/// Class <c>EOSTransferInProgress</c> is used in <c>EOSTitleStorageManager</c> and <c>EOSPlayerDataStorageManager</c> to keep track of downloaded cached file data.
3133
/// </summary>
@@ -37,24 +39,40 @@ public class EOSTransferInProgress
3739

3840
public bool Download = true;
3941
public uint CurrentIndex = 0;
40-
public byte[] Data;
41-
private uint transferSize = 0;
42+
private byte[] _data;
4243

43-
public uint TotalSize
44+
public byte[] Data
4445
{
4546
get
4647
{
47-
return transferSize;
48+
return _data;
4849
}
4950
set
5051
{
51-
transferSize = value;
52-
53-
if (transferSize > FileMaxSizeBytes)
52+
// If the file sizer is larger than the maximum allowable size,
53+
// then log an error, but do not throw an exception, since
54+
// throwing an exception from a property setter is a little
55+
// confusing, and there will be an opportunity to catch the
56+
// mistake when EOS returns an error code.
57+
if (null != value && value.Length > FileMaxSizeBytes)
5458
{
55-
Debug.LogError("[EOS SDK] Player data storage: data transfer size exceeds max file size.");
56-
transferSize = FileMaxSizeBytes;
59+
Debug.LogError($"Maximum file size is 200MB.");
5760
}
61+
62+
_data = value;
63+
}
64+
}
65+
66+
public uint TotalSize
67+
{
68+
get
69+
{
70+
if (null == _data)
71+
return 0;
72+
73+
_ = SafeTranslatorUtility.TryConvert(_data.Length, out uint totalSize);
74+
75+
return totalSize;
5876
}
5977
}
6078

Assets/Scripts/StandardSamples/UI/Common/SampleMenu.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ protected virtual void OnEnable()
211211
/// </summary>
212212
protected virtual void Update()
213213
{
214-
// If nothing is selected, set the selected (focused) control to be
215-
// UIFirstSelected (if that field has been set).
216-
SetSelected();
214+
// Default behavior is to take no action.
217215
}
218216

219217
/// <summary>

etc/PackageConfigurations/eos_package_description.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
{"src": "Assets/EOS.meta", "dest": "Runtime/" },
1414
{"src": "Assets/EOS/*.png", "dest": "Runtime/EOS/" },
1515

16-
{"src": "Assets/Plugins/*", "dest": "Runtime/" },
16+
{"src": "Assets/Plugins/*", "dest": "Runtime/" },
17+
{"src": "com.playeveryware.eos/Runtime/*", "dest": "Runtime/" },
1718
{"src": "com.playeveryware.eos/Runtime/Core/*", "dest": "Runtime/Core/" },
1819
{"src": "com.playeveryware.eos/Runtime/Core/Utility/*", "dest": "Runtime/Core/Utility/" },
1920
{"src": "com.playeveryware.eos/Runtime/Core/Utility/Extensions/*", "dest": "Runtime/Core/Utility/Extensions/" },

0 commit comments

Comments
 (0)