Commit Graph

22527 Commits

Author SHA1 Message Date
da9c23f347 Add beatmap availability tracker component for multiplayer 2021-01-17 00:01:11 +03:00
7ad8b167cc Add overridable method for checking local availability of current model 2021-01-17 00:01:11 +03:00
04d17aadfa Add overridable method for verifying models in database 2021-01-17 00:01:11 +03:00
d9034eab26 Make model manager in DownloadTrackingComposite protected 2021-01-16 22:54:54 +03:00
ed78be825f Fix editor timeline not snapping on non-precise wheel scroll
For wheel input with precision, we still prefer exact tracking for now.
May change this in the future based on feedback from mappers, but it
makes little sense to do non-snapped scrolling when input is coming from
a non-precise source.
2021-01-15 15:47:42 +09:00
40f020c683 Merge pull request #11494 from peppy/fix-beatmap-carousel-incorrect-sample
Fix the beatmap carousel playing the difficulty change sample on beatmap change
2021-01-15 14:47:00 +09:00
0a65ae8f1e Fix the beatmap carousel playing the difficulty change sample on beatmap change 2021-01-15 14:07:24 +09:00
67b5ebadf5 Merge branch 'master' into fix-is-connected-thread-safety 2021-01-15 12:56:21 +09:00
3e8732a59f Merge branch 'master' into fix-participants-list 2021-01-14 21:30:53 +09:00
063acefd5c Merge branch 'master' into fix-difficulty-calculation-deadlock 2021-01-14 20:32:43 +09:00
862cb1412c Merge pull request #11410 from frenzibyte/user-beatmap-downloading-states
Add change state methods for multiplayer user beatmap availability
2021-01-14 18:42:26 +09:00
8a0b975d71 Fix deadlock scenario when calculating fallback difficulty
The previous code would run a calcaulation for the beatmap's own ruleset
if the current one failed. While this does make sense, with the current
way we use this component (and the implementation flow) it is quite unsafe.

The to the call on `.Result` in the `catch` block, this would 100%
deadlock due to the thread concurrency of the `ThreadedTaskScheduler`
being 1. Even if the nested run could be run inline (it should be), the
task scheduler won't even get to the point of checking whether this is
feasible due to it being saturated by the already running task.

I'm not sure if we still need this fallback lookup logic. After removing
it, it's feasible that 0 stars will be returned during the scenario that
previously caused a deadlock, but I don't necessarily think this is
incorrect. There may be another reason for this needing to exist which
I'm not aware of (diffcalc?) but if that's the case we may want to move
the try-catch handling to the point of usage.

To reproduce the deadlock scenario with 100% success (the repro
instructions in the linked issue aren't that simple and require some
patience and good timing), the main portion of the lookup can be changed
to randomly trigger a nested lookup:

```
if (RNG.NextSingle() > 0.5f)
    return GetAsync(new
DifficultyCacheLookup(key.Beatmap, key.Beatmap.Ruleset,
key.OrderedMods)).Result;
else
    return new StarDifficulty(attributes);
```

After switching beatmap once or twice, pausing debug and viewing the
state of threads should show exactly what is going on.
2021-01-14 18:25:34 +09:00
6eca8eac65 Merge pull request #11479 from smoogipoo/fix-judgement-1-frame-issue
Fix default judgement text mispositioned for one frame
2021-01-14 13:14:50 +09:00
d5878db615 Fix default judgement text mispositioned for one frame 2021-01-14 12:33:33 +09:00
95acc457aa Fix stupid mistake
fuck.
2021-01-13 22:35:21 +03:00
560b1e970c Merge branch 'master' into user-beatmap-downloading-states 2021-01-13 22:31:31 +03:00
1f12b2bd09 Rename download state Downloaded to Importing 2021-01-13 18:04:53 +03:00
2d3cacca11 Fix non-hosts crashing on load requested
`onLoadRequested()` always released the `readyClickOperation` ongoing
operation, without checking whether it actually needs to/should (it
should only do so if the action initiating the operation was starting
the game by the host). This would crash all other consumers, who already
released the operation when their ready-up operation completed server
side.

To resolve, relax the constraint such that the operation can be ended
multiple times in any order. At the end of the day the thing that
matters is that the operation is done and the ready button is unblocked.
2021-01-13 00:58:53 +01:00
7298adc9d9 Fix non-threadsafe usage of MultiplayerClient.IsConnected 2021-01-12 19:04:16 +09:00
b51b07c3a9 Fix unstable multiplayer room ordering when selection is made 2021-01-12 18:05:29 +09:00
9a22df2b88 Fix BPM multiplier not working in all cases 2021-01-12 17:50:22 +09:00
422260797b Revert polling changes to fix participant list display
It turns out this polling was necessary to get extra data that isn't
included in the main listing request. It was removed deemed useless, and
in order to fix the order of rooms changing when selecting a room.
Weirdly, I can't reproduce this happening any more, and on close
inspection of the code can't see how it could happen in the first place.

For now, let's revert this change and iterate from there, if/when the
same issue arises again.

