1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 01:07:24 +08:00
Commit Graph

395 Commits

Author SHA1 Message Date
Dan Balasescu
f743a3647f Rename APIPlaylistItem -> MultiplayerPlaylistItem 2021-11-15 23:14:27 +09:00
Dan Balasescu
ce47f456ec Change API for retrieving playlist items on join 2021-11-13 04:42:14 +09:00
Dan Balasescu
dbc23e224f Fix further test failures 2021-11-13 03:34:45 +09:00
Dan Balasescu
07a7b4bcdc Merge branch 'master' into multi-queueing-modes 2021-11-11 22:19:30 +09:00
Dean Herbert
16418ac2ab Remove outdated comments 2021-11-11 14:02:12 +09:00
Dan Balasescu
1bc6a58528 Fix RoomUpdated() not invoked on item changes 2021-11-10 21:23:18 +09:00
Dan Balasescu
78793d8624 Update interface to remove items 2021-11-10 19:58:25 +09:00
smoogipoo
c716051530 Merge branch 'master' into multi-queueing-modes 2021-11-08 19:19:50 +09:00
Dean Herbert
0ecf5f201c Rename User to APIUser and move to correct namespace 2021-11-07 11:26:01 +09:00
smoogipoo
7bbb2a7a67 Fix post-merge issues 2021-11-05 15:57:32 +09:00
smoogipoo
e6deb0c873 Merge branch 'master' into multi-queueing-modes 2021-11-05 15:57:25 +09:00
Dean Herbert
0ab50f1cc9 Add inline comment explaining why we are manually populating beatmap.BeatmapSet 2021-11-04 13:45:59 +09:00
Dean Herbert
3453160a8b Change PlaylistItem.Beatmap to be an IBeatmapInfo 2021-11-04 13:16:56 +09:00
Dean Herbert
135df0e190 Avoid adding null users to RecentParticipants 2021-11-02 17:13:37 +09:00
Dean Herbert
b0bd39fc49 Fix multiplayer room participants display not updating as new users join/leave
Can add tests on request, but not sure the code around this area is here
to stay permanently. Should be pretty low risk.

