diff --git a/osu.Android.props b/osu.Android.props
index ca4d88a8a7..4f0125bed2 100644
--- a/osu.Android.props
+++ b/osu.Android.props
@@ -52,7 +52,7 @@
-
+
diff --git a/osu.Game.Tests/Gameplay/TestSceneStoryboardSamples.cs b/osu.Game.Tests/Gameplay/TestSceneStoryboardSamples.cs
index 3aab28886e..28915b2c4a 100644
--- a/osu.Game.Tests/Gameplay/TestSceneStoryboardSamples.cs
+++ b/osu.Game.Tests/Gameplay/TestSceneStoryboardSamples.cs
@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Threading;
using System.Threading.Tasks;
using NUnit.Framework;
using osu.Framework.Audio;
@@ -184,7 +185,8 @@ namespace osu.Game.Tests.Gameplay
public byte[] Get(string name) => name == resourceName ? TestResources.GetStore().Get("Resources/Samples/test-sample.mp3") : null;
- public Task GetAsync(string name) => name == resourceName ? TestResources.GetStore().GetAsync("Resources/Samples/test-sample.mp3") : null;
+ public Task GetAsync(string name, CancellationToken cancellationToken = default)
+ => name == resourceName ? TestResources.GetStore().GetAsync("Resources/Samples/test-sample.mp3", cancellationToken) : null;
public Stream GetStream(string name) => name == resourceName ? TestResources.GetStore().GetStream("Resources/Samples/test-sample.mp3") : null;
diff --git a/osu.Game.Tests/Rulesets/TestSceneDrawableRulesetDependencies.cs b/osu.Game.Tests/Rulesets/TestSceneDrawableRulesetDependencies.cs
index c357fccd27..20439ac969 100644
--- a/osu.Game.Tests/Rulesets/TestSceneDrawableRulesetDependencies.cs
+++ b/osu.Game.Tests/Rulesets/TestSceneDrawableRulesetDependencies.cs
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Threading;
using System.Threading.Tasks;
using NUnit.Framework;
using osu.Framework.Allocation;
@@ -114,7 +115,7 @@ namespace osu.Game.Tests.Rulesets
public Sample Get(string name) => null;
- public Task GetAsync(string name) => null;
+ public Task GetAsync(string name, CancellationToken cancellationToken = default) => null;
public Stream GetStream(string name) => null;
diff --git a/osu.Game/IO/Archives/ArchiveReader.cs b/osu.Game/IO/Archives/ArchiveReader.cs
index 679ab40402..f787534e2d 100644
--- a/osu.Game/IO/Archives/ArchiveReader.cs
+++ b/osu.Game/IO/Archives/ArchiveReader.cs
@@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.IO;
+using System.Threading;
using System.Threading.Tasks;
using osu.Framework.IO.Stores;
@@ -33,7 +34,7 @@ namespace osu.Game.IO.Archives
public virtual byte[] Get(string name) => GetAsync(name).Result;
- public async Task GetAsync(string name)
+ public async Task GetAsync(string name, CancellationToken cancellationToken = default)
{
using (Stream input = GetStream(name))
{
@@ -41,7 +42,7 @@ namespace osu.Game.IO.Archives
return null;
byte[] buffer = new byte[input.Length];
- await input.ReadAsync(buffer).ConfigureAwait(false);
+ await input.ReadAsync(buffer, cancellationToken).ConfigureAwait(false);
return buffer;
}
}
diff --git a/osu.Game/Localisation/ResourceManagerLocalisationStore.cs b/osu.Game/Localisation/ResourceManagerLocalisationStore.cs
index 82dc0ad110..0fb85e4a19 100644
--- a/osu.Game/Localisation/ResourceManagerLocalisationStore.cs
+++ b/osu.Game/Localisation/ResourceManagerLocalisationStore.cs
@@ -7,6 +7,7 @@ using System.Globalization;
using System.IO;
using System.Linq;
using System.Resources;
+using System.Threading;
using System.Threading.Tasks;
using osu.Framework.Localisation;
@@ -75,7 +76,7 @@ namespace osu.Game.Localisation
}
}
- public Task GetAsync(string lookup)
+ public Task GetAsync(string lookup, CancellationToken cancellationToken = default)
{
return Task.FromResult(Get(lookup));
}
diff --git a/osu.Game/Rulesets/UI/DrawableRulesetDependencies.cs b/osu.Game/Rulesets/UI/DrawableRulesetDependencies.cs
index e49e515d2e..aacb8dbe83 100644
--- a/osu.Game/Rulesets/UI/DrawableRulesetDependencies.cs
+++ b/osu.Game/Rulesets/UI/DrawableRulesetDependencies.cs
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Threading;
using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Audio;
@@ -115,7 +116,7 @@ namespace osu.Game.Rulesets.UI
public Sample Get(string name) => primary.Get(name) ?? fallback.Get(name);
- public Task GetAsync(string name) => primary.GetAsync(name) ?? fallback.GetAsync(name);
+ public Task GetAsync(string name, CancellationToken cancellationToken = default) => primary.GetAsync(name, cancellationToken) ?? fallback.GetAsync(name, cancellationToken);
public Stream GetStream(string name) => primary.GetStream(name) ?? fallback.GetStream(name);
diff --git a/osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs b/osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs
index f919edecf7..27d1de83ec 100644
--- a/osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs
+++ b/osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs
@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Threading;
using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Audio;
@@ -166,7 +167,7 @@ namespace osu.Game.Tests.Beatmaps
return Array.Empty();
}
- public Task GetAsync(string name)
+ public Task GetAsync(string name, CancellationToken cancellationToken = default)
{
markLookup(name);
return Task.FromResult(Array.Empty());
diff --git a/osu.Game/Tests/Visual/OsuTestScene.cs b/osu.Game/Tests/Visual/OsuTestScene.cs
index 7bc63a8c26..1b2c1e72c4 100644
--- a/osu.Game/Tests/Visual/OsuTestScene.cs
+++ b/osu.Game/Tests/Visual/OsuTestScene.cs
@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
+using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using osu.Framework.Allocation;
@@ -352,7 +353,7 @@ namespace osu.Game.Tests.Visual
public Track Get(string name) => throw new NotImplementedException();
- public Task
-
+
@@ -83,7 +83,7 @@
-
+