1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 05:27:23 +08:00
Commit Graph

14024 Commits

Author SHA1 Message Date
Bartłomiej Dach
04147eb689
Fix lack of correct default value spec 2024-01-03 11:46:28 +01:00
Bartłomiej Dach
e686a6a1dd
Fix player submission test intermittent failures due to audio playback discrepancy logic kicking in
See https://github.com/ppy/osu/actions/runs/7384457927/job/20087439457#step:5:133.
2024-01-03 09:17:01 +01:00
Dean Herbert
bdfaa4b583
Fix crash when dragging rotation control in editor with both mouse buttons
Closes https://github.com/ppy/osu/issues/26325.
2024-01-03 13:34:50 +09:00
Dean Herbert
e4ba7b81b0
Merge pull request #26343 from adryzz/fix-discord-multiplayer-presence
update the current activity when the multiplayer room updates
2024-01-03 13:10:56 +09:00
Lena
17656e9b9c
update the current activity when the multiplayer room updates 2024-01-02 18:38:25 +01:00
Bartłomiej Dach
3c5e9ac9a9
Fix possible double score submission when auto-retrying via perfect mod
Closes https://github.com/ppy/osu/issues/26035.

`submitOnFailOrQuit()`, as the name suggests, can be called both when
the player has failed, or when the player screen is being exited from.
Notably, when perfect mod with auto-retry is active, the two happen
almost simultaneously.

This double call exposes a data race in `submitScore()` concerning the
handling of `scoreSubmissionSource`. The race could be experimentally
confirmed by applying the following patch:

diff --git a/osu.Game/Screens/Play/SubmittingPlayer.cs b/osu.Game/Screens/Play/SubmittingPlayer.cs
index 83adf1f960..76dd29bbdb 100644
--- a/osu.Game/Screens/Play/SubmittingPlayer.cs
+++ b/osu.Game/Screens/Play/SubmittingPlayer.cs
@@ -228,6 +228,7 @@ private Task submitScore(Score score)
                 return Task.CompletedTask;
             }

+            Logger.Log($"{nameof(scoreSubmissionSource)} is {(scoreSubmissionSource == null ? "null" : "not null")}");
             if (scoreSubmissionSource != null)
                 return scoreSubmissionSource.Task;

@@ -237,6 +238,7 @@ private Task submitScore(Score score)

             Logger.Log($"Beginning score submission (token:{token.Value})...");

+            Logger.Log($"creating new {nameof(scoreSubmissionSource)}");
             scoreSubmissionSource = new TaskCompletionSource<bool>();
             var request = CreateSubmissionRequest(score, token.Value);

which would result in the following log output:

	[runtime] 2024-01-02 09:54:13 [verbose]: scoreSubmissionSource is null
	[runtime] 2024-01-02 09:54:13 [verbose]: scoreSubmissionSource is null
	[runtime] 2024-01-02 09:54:13 [verbose]: Beginning score submission (token:36780)...
	[runtime] 2024-01-02 09:54:13 [verbose]: creating new scoreSubmissionSource
	[runtime] 2024-01-02 09:54:13 [verbose]: Beginning score submission (token:36780)...
	[runtime] 2024-01-02 09:54:13 [verbose]: creating new scoreSubmissionSource
	[network] 2024-01-02 09:54:13 [verbose]: Performing request osu.Game.Online.Solo.SubmitSoloScoreRequest
	[network] 2024-01-02 09:54:14 [verbose]: Request to https://dev.ppy.sh/api/v2/beatmaps/869310/solo/scores/36780 successfully completed!
	[network] 2024-01-02 09:54:14 [verbose]: SubmitSoloScoreRequest finished with response size of 639 bytes
	[network] 2024-01-02 09:54:14 [verbose]: Performing request osu.Game.Online.Solo.SubmitSoloScoreRequest
	[runtime] 2024-01-02 09:54:14 [verbose]: Score submission completed! (token:36780 id:20247)
	[network] 2024-01-02 09:54:14 [verbose]: Request to https://dev.ppy.sh/api/v2/beatmaps/869310/solo/scores/36780 successfully completed!
	[network] 2024-01-02 09:54:14 [verbose]: SubmitSoloScoreRequest finished with response size of 639 bytes
	[runtime] 2024-01-02 09:54:14 [error]: An unhandled error has occurred.
	[runtime] 2024-01-02 09:54:14 [error]: System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
	[runtime] 2024-01-02 09:54:14 [error]: at osu.Game.Screens.Play.SubmittingPlayer.<>c__DisplayClass30_0.<submitScore>b__0(MultiplayerScore s) in /home/dachb/Documents/opensource/osu/osu.Game/Screens/Play/SubmittingPlayer.cs:line 250

