Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions osu.Android/OsuGameActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public class OsuGameActivity : AndroidGameActivity, ISurfaceHolderCallback

private OsuGameAndroid? game;

protected OsuGameActivity(IntPtr handle, JniHandleOwnership transfer)
: base()
{
}

private bool gameCreated;

protected override osu.Framework.Game CreateGame()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ public void TestBasicAppearance()
CoverUrl = TestResources.COVER_IMAGE_3,
}, RNG.Next(1_000_000), RNG.Next(11, 1000));

var testScore = TestResources.CreateTestScoreInfo();
testScore.TotalScore = RNG.Next(1_000_000);


feed.AddNewScore(ev);
}, 50);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ public void TestBasicAppearance()
CoverUrl = TestResources.COVER_IMAGE_3,
}, RNG.Next(1_000_000), RNG.Next(11, 1000));

var testScore = TestResources.CreateTestScoreInfo();
testScore.TotalScore = RNG.Next(1_000_000);

totals.AddNewScore(ev);
}
Expand Down
26 changes: 18 additions & 8 deletions osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@
IsValidMod = _ => false
});

if (playlistItem?.AllowedMods.Any() == true)
var item = playlistItem;

if (item?.AllowedMods.Any() == true)
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
{
footerButtons.Insert(-1, new UserModSelectButton
{
Expand All @@ -336,8 +338,8 @@
Action = () => userModsSelectOverlay.Show(),
});

var rulesetInstance = rulesets.GetRuleset(playlistItem.RulesetID)!.CreateInstance();
var allowedMods = playlistItem.AllowedMods.Select(m => m.ToMod(rulesetInstance));
var rulesetInstance = rulesets.GetRuleset(item.RulesetID)!.CreateInstance();
var allowedMods = item.AllowedMods.Select(m => m.ToMod(rulesetInstance));
userModsSelectOverlay.IsValidMod = leaderboard.IsValidMod = m => allowedMods.Any(a => a.GetType() == m.GetType());
}

Expand All @@ -349,13 +351,18 @@

private void presentScore(long id)
{
if (this.IsCurrentScreen())
if (playlistItem != null) this.Push(new PlaylistItemScoreResultsScreen(id, (room?.RoomID ?? 0), playlistItem));
if (!this.IsCurrentScreen())
return;

var item = playlistItem;
if (item != null)
this.Push(new PlaylistItemScoreResultsScreen(id, (room?.RoomID ?? 0), item));
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
}

private void onRoomScoreSet(MultiplayerRoomScoreSetEvent e)
{
if (room != null && (e.RoomID != room.RoomID || e.PlaylistItemID != playlistItem?.ID))
var item = playlistItem;
if (room != null && (e.RoomID != room.RoomID || e.PlaylistItemID != item?.ID))
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
return;

userLookupCache.GetUserAsync(e.UserID).ContinueWith(t =>
Expand Down Expand Up @@ -529,7 +536,8 @@
if (!this.IsCurrentScreen())
return;

if (playlistItem != null) Mods.Value = userMods.Value.Concat(playlistItem.RequiredMods.Select(m => m.ToMod(Ruleset.Value.CreateInstance()))).ToList();
var item = playlistItem;
if (item != null) Mods.Value = userMods.Value.Concat(item.RequiredMods.Select(m => m.ToMod(Ruleset.Value.CreateInstance()))).ToList();
}

private void startPlay()
Expand All @@ -556,9 +564,11 @@
if (!this.IsCurrentScreen())
return;

var item = playlistItem;

// We can only handle the current daily challenge beatmap.
// If the import was for a different beatmap, pass the duty off to global handling.
if (playlistItem?.Beatmap.BeatmapSet != null && beatmap.BeatmapSetInfo.OnlineID != playlistItem.Beatmap.BeatmapSet.OnlineID)
if (item?.Beatmap.BeatmapSet != null && beatmap.BeatmapSetInfo.OnlineID != item.Beatmap.BeatmapSet.OnlineID)
{
this.Exit();
game?.PresentBeatmap(beatmap.BeatmapSetInfo, b => b.ID == beatmap.BeatmapInfo.ID);
Expand Down
3 changes: 3 additions & 0 deletions osu.Game/Tests/Visual/OnlinePlay/TestRoomRequestsHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ private Room cloneRoom(Room source)
{
var result = new Room();
result.CopyFrom(source);
result.RoomID = source.RoomID;
result.StartDate = source.StartDate;
result.EndDate = source.EndDate;
result.Playlist = source.Playlist.Select(p => p.With()).ToList();
return result;
}
Expand Down
Loading