Skip to content

Commit 4977a84

Browse files
committed
Better logging, actually make the loading flow actions in a sane way
1 parent 88e9c0e commit 4977a84

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

Runtime/Core/Assets/PatchingManager.cs

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private static AsyncOperationHandle<IList<TextAsset>> RebuildCache(string label)
232232
}
233233
catch (Exception e)
234234
{
235-
Logging.LogError($"Unable to patch {asset.name} due to: {e.Message}");
235+
Logging.LogError($"Unable to patch {asset.name} due to: {e.Message}, {e.StackTrace}");
236236
}
237237
});
238238

@@ -318,29 +318,19 @@ GenericFlowAction CreateIndexedFlowAction(int idx)
318318
(resolve2, _) =>
319319
{
320320
var handle = RebuildCache(distinctKeys[idx]);
321-
var killTips = false;
322-
if (idx + 1 < distinctKeys.Count)
323-
{
324-
GameManager.Instance.LoadingFlow.FlowActions.Insert(
325-
GameManager.Instance.LoadingFlow.flowIndex + 1,
326-
CreateIndexedFlowAction(idx + 1)
327-
);
328-
}
329-
else
330-
{
331-
killTips = true;
332-
}
333-
334-
CoroutineUtil.Instance.DoCoroutine(WaitForCacheRebuildSingleHandle(handle, resolve2, killTips));
321+
CoroutineUtil.Instance.DoCoroutine(WaitForCacheRebuildSingleHandle(handle, resolve2, idx + 1 == distinctKeys.Count));
335322
});
336323
}
337324

338325
if (distinctKeys.Count > 0)
339326
{
340-
GameManager.Instance.LoadingFlow.FlowActions.Insert(
341-
GameManager.Instance.LoadingFlow.flowIndex + 1,
342-
CreateIndexedFlowAction(0)
343-
);
327+
for (var i = distinctKeys.Count - 1; i >= 0; i--)
328+
{
329+
GameManager.Instance.LoadingFlow.FlowActions.Insert(
330+
GameManager.Instance.LoadingFlow.flowIndex + 1,
331+
CreateIndexedFlowAction(i)
332+
);
333+
}
344334
}
345335

346336
resolve();

Runtime/SassyPatching/Execution/Universe.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ public string RunAllPatchesFor(string label, string name, string data, out int p
645645
catch (Exception e)
646646
{
647647
errorCount += 1;
648-
ErrorLogger($"Patching {label}:{name} failed due to {e}");
648+
ErrorLogger($"Patching {label}:{name} failed due to {e.Message}");
649649
}
650650
}
651651

@@ -670,7 +670,7 @@ public string RunAllPatchesFor(string label, string name, ISelectable selectable
670670
catch (Exception e)
671671
{
672672
errorCount += 1;
673-
ErrorLogger($"Patching {label}:{name} failed due to {e}");
673+
ErrorLogger($"Patching {label}:{name} failed due to {e.Message}");
674674
}
675675
}
676676
return selectable.Serialize();

0 commit comments

Comments
 (0)