The intention of the submission logic was to only ever create one
`scoreSubmissionSource`, and then reuse this one if a redundant
submission request was made. However, because of the temporal proximity
of fail and quit in this particular case, combined with the fact that
the calls to `submitScore()` are taking place on TPL threads, means that
there is a read-write data race on `scoreSubmissionSource`, wherein the
source can be actually created twice.

This leads to two concurrent score submission requests, which, upon
completion, attempt to transition only _the second_
`scoreSubmissionSource` to a final state (this is because the API
success/failure request callbacks capture `this`, i.e. the entire
`SubmittingPlayer` instance, rather than the `scoreSubmissionSource`
reference specifically).

To fix, ensure correct synchronisation on the read-write critical
section, which should prevent the `scoreSubmissionSource` from being
created multiple times.
2024-01-02 10:55:52 +01:00
iilwy
fbedcb29e4
Merge branch 'master' into fix-precision 2024-01-01 10:42:15 -06:00
iminlikewithyou
5ae5d7f92d change floor to round 2023-12-30 23:59:47 -06:00
iminlikewithyou
45f6c78314 Merge branch 'master' of https://github.com/ppy/osu into menu-button-tweaks 2023-12-30 12:58:10 -06:00
iminlikewithyou
452f201f06 use margins isntead of moving the position of the sprite 2023-12-30 12:56:38 -06:00
Dean Herbert
61c46b78bd
Update MenuTip.cs
Co-authored-by: Salman Ahmed <frenzibyte@gmail.com>
2023-12-29 22:24:16 +09:00
Dean Herbert
9f0fe6c6ca
Fix common typos
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
2023-12-29 22:20:29 +09:00
Dean Herbert
d00b7c9cdf
Add some new menu tips (and reword some others) 2023-12-29 22:14:51 +09:00
Dean Herbert
2b81f4f557
Merge pull request #26221 from bdach/system-title-only-on-top-level-menu
Do not display system title in inital menu state
2023-12-29 21:13:40 +09:00
Bartłomiej Dach
db78d73fa5
Do not display system title in inital menu state
Addresses https://github.com/ppy/osu/discussions/26199.
2023-12-29 11:50:30 +01:00
Bartłomiej Dach
99cddb6317
Use alternative workaround 2023-12-29 11:07:45 +01:00
Bartłomiej Dach
cd1f6b46c4
Fix crash after changing audio track in editor
Closes https://github.com/ppy/osu/issues/26213.

Reproduction scenario: switch audio track in editor after timeline
loads.

Happens because `beatmap.Value.Track.Length` is 0 immediately after a
track switch, until BASS computes the actual track length on the audio
thread.