I've discussed avoiding this second poll by potentially including more
data (just `user_id`s?) in the main listing request, but not 100% sure
on this - even if the returned data is minimal it's an extra join
server-side, which could cause performance issues for large numbers of
rooms.
2021-01-12 17:26:00 +09:00
0d5fbb15ac Fix up code comments
Default value restated in xmldoc was snipped because it's made redundant
by the initialiser and possibly bound to be outdated at some point.
2021-01-11 20:31:52 +01:00
90fb67b377 Update code in-line with decided direction 2021-01-11 20:52:24 +03:00
dd809df076 Merge pull request #11118 from MiraiSubject/tourney-switching-ui
Add the ability to switch tournaments to the SetupScreen
2021-01-11 16:36:45 +09:00
2286e3679f Downloaded -> Importing 2021-01-11 08:21:07 +03:00
a8dfa5e2a9 Rename typo'd method 2021-01-11 08:04:00 +03:00
e99310b59c Add JsonConstructor attribute 2021-01-11 08:02:57 +03:00
d2ca6da0fd Remove unused constant 2021-01-11 01:56:09 +09:00
bd37723788 Expose as IBindable for added safety 2021-01-11 01:55:54 +09:00
e4eb44df6e Merge branch 'master' into fix-play-button-crashes 2021-01-11 01:46:41 +09:00
959696c296 Merge branch 'master' into tourney-switching-ui 2021-01-10 17:34:03 +01:00
e5c670f843 Merge branch 'master' into tourney-switching-ui 2021-01-10 17:33:52 +01:00
d110ed9e95 Merge branch 'master' into fix-mod-buttons-not-copying-settings 2021-01-10 15:42:33 +01:00
4b4adc927c Rename param to match method body 2021-01-10 15:35:53 +01:00
4e32b0d6de Merge branch 'master' into ongoing-operation-tracker-safety 2021-01-10 23:05:03 +09:00
95ad324a39 Merge branch 'master' into fix-mod-buttons-not-copying-settings 2021-01-10 23:01:54 +09:00
e81f9e358e Merge pull request #11448 from bdach/fix-editor-enter-crash
Fix editor crashing on enter if login overlay was previously opened
2021-01-10 12:59:47 +09:00
8c3955d341 Improve safety of ongoing operation tracker
Finishing an operation started via
`OngoingOperationTracker.BeginOperation()` was risky in cases where the
operation ended at a callback on another thread (which, in the case of
multiplayer, is *most* cases). In particular, if any consumer registered
a callback that mutates transforms when the operation ends, it would
result in crashes after the framework-side safety checks.

Rework `OngoingOperationTracker` into an always-present component
residing in the drawable hierarchy, and ensure that the
`operationInProgress` bindable is always updated on the update thread.
This way consumers don't have to add local schedules in multiple places.
2021-01-09 22:45:24 +01:00
b69fe8a274 Merge branch 'master' into disable-repeat-multi-actions 2021-01-09 10:15:20 +09:00
0aad0c7c6c Target logic at this and adjust variables 2021-01-09 00:31:18 +03:00
ff60d652ed Move out test ongoing operation tracker to higher level 2021-01-08 22:28:21 +01:00
375ecf92ed Merge remote-tracking branch 'upstream/master' into fix-mod-buttons-not-copying-settings 2021-01-09 00:26:18 +03:00
c2eeb822b8 Rename {joiningRoom -> operationInProgress} 2021-01-08 22:23:38 +01:00
dad5dd3667 Remove unnecessary permissiveness wrt null 2021-01-08 22:21:54 +01:00
284d30d336 Move screen activity update to LoadComplete()
Fixes a potential crash when moving from main menu to editor after
having previously opened the login settings overlay. Setting the
activity in BDL as done before is unsafe, as that set can trigger value
change callbacks, which in turn can trigger adding transforms, which
should always be done on the update thread.

Semantically it also makes sense, as the user activity should change
once the screen they're moving to has actually loaded and displayed to
the user.
2021-01-08 21:18:15 +01:00
274a045d8d Remove Dispose() override
Culls another non-thread-safe mutation of the `Playing` bindable.
It seems to be a weird vestige from an earlier revision of the old
"direct" panel, which relied on `DisposeOnDeathRemoval` to finish track
playback (and then was removed in
6c150c9ed7). The play button is no longer
responsible for managing preview track lifetime anyway;
`PreviewTrackManager`'s method are intended for that.
2021-01-08 20:08:19 +01:00
52789118a3 Schedule play button state update
Revealed by the framework-side transform thread safety checks. `Stopped`
is even annotated as not being thread-safe (but was annotated as such
long after the class's nascence).
2021-01-08 20:08:19 +01:00
8a7a1fc40a Merge pull request #11439 from peppy/improve-hover-sounds-debounce
Improve hover sounds playback (to reduce volume saturation and delay)
2021-01-09 02:31:02 +09:00
49c6abcb5c Remove mention of default value in xmldoc
Just bound to get outdated with every change anyway. Look at the actual
default value declaration to see what the default is.
2021-01-08 18:26:41 +01:00