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

3014 Commits

Author SHA1 Message Date
Dean Herbert
4248593289
Fix menu banner not updating as often as we want it to 2024-01-31 22:44:24 +09:00
Dean Herbert
19fe3a15f3
Merge branch 'master' into 2fa-not-verifying-via-link 2024-01-31 18:32:55 +09:00
Bartłomiej Dach
4126dcbe28
Fix 2FA verification via link not working correctly
Closes https://github.com/ppy/osu/issues/26835.

I must have not re-tested this correctly after all the refactors...

Basically the issue is that the websocket connection would only come
online when the API state changed to full `Online`. In particular
the connector would not attempt to connect when the API state was
`RequiresSecondFactorAuth`, giving the link-based flow no chance to
actually work.

The change in `WebSocketNotificationsClientConnector` is relevant in
that queueing requests does nothing before the API state changes to full
`Online`. It also cleans up things a bit code-wise so... win?

And yes, this means that the _other_ `PersistentEndpointClientConnector`
implementations (i.e. SignalR connectors) will also come online earlier
after this. Based on previous discussions
(https://github.com/ppy/osu/pull/25480#discussion_r1395566545) I think
this is fine, but if it is _not_ fine, then it can be fixed by exposing
a virtual that lets a connector to decide when to come alive, I guess.
2024-01-30 21:49:06 +01:00
Bartłomiej Dach
000ddc14ac
Fix broken locking in OAuth
Closes https://github.com/ppy/osu/issues/26824... I think?

Can be reproduced via something like

diff --git a/osu.Game/Online/API/OAuth.cs b/osu.Game/Online/API/OAuth.cs
index 485274f349..e6e93ab4c7 100644
--- a/osu.Game/Online/API/OAuth.cs
+++ b/osu.Game/Online/API/OAuth.cs
@@ -151,6 +151,11 @@ internal string RequestAccessToken()
         {
             if (!ensureAccessToken()) return null;

+            for (int i = 0; i < 10000; ++i)
+            {
+                _ = Token.Value.AccessToken;
+            }
+
             return Token.Value.AccessToken;
         }

The cause is `SecondFactorAuthForm` calling `Logout()`, which calls
`OAuth.Clear()`, _while_ the `APIAccess` connect loop is checking if
`authentication.HasValidAccessToken` is true, which happens to
internally check `Token.Value.AccessToken`, which the clearing of
tokens can brutally interrupt.
2024-01-30 21:05:23 +01:00
Dean Herbert
d895a91cd5
Update endpoints to final production endpoints 2024-01-30 18:40:17 +09:00
Bartłomiej Dach
996ae0ecc1
Fix incorrect handling of StartChatRequest in websocket chat client
Fixes this happening on staging:

	[network] 2024-01-29 17:48:24 [verbose]: WebSocketNotificationsClientConnector connected!
	[network] 2024-01-29 17:48:24 [verbose]: WebSocketNotificationsClientConnector connect attempt failed: Can't use WaitSafely from inside an async operation.

I'm not sure how I ever allowed that `.WaitSafely()` to be there. It
did feel rather dangerous but then I must have forgotten and never
noticed it failing. Which is weird because you'd think that would be
caught by testing that chat isn't working but I'm pretty sure that I
tested that chat *was* indeed working.

Anyway now that entire flow is replaced by something that should
hopefully be somewhat more sane? It has a whole retry flow with logging
now which should be more robust than what was there previously (failing
to start to listen to chat events killing the entire websocket
connection for very little good reason).
2024-01-29 19:22:40 +01:00
Dean Herbert
6a469f2cb6
Use switch instead of if-else 2024-01-29 17:18:17 +09:00
Bartłomiej Dach
96811a8874
Fix APIAccess spamming requests while waiting for second factor 2024-01-29 09:14:30 +01:00
Bartłomiej Dach
363fd1d54f
Remove no longer relevant changes 2024-01-29 09:05:03 +01:00
Dean Herbert
4a2602a775
Merge branch 'master' into 2fa 2024-01-29 16:57:29 +09:00
Dean Herbert
ef94eff574
Rename PollingChatClientConnector to better describe usage 2024-01-29 16:56:28 +09:00
Bartłomiej Dach
a2e69d37e8
Add basic testing of failure flow 2024-01-26 11:17:32 +01:00
Bartłomiej Dach
04cae874b0
Handle forced logouts due to password change too 2024-01-26 10:53:27 +01:00
Bartłomiej Dach
3d3506b906
Merge branch 'decouple-notification-websocket-from-chat' into 2fa 2024-01-25 14:51:42 +01:00
Bartłomiej Dach
c463aa5ba1
xmldoc everything 2024-01-25 14:47:29 +01:00
Bartłomiej Dach
de52f0a80c
Decouple notifications websocket handling from chat operations
This is a prerequisite for https://github.com/ppy/osu/pull/25480.

The `WebSocketNotificationsClient` was tightly coupled to chat specifics
making it difficult to use in the second factor verification flow.
This commit's goal is to separate the websocket connection and message
handling concerns from specific chat logic concerns.
2024-01-25 14:47:29 +01:00
Bartłomiej Dach
e3eb7a8b42
Support verification via clicking link from e-mail 2024-01-24 21:35:58 +01:00
Bartłomiej Dach
62a0c236bc
Split out raw websocket logic from conjoined notifications client contrivance 2024-01-24 21:35:30 +01:00
Bartłomiej Dach
445a7450e0
Implement verification from within client 2024-01-24 21:35:20 +01:00
Bartłomiej Dach
ddc2bbeb9b
Add session_verified attribute to /me response 2024-01-24 14:24:33 +01:00
Bartłomiej Dach
7b47215657
Split /me request from /users requests
Them being together always bothered me and led to the abject failure
that is `APIUser` and its sprawl. Now that I'm about to add a flag that
is unique to `/me` for verification purposes, I'm not repeating the
errors of the past by adding yet another flag to `APIUser` that is never
present outside of a single usage context.
2024-01-24 14:22:57 +01:00
Bartłomiej Dach
7c140408ea
Add request structures for verification endpoints 2024-01-24 13:53:40 +01:00
Bartłomiej Dach
2cfaa1c103
Merge branch 'master' into 2fa 2024-01-23 16:51:23 +01:00
Dean Herbert
069af13aaf
Reduce enumerator overhead in GameplayLeaderboard 2024-01-23 05:31:53 +09:00
Joseph Madamba
3eeefd5b7e Fix changelog stream user count only accounting for latest build 2024-01-18 16:15:52 -08:00
Andrei Zavatski
dfdf700560 Don't use glowing text in ScoreComponentLabel 2024-01-16 17:43:17 +03:00
Dean Herbert
ee26329353
Fix some elements not showing on leaderboard scores when almost off-screen 2024-01-16 16:44:50 +09:00
Dean Herbert
a3b63391fa
Merge pull request #26356 from stanriders/global-user-statistics
Add `Statistics` bindable to `IAPIProvider` and update it from `SoloStatisticsWatcher`
2024-01-15 18:43:35 +09:00
Dean Herbert
d3710f0bfd
Remove scores from song select leaderboard when leaving the screen 2024-01-06 20:53:20 +09:00
wooster0
cf5f0a2bdc Make chat commands case-insensitive
Would be nice if I accidentally have caps lock enabled and write "/HELP" it still works.
2024-01-04 15:06:10 +09:00
StanR
e240443c46 Update LocalUser statistics, add test 2024-01-03 18:15:32 +06:00
StanR
d34f30f6ad Add Statistics bindable to IAPIProvider and update it from SoloStatisticsWatcher 2024-01-03 14:37:57 +06:00
Bartłomiej Dach
09b2a4e3b4
Fix users blipping online briefly before their online status is known 2024-01-02 14:07:59 +01:00
Bartłomiej Dach
f9f03ebc0f
Store user online state in config for next launch
Closes remainder of https://github.com/ppy/osu/issues/12635.
2024-01-02 14:04:40 +01:00
Dean Herbert
93a8afe96e
Add very simple cache-busting (30 minutes) 2023-12-28 14:40:10 +09:00
Bartłomiej Dach
ef39759813
More code quality inspections 2023-12-28 00:18:20 +01:00
Bartłomiej Dach
ac449131ed
CodeFileSanity does not like records in standalone files 2023-12-27 23:47:37 +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
Dean Herbert
5284b95bb8
Schedule even more 2023-12-20 19:42:05 +09:00
Dean Herbert
856c59f7f7
Fix thread safety of OnlineMetadataClient.UserStates
Closes https://github.com/ppy/osu-framework/issues/6081.
2023-12-20 14:15:00 +09:00
Dan Balasescu
0171078052
Move object counts to BeatmapInfo 2023-12-13 17:33:24 +09:00
Dean Herbert
fdcf87569c
Merge pull request #25711 from smoogipoo/mania-convert-song-select-keycount
Display osu!mania keycount in song select carousel panels and details
2023-12-13 16:31:25 +09:00
Dan Balasescu
2abf3a55ae
Add IsLegacyScore to SoloScoreInfo 2023-12-13 16:12:12 +09:00
Dan Balasescu
767d5c8018
Add object counts to IBeatmapDifficultyInfo 2023-12-09 22:31:51 +09:00
Bartłomiej Dach
41c33f74f2
Extend metadata client with user presence-observing capabilities 2023-12-06 19:37:35 +01:00
Bartłomiej Dach
d66fa09320
Simplify UserStatus to be an enumeration type
There were absolutely no gains from having it be a reference type /
class, only complications, especially when coming from the serialisation
angle.
2023-12-06 18:52:27 +01:00
Bartłomiej Dach
cb823f367f
Simplify UserActivity for serialisability over the wire
Up until now, the `UserActivity` class hierarchy contained things like
beatmap info, room info, full replay info, etc. While this was
convenient, it is soon going to be less so, as the data is sent over the
wire to the spectator server so that the user's activity can be
broadcast to other clients.

To counteract this without creating a second separate and slimmed-down
class hierarchy, slim down the `UserActivity` structure to contain the
bare minimum amounts of data such that the structures aren't overly
large and complex to serialise, but also contain enough data that they
can be used by receiving clients directly without having to do beatmap
or score lookups.
2023-12-06 18:52:26 +01:00
POeticPotatoes
07f9f5c6d8 Remove hover checks for mod-copying menu item 2023-12-06 06:33:25 +08:00
Dean Herbert
5a2240838b
Merge branch 'master' into multiplayer-abort 2023-12-05 17:01:54 +09:00