Yes this is a hack. No I have no better immediate ideas how to address
this otherwise.
2023-12-29 10:37:36 +01:00
Nitrous
c68a850325
Make menu tip about mod select more up to date. 2023-12-29 08:51:54 +08:00
iminlikewithyou
51d26d2d71 make the hover scale bigger
as a consequence, the rotation needs to be tweaked to be lower
2023-12-28 17:20:44 -06:00
iminlikewithyou
f1f1221e0e move text left to be visually centered in the skewed rectangle 2023-12-28 17:18:41 -06:00
iminlikewithyou
4760c6aaee move icon upwards to be visually centered 2023-12-28 17:17:24 -06:00
iminlikewithyou
637119f7d4 increase the base size of button icons 2023-12-28 17:15:23 -06:00
Bartłomiej Dach
7a10e132ea
Fix crash when retrieval of system title image fails
Closes https://github.com/ppy/osu/issues/26194.
2023-12-28 20:39:13 +01:00
Bartłomiej Dach
6d124513e7
Fix test failures due to player bailing early after failing to load beatmap 2023-12-28 14:15:15 +01:00
Bartłomiej Dach
619b0cc69b
Fix code quality inspection 2023-12-28 14:12:28 +01:00
Bartłomiej Dach
24a80da83f
Merge branch 'master' into universal-offset-from-session-plays 2023-12-28 14:07:46 +01:00
Dean Herbert
e1a376c0a7
Fix using "Back" binding at spectator fail screen not working 2023-12-28 20:14:18 +09:00
Bartłomiej Dach
0fc86a07cb
Merge pull request #26177 from peppy/fix-leaderboard-tab-ordering
Fix song select leaderboard tab ordering not matching stable
2023-12-28 12:02:46 +01:00
Dean Herbert
b7f3c83514
Expose the ability to update global offset from the player loader screen 2023-12-28 20:01:34 +09:00
Dean Herbert
bd0e2b4dde
Remove disclaimer screen completely 2023-12-28 17:21:29 +09:00
Dean Herbert
7dc50b9baf
Don't dismiss on hover, and allow dismissing via click 2023-12-28 17:20:01 +09:00
Dean Herbert
1f2339244e
Add supporter display to main menu 2023-12-28 17:20:01 +09:00
Dean Herbert
b19f72481b
Fade out quickly on game exit sequence 2023-12-28 17:19:41 +09:00
Dean Herbert
0ad6ac8b2a
Remove unused variable 2023-12-28 16:48:17 +09:00
Dean Herbert
932d03a4f8
Make toggle more immediately hide/show tips 2023-12-28 16:21:19 +09:00
Dean Herbert
222459d921
Add background and improve layout 2023-12-28 16:16:27 +09:00
Dean Herbert
a1867afbb4
Move menu tips to main menu
In preparation for removing the disclaimer screen.
2023-12-28 16:06:08 +09:00
Dean Herbert
6684987289
Reduce refresh interval slightly 2023-12-28 15:19:09 +09:00
Dean Herbert
0ea62d0c5d
Add initial additive blending on fade in 2023-12-28 15:16:42 +09:00
Dean Herbert
972234b1e5
Move re-schedule inside continuation 2023-12-28 15:12:44 +09:00
Dean Herbert
481a251786
Use HandleLink to allow potentially opening wiki or otherwise 2023-12-28 15:11:02 +09:00
Dean Herbert
289e0f00f9
Add flash on click 2023-12-28 15:10:47 +09:00
Dean Herbert
c70e7d340d
Adjust animation and add delay to URL open 2023-12-28 15:10:47 +09:00
Dean Herbert
ffc8778d67
Fix song select leaderboard tab ordering not matching stable 2023-12-28 14:13:35 +09:00
Bartłomiej Dach
ef39759813
More code quality inspections 2023-12-28 00:18:20 +01:00
Bartłomiej Dach
a3f720bc62
Retrieve system title from online source 2023-12-27 23:37:39 +01:00
Bartłomiej Dach
d9299a8a55
Implement visual appearance of "system title" message in main menu 2023-12-27 23:07:17 +01:00
Bartłomiej Dach
1b7af989ec
Migrate BeatmapOffsetControl to use session static directly 2023-12-27 19:19:27 +01:00
Bartłomiej Dach
d4423d4933
Store last set score to a SessionStatic 2023-12-27 19:13:42 +01:00
Bartłomiej Dach
53766285ce
Remove remaining hexacons usages 2023-12-27 17:42:18 +01:00