- Closes https://github.com/ppy/osu/issues/14788.
2021-11-02 17:13:37 +09:00
smoogipoo
2408011c81 Don't replace identical playlist items 2021-10-29 16:44:51 +09:00
smoogipoo
42dfb341da Fix PlaylistItemChanged() not updating current item 2021-10-29 15:44:42 +09:00
smoogipoo
7d910ebb57 Add SignalR binding for PlaylistItemChanged 2021-10-22 22:37:08 +09:00
smoogipoo
76eff7f6b1 Fix incorrect indexing 2021-10-22 21:57:29 +09:00
smoogipoo
6775151c30 Add Expired bool to APIPlaylistItem 2021-10-22 21:36:36 +09:00
smoogipoo
ec02e16c81 Add playlist item change event 2021-10-22 20:53:45 +09:00
smoogipoo
db87e42d47 Remove beatmap/ruleset/etc from MultiplayerRoomSettings 2021-10-22 16:48:28 +09:00
smoogipoo
a1c9b56083 Rename modes 2021-10-22 12:55:37 +09:00
smoogipoo
f41cf822b0 Rename request 2021-10-21 17:02:11 +09:00
smoogipoo
691e414acb Add request to add a new playlist item 2021-10-20 21:08:58 +09:00
smoogipoo
67090fc598 Re-namespace enum 2021-10-20 20:52:16 +09:00
smoogipoo
599867a3b1 Add implementation to settings overlay 2021-10-20 20:29:06 +09:00
smoogipoo
0b8edb0812 Add english descriptions 2021-10-20 17:50:02 +09:00
smoogipoo
116ce09e49 Merge branch 'master' into multi-queueing-modes 2021-10-20 17:27:25 +09:00
smoogipoo
ea9c070e59 Add setting for queue mode 2021-10-20 14:51:59 +09:00
smoogipoo
6f89e30f56 Add QueueingMode to MultiplayerRoomSettings 2021-10-15 20:17:19 +09:00
smoogipoo
80dfd11c90 Remove unnecessary extra task
Further testing shows continuations also run before the .Wait() returns.
2021-10-15 13:28:02 +09:00
smoogipoo
e6ee360511 Fix intermittent multiplayer tests 2021-10-15 00:10:39 +09:00
smoogipoo
2784ba1423 Add queueing modes 2021-10-14 16:34:23 +09:00
Dean Herbert
e1ab3434ed Add ability to handle user join/leave/kick events in MultiplayerComposites 2021-08-25 14:37:14 +09:00
Dean Herbert
bc025efce5 Add commenting regarding workaround to avoid potential omission in the future 2021-08-19 17:42:44 +09:00
Dean Herbert
2b5a42e063 Add missing union specification for MatchUserRequest 2021-08-19 17:42:26 +09:00
Dean Herbert
f95c6f0de5 Switch multiplayer back to messagepack 2021-08-19 17:42:13 +09:00
Bartłomiej Dach
498462dfd0
Fix room null-check racing against async schedule 2021-08-14 17:44:41 +02:00
Dean Herbert
9b21ebd6d0 Add client side handling on incoming kick 2021-08-11 19:56:06 +09:00
Dean Herbert
d9a4f018e6 Add event flow for receiving kick commands 2021-08-11 19:56:06 +09:00
Dean Herbert
e8ad0fba75 Add required server methods for kicking users 2021-08-11 17:20:41 +09:00
Dean Herbert
2b9168157d Fix CurrentMatchPlayingItem not being reset on leaving a multiplayer room 2021-08-10 16:53:03 +09:00
Dean Herbert
ea6e441dec Simplify method of marking players as playing in test scenes 2021-08-09 19:21:22 +09:00
Dean Herbert
8dc167ac9a Set default MultiplayerRoomSettings type to something that isn't playlists 2021-08-06 18:56:01 +09:00
Dean Herbert
666007b2f9
Merge branch 'master' into multiplayer-team-vs-team-selection 2021-08-04 13:54:11 +09:00
Dean Herbert
401835a3d8 Add missing event glue 2021-08-04 13:13:47 +09:00
Dean Herbert
75426f84f1 Fire initial match user states in TestMultiplayerClient 2021-08-03 23:42:37 +09:00
Dean Herbert
b956d32587 Add the ability to change multiplayer game type 2021-08-03 23:42:37 +09:00
Dean Herbert
70da58323a Drop MatchRuleset terminology completely 2021-08-03 15:45:17 +09:00
Dean Herbert
66427127f0 Update naming in line with discussion 2021-08-03 15:09:03 +09:00
Dean Herbert
5ac3abac99 Add missing forceScheduled parameter 2021-08-03 14:53:04 +09:00
Dean Herbert
d93421b9b8 Expose a default TeamVs room state so it can be consumed by tests 2021-08-02 18:50:22 +09:00
Dean Herbert
c7274355a4 Remove abstract definitions from multiplayer states for now 2021-08-02 18:50:22 +09:00
Dean Herbert
617ff40de7 Add the ability to not use MessagePack when creating a HubConnector 2021-08-02 18:50:22 +09:00
Dean Herbert
4cf2c6188d Add union attributes for derived class deserialisation 2021-08-02 18:50:22 +09:00
Dean Herbert
ce92a47ec6 Add silly event handling hookups 2021-08-02 18:50:22 +09:00
Dean Herbert
359eb9c4ec Add new event flow for match ruleset state handling
I'm totally not happy with how this is done, but don't have the energy
to rewrite everything just now.
2021-08-02 18:50:22 +09:00
Dean Herbert
035dfd071f Add missing nullable specifications 2021-08-02 18:47:26 +09:00
Dean Herbert
d17b2b3268 Add boilerplate for server events 2021-08-02 18:47:26 +09:00
Dean Herbert
1d645d4ca9 Mark base classes non-abstract to fix messagepack serialisation 2021-08-02 18:47:26 +09:00
Dean Herbert
1c125eef12 Make Users an IList for more flexibility server-side 2021-08-02 18:47:26 +09:00
Dean Herbert
9d1e95caf0 Add flow for sending match ruleset specific messages to the server 2021-08-02 18:47:26 +09:00
Dean Herbert
e8338f2711 Add basic class structure for match rulesets and required state 2021-08-02 17:14:49 +09:00
smoogipoo
2eec524f27 Fix password not copied from multiplayer client 2021-07-19 20:20:08 +09:00
Dean Herbert
9f9d7f9125 Add remaining pieces of password flow (for osu-web join request) 2021-07-12 18:22:52 +09:00
Dean Herbert
08c40938db Add support for updating a room's password 2021-07-12 15:49:19 +09:00
Dean Herbert
5148069efe Update signatures in line with no-overload methods (unsupported by signalr) 2021-07-12 15:49:19 +09:00
Dean Herbert
2ca11d458a Add password to room settings and multiplayer lounge interface 2021-07-12 15:49:19 +09:00
Dean Herbert
9495f87f04 Remove redundant NotNull attributes in nullable classes 2021-06-17 16:07:32 +09:00
smoogipoo
d197a7f6f5 Rename multiplayer client classes 2021-05-20 15:39:45 +09:00
smoogipoo
5f94b3bdac Remove legacy playlist item ID handling 2021-05-18 21:03:59 +09:00
smoogipoo
f8f9cf9412 Merge branch 'fix-initial-playingusers' into multiplayer-spectator-screen 2021-04-22 23:25:25 +09:00
smoogipoo
f593d9e42c Fix playing users not being updated on room join 2021-04-22 23:23:43 +09:00
smoogipoo
56e1bffdfd Populate initial user states 2021-04-13 23:57:16 +09:00
smoogipoo
6eddc6c59e Enable spectating multiplayer matches 2021-04-09 21:03:50 +09:00
smoogipoo
2791d454d2 Don't send spectating user state yet 2021-04-07 22:21:22 +09:00
smoogipoo
6de91d7b6b Add spectate button + test 2021-04-06 21:37:27 +09:00
smoogipoo
d5ba77b2c2 Add spectating user state 2021-04-06 21:22:28 +09:00
Dean Herbert
b1cd01ceb8 Apply ConfigureAwait changes to game side 2021-03-08 14:36:35 +09:00
smoogipoo
7adb33f40e Fix beatmap getting nulled due to failing web request 2021-03-01 17:24:54 +09:00
smoogipoo
c0e0bd4f42 Add compatibility with old server build 2021-02-19 13:57:04 +09:00
smoogipoo
183a481a34 Refactor playlist update to remove .Contains() check 2021-02-19 13:32:32 +09:00
smoogipoo
56e9e10ff5 Make server authoritative in playlist item id 2021-02-18 15:30:31 +09:00
smoogipoo
70a995919c Update comments 2021-02-17 17:58:24 +09:00
smoogipoo
f61b8e6154 Change to long 2021-02-16 21:32:38 +09:00
smoogipoo
100097d78f Fix playlist not being handled correctly for non-joined cases 2021-02-16 21:32:35 +09:00
smoogipoo
3ff9e14e35 Make StatefulMultiplayerClient control current playlist item 2021-02-16 18:56:13 +09:00
Dean Herbert
9ad38ab20e Move HubClientConnector retrieval to IAPIProvider 2021-02-15 16:43:56 +09:00
Salman Ahmed
5fb99fdc52 Rename some members and extract connection closure to separate method 2021-02-11 10:49:16 +03:00
Salman Ahmed
0c5e66205b Merge branch 'master' into abstract-hub-connection 2021-02-11 02:14:22 +03:00
Dan Balasescu
92599aa02b
Merge branch 'master' into user-beatmap-downloading-states-2 2021-02-09 21:06:09 +09:00
Salman Ahmed
f04d6d5e5e Update hub clients with changes to connecotr 2021-02-09 08:02:32 +03:00
Salman Ahmed
71e564d399 Revert clients to be Components 2021-02-09 07:46:00 +03:00
Salman Ahmed
28b815ffe1 Clean up multiplayer client with new hub connector 2021-02-09 02:13:09 +03:00
smoogipoo
d8c53e34ae Fix missing using 2021-02-08 19:42:17 +09:00
Dean Herbert
5fbed05d04
Merge pull request #11551 from smoogipoo/fix-leave-room-race-2
Fix client potentially not leaving a room on exiting multiplayer
2021-02-08 19:23:14 +09:00
smoogipoo
6e34e7d750 Merge branch 'master' into user-beatmap-downloading-states-2 2021-02-08 19:08:53 +09:00
smoogipoo
fb8e31a303 Fix incorrect connection building due to bad merges 2021-02-08 17:52:03 +09:00
smoogipoo
da85fb372d Merge branch 'master' into fix-multiplayer-client-connection-reliability 2021-02-08 13:43:24 +09:00
Dean Herbert
9e9e382bee Merge branch 'master' into user-beatmap-downloading-states-2 2021-02-05 15:27:17 +09:00
Dean Herbert
c5fa818630 Actually handle case of failing to achieve lock on SemaphoreSlim 2021-02-05 14:08:13 +09:00
Dean Herbert
cd67fe1091 Merge branch 'master' into fix-multiplayer-client-connection-reliability 2021-02-05 14:04:57 +09:00
smoogipoo
2e85ce5b82 Rename UserMods -> Mods for MultiplayerRoomUser 2021-02-05 12:40:16 +09:00
smoogipoo
85e63afcb4 Rename Mods -> RequiredMods 2021-02-05 12:36:25 +09:00
smoogipoo
65d45ec74c Unschedule cancellation 2021-02-03 20:50:22 +09:00
smoogipoo
97247b7a67 Fix unset key 2021-02-01 19:59:18 +09:00
smoogipoo
9c4c47599f Merge branch 'master' into freemods 2021-02-01 19:28:10 +09:00
smoogipoo
89a42d60fb General cleanup 2021-02-01 18:50:32 +09:00
smoogipoo
f538963607 Extra mods -> user mods 2021-02-01 17:57:32 +09:00
smoogipoo
ac2a995041 Add user and panel states 2021-02-01 17:54:56 +09:00
Bartłomiej Dach
c3ba92f057 Set canceled result in scheduleAsync
Was holding up the task completion source, and in consequence,
potentially the entire task chain.
2021-01-30 16:13:50 +01:00
Bartłomiej Dach
9ab1ad25eb Merge branch 'master' into fix-leave-room-race-2 2021-01-30 13:41:04 +01:00
smoogipoo
ab9a3e6dd0 Pass allowed mods and consume on server callback 2021-01-29 18:21:22 +09:00
Dean Herbert
a61444690e Remove all usage of CatchUnobservedExceptions
This should no longer be required with the recent framework side change
that stops a game from crashing on unobserved exceptions
(https://github.com/ppy/osu-framework/pull/4171).
2021-01-29 16:32:29 +09:00
Bartłomiej Dach
386f9f7842 Fix typos in comments 2021-01-28 22:36:07 +01:00
Dean Herbert
90a82f986b Fallback to using json for signalr communication if JIT is unavailable 2021-01-28 16:20:19 +09:00
smoogipoo
c408b46a21 Add AllowedMods to MultiplayerRoomSettings model 2021-01-27 22:25:14 +09:00
Bartłomiej Dach
4d4d97661e Fix connection loop always getting a cancelled token 2021-01-26 21:26:50 +01:00
smoogipoo
248989b3eb wip 2021-01-27 01:20:50 +09:00
smoogipoo
085115cba5 Make threading even more thread safe 2021-01-26 22:49:01 +09:00
Dean Herbert
b573c96c07 Move disconnect logic inside connection loop to ensure previous connection is disposed 2021-01-26 18:59:42 +09:00
Dean Herbert
15885c17af Remove unused usings 2021-01-26 18:07:43 +09:00
Dean Herbert
20cfa991bf Switch clients to MessagePack mode 2021-01-26 17:41:21 +09:00
Dean Herbert
e4fc604163 Setup all multiplayer model classes for MessagePack support 2021-01-26 16:26:03 +09:00
smoogipoo
bb44fcfe31 Prevent some data races 2021-01-25 21:01:39 +09:00
smoogipoo
964976f604 Use a task chain and fix potential misordering of events 2021-01-25 21:01:39 +09:00
Dean Herbert
0f09a7feb9 Avoid semaphore potentially getting held forever 2021-01-25 17:17:04 +09:00
Dean Herbert
994fb2667d Call DisposeAsync instead of StopAsync 2021-01-25 17:11:04 +09:00
Dean Herbert
c05ae3497a Make connect/disconnect private 2021-01-25 17:02:24 +09:00
Dean Herbert
d24d236468 Make OperationCanceledException throwing behaviour consistent 2021-01-22 14:34:58 +09:00
Dean Herbert
9f89b4e6d7 Rewrite connection logic to better handle failure cases
The main goal here is to ensure the connection is built each connection
attempt. Previously, the access token would never be updated, leading to
outdated tokens failing repeatedly (in the connection retry loop) and
never being able to establish a new connection as a result.

Due to threading considerations, this isn't as simple as I would hope it
to be. I'm open to proposals as to a better way of handling this.

Also, keep in mind that this logic will need to be abstracted and
(re)used in `SpectatorClient` as well. I've intentionally not done that
yet until we agree that this is a good direction forward.
2021-01-22 14:25:23 +09:00
Dan Balasescu
76e1f6e57b
Fix locking on incorrect object
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
2021-01-21 12:45:44 +09:00
smoogipoo
6b139d4cf3 Reset task post-execution 2021-01-20 20:27:58 +09:00
smoogipoo
e005a1cc9f Remove unnecessary condition blocking the part 2021-01-20 20:16:34 +09:00
smoogipoo
5261c01849 Tie JoinRoom() and PartRoom() together 2021-01-20 19:43:42 +09:00
Salman Ahmed
88abee705b Add missing event mapping for user beatmap availability change 2021-01-18 10:49:02 +03:00
Bartłomiej Dach
eb53e32792 Use task completion source for room join flow
On Android, users were unable to join or create multiplayer rooms. The
root cause of that was that the both the wait and set of the
`ManualResetEvent` in `getRoomUsers` occurred on the same thread, which
created a chicken-and-egg situation - the set could not proceed until
the wait had actually completed.

Resolve by substituting the `ManualResetEvent` for a
`TaskCompletionSource` to achieve a promise-style task, which the
previous code was a crude approximation of anyway.

Closes #11385.
2021-01-17 14:40:22 +01:00
Dan Balasescu
67b5ebadf5
Merge branch 'master' into fix-is-connected-thread-safety 2021-01-15 12:56:21 +09:00
Salman Ahmed
560b1e970c
Merge branch 'master' into user-beatmap-downloading-states 2021-01-13 22:31:31 +03:00
Dean Herbert
7298adc9d9 Fix non-threadsafe usage of MultiplayerClient.IsConnected 2021-01-12 19:04:16 +09:00
Bartłomiej Dach
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
Salman Ahmed
90fb67b377 Update code in-line with decided direction 2021-01-11 20:52:24 +03:00
Dean Herbert
deb1ad7bca
Merge branch 'master' into disable-repeat-multi-actions 2021-01-04 23:38:29 +09:00
Salman Ahmed
839f5a7570 Ensure clients don't blow up when given user isn't in room 2021-01-03 18:36:37 +03:00
Salman Ahmed
152e9ecccf Make BeatmapAvailability class in-line with other online data structures 2021-01-03 18:36:05 +03:00
Salman Ahmed
dfa8be9173 Add beatmap availability change state & event methods 2021-01-03 05:48:49 +03:00
Salman Ahmed
09e5e2629a Add user beatmap availability property 2021-01-03 05:48:49 +03:00
Bartłomiej Dach
9ab1091281
Merge branch 'master' into fix-signalr-reconnect 2021-01-02 13:18:02 +01:00
Dean Herbert
72a6ca7755 Allow signalr to retry connecting when connection is closed without an exception 2021-01-02 16:47:00 +09:00