Merge pull request #15676 from peppy/multiplayer-incorrect-beatmap-error

Show better error message when selecting an unavailable beatmap during multiplayer room creation
This commit is contained in:
Dan Balasescu 2021-11-19 18:59:46 +09:00 committed by GitHub
commit d397524878
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -6,7 +6,7 @@ namespace osu.Game.Migrations
{
protected override void Up(MigrationBuilder migrationBuilder)
{
// There was a change that baetmaps were being loaded with "-1" online IDs, which is completely incorrect.
// There was a change that beatmaps were being loaded with "-1" online IDs, which is completely incorrect.
// This ensures there will not be unique key conflicts as a result of these incorrectly imported beatmaps.
migrationBuilder.Sql("UPDATE BeatmapSetInfo SET OnlineBeatmapSetID = null WHERE OnlineBeatmapSetID <= 0");
}

View File

@ -365,7 +365,19 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
{
Debug.Assert(applyingSettingsOperation != null);
ErrorText.Text = text;
// see https://github.com/ppy/osu-web/blob/2c97aaeb64fb4ed97c747d8383a35b30f57428c7/app/Models/Multiplayer/PlaylistItem.php#L48.
const string not_found_prefix = "beatmaps not found:";
if (text.StartsWith(not_found_prefix, StringComparison.Ordinal))
{
ErrorText.Text = "The selected beatmap is not available online.";
SelectedItem.Value.MarkInvalid();
}
else
{
ErrorText.Text = text;
}
ErrorText.FadeIn(50);
applyingSettingsOperation.Dispose();