1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-30 21:47:25 +08:00
Commit Graph

1010 Commits

Author SHA1 Message Date
Salman Ahmed
b42f49aeaa Handle APIException from user request during logging in 2022-07-16 00:38:53 +03:00
Dean Herbert
c8c79d2185 Standardise HasReplay implementation (and remove from persisting to realm) 2022-07-15 16:14:21 +09:00
Dean Herbert
688fcb256f Update score retrieval endpoint to access new storage 2022-07-15 15:47:25 +09:00
Dean Herbert
966882013d Remove classic mod attribution to SoloScoreInfo conversion path 2022-07-15 15:47:05 +09:00
Dean Herbert
0fe3bac173 Store mods to array and update test scenes 2022-07-12 18:00:25 +09:00
Dean Herbert
12a56e36bd Fix ID mapping and move osu-web additions to region to identify them clearly 2022-07-12 18:00:25 +09:00
Dean Herbert
f956955d4d Combine ScoreInfo construction helper methods 2022-07-12 18:00:25 +09:00
Dean Herbert
900e0ace8e Standardise naming and enable NRT 2022-07-12 18:00:25 +09:00
Dean Herbert
1bef2d7b39 Add and consume SoloScoreInfo 2022-07-12 18:00:25 +09:00
andy840119
48047f2e58 Move the null check in the outside.
AddCursor() should not accept the null value.
2022-06-30 23:29:49 +08:00
Dean Herbert
569fde4b47 Add messages to all InvalidOperationExceptions
Without this, they can be very non-descript and hard to track down
2022-06-28 01:34:25 +09:00
Dan Balasescu
b13fa924fd
Merge pull request #18865 from peppy/fix-flaky-chat-test
Fix chat tests failing 1/10000 runs
2022-06-27 18:06:00 +09:00
Dean Herbert
13dcaf82ad Fix chat tests failing 1/10000 runs
31a447fda0/osu.Game/Online/Chat/ChannelManager.cs (L412-L414)

Sigh.
2022-06-27 16:50:10 +09:00
Dan Balasescu
f6a6538e96 Add more properties to IBeatmapOnlineInfo 2022-06-27 16:07:15 +09:00
Bartłomiej Dach
26c5b59f6d
Replace usages of string.To{Lower,Upper}() 2022-06-24 11:57:45 +02:00
Dan Balasescu
f8830c6850 Automated #nullable processing 2022-06-17 16:37:17 +09:00
Dean Herbert
eb2d822530 Fix web requests potentially being performed after cancelled
Closes https://github.com/ppy/osu/issues/18524.
2022-06-03 16:04:52 +09:00
Dean Herbert
c18dd8c8fb Ensure Queue operations on DummyAPIAccess are performed on the update thread 2022-05-30 16:32:44 +09:00
Dean Herbert
a2a057440e Fail requests taretting the fake API with a more deliberate exception
I think this feels better than relying on some other method to throw an
exception.
2022-05-30 16:31:54 +09:00
Salman Ahmed
d5027cdfbd Add FeaturedInSpotlight property to API beatmapsets 2022-05-14 19:46:13 +03:00
Dean Herbert
319867f73c Mark GuestUser as system user via Id for now
Should resolve https://github.com/ppy/osu/issues/18105.

Checking through usages, it doesn't immediately look like this will
regress any other scenarios.
2022-05-06 17:37:46 +09:00
Salman Ahmed
a9ea0ab91b Add support for fetching user guest participations 2022-04-22 07:55:39 +03:00
Joseph Madamba
5e5c8e78a6 Use existing web localisation for most hardcoded strings 2022-04-20 16:31:11 -07:00
Salman Ahmed
c858ec2483 Pagination -> `PaginationParameters 2022-04-19 02:48:34 +03:00
Salman Ahmed
96d4369cc8 Introduce Pagination and simplify paginated API requests 2022-04-19 02:04:23 +03:00
Salman Ahmed
9d59cd408f Add concept of "initial items count" in paginated API requests 2022-04-18 22:59:49 +03:00
Dean Herbert
a0692ce477 Add a const for system users which should never display a profile 2022-03-28 22:22:56 +09:00
Dean Herbert
1814a325d8 Move GetSettingUnderlyingValue to a SettingSource extension method 2022-03-15 14:54:00 +09:00
Dan Balasescu
c61397cc22 Fix whitespace/inspection 2022-03-10 16:22:27 +09:00
Dean Herbert
0267aed846 Change ToMod to return an UnknownMod rather than throw if a mod isn't available
As seen by this kind of crash, having the `.ToMod` method throw can be
very problematic and also hidden (as it is used inside of models in
places where exceptions are not expected to occur).

Given there are tens of usages of this method, returning a placeholder
mod seems like a better idea than outright throwing.

```
 An unhandled has occurred.
 System.InvalidOperationException:
There is no mod in the ruleset (osu) matching the acronym AS.
 at osu.Game.Online.API.APIMod.ToMod(Ruleset ruleset) in /Users/dean/Projects/osu/osu.Game/Online/API/APIMod.cs:line 54
 at osu.Game.Scoring.ScoreInfo.<get_Mods>b__117_0(APIMod m) in /Users/dean/Projects/osu/osu.Game/Scoring/ScoreInfo.cs:line 193
 at System.Linq.Enumerable.SelectArrayIterator`2.ToArray()
 at osu.Game.Scoring.ScoreInfo.get_Mods() in /Users/dean/Projects/osu/osu.Game/Scoring/ScoreInfo.cs:line 193
 at osu.Game.Screens.Select.Leaderboards.BeatmapLeaderboard.<>c.<subscribeToLocalScores>b__40_2(ScoreInfo s) in /Users/dean/Projects/osu/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs:line 199
 at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
 at osu.Game.Database.RealmObjectExtensions.Detach[T](IEnumerable`1 items) in /Users/dean/Projects/osu/osu.Game/Database/RealmObjectExtensions.cs:line 180
 at osu.Game.Screens.Select.Leaderboards.BeatmapLeaderboard.<>c__DisplayClass40_0.<subscribeToLocalScores>g__localScoresChanged|1(IRealmCollection`1 sender, ChangeSet changes, Exception exception) in /Users/dean/Projects/osu/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs:line
209
 at Realms.RealmCollectionBase`1.Realms.INotifiable<Realms.NotifiableObjectHandleBase.CollectionChangeSet>.NotifyCallbacks(Nullable`1 changes, Nullable`1 exception)
 at Realms.NotifiableObjectHandleBase.NotifyObjectChanged(IntPtr managedHandle, IntPtr changes, IntPtr exception)
```
2022-03-09 17:57:55 +09:00
Riley Quinn
8491bab77c
Replace string locale with Language 2022-03-04 00:57:13 -06:00
Dan Balasescu
16a3bbbcb4
Merge pull request #16944 from peppy/rooms-request-faster
Update playlists/multiplayer to use new compact response
2022-02-24 23:20:07 +09:00
Dan Balasescu
2acaffd5e7 Fix APIMod storing bindables instead of value 2022-02-24 17:01:12 +09:00
Dean Herbert
53bbd00675 Also make APIUser opt-in and remove the remaining serialization exclusion rule 2022-02-23 17:12:38 +09:00
Dean Herbert
71ae425fb2 Merge branch 'master' into rooms-request-faster 2022-02-22 15:45:05 +09:00
Dean Herbert
7f4cc221d2 Add API versioning 2022-02-21 19:02:03 +09:00
Dean Herbert
9d0023c750 Fix incorrect mappings 2022-02-17 21:12:51 +09:00
Dean Herbert
3d5ed24e20 Fix beatmap overlay leaderboards and links not working
Completely aware that this isn't how it should be done, but would like
to get this out in a hotfix release today. Maybe changes opinions on
https://github.com/ppy/osu/pull/16890 structure?
2022-02-17 21:05:00 +09:00
Dan Balasescu
5db63a8751 Expose read-only list from request 2022-02-16 11:30:03 +09:00
Dan Balasescu
ccd265ebe7 Handle beatmap lookup requests in TestRoomRequestsHandler 2022-02-15 23:41:50 +09:00
Dan Balasescu
43f1044987
Merge pull request #16850 from frenzibyte/readonly-pinned-scores
Add read-only pinned scores view in user profile overlay
2022-02-11 16:15:46 +09:00
Salman Ahmed
92e22c57a7 Introduce private APIRuleset for online ID equality comparison 2022-02-11 08:27:01 +03:00
Salman Ahmed
9cd88ec2b8 Update API models with score pinning changes 2022-02-10 21:23:38 +03:00
Dean Herbert
a69c7a9de6 Split exceptions back out to give better messaging 2022-02-03 14:09:27 +09:00
Dean Herbert
62fa915193 Standardise exception messages for local-user-logged-out flows 2022-02-03 13:58:55 +09:00
Dan Balasescu
d9a43b4c4c Fix API requests not completing when offline 2022-02-03 13:16:54 +09:00
Dean Herbert
4f8d29c1c0 Merge branch 'master' into realm-integration/score-and-beatmaps 2022-01-13 18:25:09 +09:00
Joseph Madamba
66773f6d7d Use comments to disable identifier typos instead 2022-01-12 15:49:28 -08:00
Dean Herbert
4c79145c11 Fix potential mod nullref in APIUserScoreAggregate's CreateScoreInfo implementation 2022-01-13 00:28:16 +09:00
Dean Herbert
51251e3204 Fix CI reported warnings 2022-01-12 22:39:00 +09:00
Dean Herbert
2a4bee61dd Update many score-related classes to move closer to being able to persist to realm 2022-01-12 16:57:27 +09:00
Dean Herbert
fda529de26 Update usages of APIUser to RealmUser 2022-01-12 16:39:36 +09:00
Joseph Madamba
cdc148f78e Increase scope of identifier typo disables on special cases 2021-12-29 14:07:36 -08:00
Joseph Madamba
c22a07d9fc Bump identifier typo inspection and fix remaining identifier names 2021-12-28 11:26:42 -08:00
Joseph Madamba
0bd928b5cd Fix incorrect naming / apply review 2021-12-27 21:44:19 -08:00
Joseph Madamba
7de43e3aba Fix most open compound words in identifiers being closed 2021-12-27 20:26:28 -08:00
Joseph Madamba
98524d60a4 Fix clear identifier typos 2021-12-27 20:26:28 -08:00
Dean Herbert
c6d0d6451d Change IScoreInfo.User to an interface type 2021-12-10 16:11:49 +09:00
Dean Herbert
bff02bedbf Rename APIScoreInfo to APIScore 2021-12-10 16:11:49 +09:00
Dean Herbert
dbb08f7d46 Use OnlineID for set operations 2021-12-10 16:11:48 +09:00
Salman Ahmed
974987550f Move API request response size log to correct logging target 2021-12-07 04:01:56 +03:00
Dean Herbert
e75e209053 Cache and consume IRulesetStore where feasible 2021-12-03 18:16:01 +09:00
Dean Herbert
dad5b06e84 Avoid sending empty parameters in GetBeatmapRequest 2021-12-03 16:23:39 +09:00
Dan Balasescu
af704dfe5b
Merge pull request #15878 from peppy/beatmap-lookup-cache
Cache beatmap metadata lookups used by multiplayer
2021-12-01 20:13:21 +09:00
Dean Herbert
81f82c24c3 Use new API endpoint to do batch lookups 2021-12-01 17:45:41 +09:00
Dean Herbert
23e297d414 Log output response sizes
Visibility is the first step towards action. Or something.
2021-11-30 19:09:13 +09:00
Dean Herbert
7488ccd5fe Update all models to implement IHasNamedFiles 2021-11-25 16:41:12 +09:00
Dean Herbert
183b95cbc2 Rename BeatmapSetOnlineStatus to BeatmapOnlineStatus
This variable is used at more than just a set level.
2021-11-24 18:42:49 +09:00
Dean Herbert
bbd3ea5b77 Update all actual usages of RulesetInfo.ID to use OnlineID instead 2021-11-24 15:50:26 +09:00
Dean Herbert
f283770f34 Update mock RulesetInfo usage to set OnlineID instead of ID 2021-11-24 15:50:26 +09:00
Dean Herbert
71fef241df Fix recursive equality call on APIBeatmap and APIBeatmapSet 2021-11-16 14:13:47 +09:00
Dean Herbert
9207b87b76 Add back interface equality but limit to only matching types 2021-11-16 12:35:18 +09:00
Dean Herbert
611b9fe942 Remove now unused implementations of interface equality 2021-11-15 14:50:09 +09:00
Dean Herbert
285b161da7 Update other usages of online ID comparisons to use new extension method 2021-11-15 14:44:08 +09:00
Dean Herbert
54cd1158a4 Add IBeatmapSetInfo equality support 2021-11-12 18:16:36 +09:00
Dean Herbert
a67e156883 Add IBeatmapInfo equality support 2021-11-12 18:11:33 +09:00
Bartłomiej Dach
5cb533004d
Add test coverage for favourite button 2021-11-08 11:53:53 +01:00
Dean Herbert
a2dfb5fd8c
Merge pull request #15513 from bdach/beatmap-card/statistics
Add statistics display to beatmap card
2021-11-08 14:45:56 +09:00
Dean Herbert
1589b50d6e Merge branch 'master' into beatmap-card/statistics 2021-11-08 13:28:31 +09:00
Bartłomiej Dach
c0b5b0e909
Add new statistic types to online info 2021-11-07 21:33:41 +01:00
Dean Herbert
0ecf5f201c Rename User to APIUser and move to correct namespace 2021-11-07 11:26:01 +09:00
Dean Herbert
9a7c75508e Merge branch 'master' into user-class-cleanup 2021-11-05 19:56:18 +09:00
Dean Herbert
6c385ccd29 Move second generic to abstract model downloader rather than interface type 2021-11-05 17:37:05 +09:00
Dean Herbert
f2700b0a6d Expose bot state via interface 2021-11-05 13:40:44 +09:00
Dean Herbert
ead64282dd Split out a couple more nested classes 2021-11-05 13:40:44 +09:00
Dean Herbert
86540d1fb6 Update existing usages of Author as string to access Username directly 2021-11-04 18:57:54 +09:00
Dean Herbert
b9983add15 Rename User to APIUser and move to correct namespace 2021-11-04 18:21:31 +09:00
Dean Herbert
eb17d897a3 Finally, remove the To* methods as they have no usages 2021-11-04 17:09:53 +09:00
Dean Herbert
7bab487621 Remove usage of ToBeatmapInfo in APIScoreInfo.CreateScoreInfo 2021-11-04 17:09:53 +09:00
Dean Herbert
8f459e6ce8 Fix APIBeatmapSet.Beatmaps being IEnumerable, causing stupid issues 2021-11-04 16:44:17 +09:00
Dean Herbert
9c926e5514 Remove BeatmapSetInfo.OnlineInfo and all usages 2021-11-04 15:23:04 +09:00
Dean Herbert
a97e5fbd89
Merge pull request #15431 from peppy/fix-unauth-api-requests
Fix unauthenticated API requests no longer working
2021-11-03 04:35:48 +09:00
Dean Herbert
51e92e1b2d Check for null/empty instead 2021-11-03 04:09:31 +09:00
Dean Herbert
8d0b32981f Fix unauthenticated API requests no longer working 2021-11-03 03:30:15 +09:00
Dean Herbert
c85a4dca28 Fix crash when attempting to view global leaderboards 2021-11-03 02:47:33 +09:00
Dean Herbert
3a5aed1182 Ensure APIScoreInfo.Mods is non-null 2021-11-01 22:59:12 +09:00
Dean Herbert
caa9d8997b Merge branch 'master' into score-refactor/less-create-score-info 2021-11-01 22:59:11 +09:00
Bartłomiej Dach
5dcff7d8b7
Merge branch 'master' into score-refactor/less-create-score-info 2021-11-01 11:41:20 +01:00
Dean Herbert
b21e0e7efb Merge branch 'beatmap-refactor/get-and-present' into beatmap-refactor/beatmap-overlays 2021-11-01 18:07:51 +09:00
Dean Herbert
602fe372c2 Merge branch 'score-refactor/isolated-serialisation' into beatmap-refactor/get-and-present 2021-11-01 18:06:53 +09:00
Dean Herbert
722e0d50bb Fix BeatmapInfo not being correctly populated in CreateScoreInfo call 2021-11-01 15:54:39 +09:00
smoogipoo
94dce3f92a Remove whitespace 2021-11-01 15:43:19 +09:00
Dean Herbert
708b57348d Change loose api ordering requirement to throw instead 2021-11-01 13:22:16 +09:00
Dean Herbert
269a8df0ec Fix HasReplay not being corrrectly implemented by APIScoreInfo 2021-11-01 13:20:37 +09:00
Dean Herbert
a16c8f1ebc Update all beatmap overlay views to use APIBeatmap/APIBeatmapSet 2021-10-29 18:50:55 +09:00
Dean Herbert
b8ee7e05f4 Expose more pieces of APIBeatmap for testing purposes 2021-10-29 18:35:27 +09:00
Dean Herbert
b5834044e0 Update GetScoreRequest to support requests with interface types 2021-10-29 17:43:39 +09:00
Dean Herbert
17a83f701a Store mods as APIMods for the time being 2021-10-29 15:13:49 +09:00
Dean Herbert
06b6bcfd29 Add xmldoc for CreateScoreInfo function for now
I don't actually know how temporary this one is going to be. The usages
are quite deep - ie. converting to a `ScoreInfo` to get a calculated
total score for ordering purposes.
2021-10-29 14:51:07 +09:00
Dean Herbert
cd7bd935f6 Remove Statistics from interface until we figure how to properly deserialise 2021-10-29 14:18:10 +09:00
Dean Herbert
3f030cebf4 Remove local score copying in GetScoresRequest to allow APIScoreInfo.Beatmap to be APIBeatmap 2021-10-29 14:14:25 +09:00
Dean Herbert
1944c255a7 Implement score interfaces 2021-10-29 13:49:30 +09:00
Dean Herbert
817369903a Rename API score classes 2021-10-29 13:40:56 +09:00
Dan Balasescu
44ba4419a2
Merge branch 'master' into beatmap-refactor/tournament 2021-10-28 15:25:34 +09:00
Dean Herbert
db6343c44c Correctly redirect BPM from API to interface 2021-10-27 17:09:51 +09:00
Dean Herbert
40d963fc8a Allow setting of APIBeatmap.Length (and don't serialise twice) 2021-10-27 16:44:21 +09:00
Dean Herbert
6944151486 Apply batch fixing of built-in types using var 2021-10-27 13:04:41 +09:00
Dan Balasescu
f687ed8599
Merge pull request #15283 from peppy/test-api-beatmap-set
Add ability to make test `APIBeatmapSet`s from test scenes
2021-10-26 15:34:19 +09:00
Dan Balasescu
efe6763226
Merge branch 'master' into move-online-beatmap-metrics 2021-10-26 14:24:40 +09:00
Dan Balasescu
676e7ff2a6
Merge pull request #15287 from peppy/get-beatmap-request-via-interface
Allow API beatmap requests using interface type
2021-10-26 13:50:46 +09:00
Dean Herbert
d7ac94038a Update GetBeatmapRequest to use AddParameter 2021-10-26 12:05:31 +09:00
Bartłomiej Dach
a49a1f41cb
Merge branch 'master' into move-online-beatmap-metrics 2021-10-25 20:33:49 +02:00
Dean Herbert
b65d199f6a Fix incorrect length when calling APIBeatmap.ToBeatmapInfo 2021-10-25 17:01:47 +09:00
Dean Herbert
6adb0f068b Fix multiple issues with json serialisation of online info (causing tournament failures) 2021-10-25 16:52:50 +09:00
Dean Herbert
67ef1c40e6 Allow API beatmap requests using interface type 2021-10-25 15:59:40 +09:00
Dean Herbert
2c308f3008 Rename BeatmapMetrics to APIFailTimes 2021-10-25 15:34:41 +09:00
Dean Herbert
20baae9094 Move online metrics out of BeatmapInfo model 2021-10-25 15:32:18 +09:00
Dean Herbert
045dd94a6e Move online metrics out of BeatmapSetInfo model 2021-10-25 15:12:39 +09:00
Dean Herbert
19312435d0 Add ability to make test APIBeatmaps from test scenes
Allow tests to create a sample `APIBeatmapSet`

One step towards removing calls to `ToBeatmap` / `ToBeatmapSet`.
2021-10-25 14:18:13 +09:00
Dean Herbert
c701579c69 Refactor BeatmapMetadataContainer and usages to use interface types 2021-10-22 21:38:50 +09:00
Dean Herbert
28d8820976
Merge pull request #15224 from peppy/no-more-beatmap-metadata-base
Remove `BeatmapMetadata` base class from API classes
2021-10-22 21:07:29 +09:00
Dean Herbert
ea473428e8 Fix incorrect length mapping in APIBeatmap 2021-10-22 15:54:40 +09:00
Dean Herbert
de33b2f45a Return set metadata if available before falling back to empty object 2021-10-22 15:00:31 +09:00
Dean Herbert
fb7cf35481 Remove BeatmapMetadata base class from APIBeatmap 2021-10-21 21:48:14 +09:00
Dean Herbert
6dd54a417f Remove BeatmapMetadata base class from APIBeatmapSet 2021-10-21 21:32:07 +09:00
Dean Herbert
c580ec865f APIBeatmapSet.Covers is never null 2021-10-21 19:34:01 +09:00
Dean Herbert
0fe0b5dc09 APIBeatmap implements IBeatmapInfo 2021-10-21 19:14:31 +09:00
Dean Herbert
40a176e86e APIBeatmapSet implements IBeatmapSetInfo 2021-10-21 19:14:19 +09:00
Dan Balasescu
8ae05ee8f7
Merge branch 'master' into online-info-as-interface 2021-10-21 17:14:57 +09:00
Dean Herbert
0706ad70fb Move BeatmapSetOnlineInfo to an interface type 2021-10-21 16:58:42 +09:00
Dean Herbert
a5c155bc87 Remove APIPlaylistBeatmap subclass 2021-10-21 16:43:46 +09:00
Dean Herbert
ad112cbbc5 Fix intendation in a way it doesn't regress with older inspectcode 2021-10-18 14:28:29 +09:00
Dean Herbert
6d6eed61aa Fix new indentation inspections 2021-10-18 14:00:35 +09:00
Dan Balasescu
9491e5a547
Merge pull request #14954 from peppy/rename-result-response
Rename `APIRequest.Result` to `Response`
2021-10-06 10:52:33 +09:00
Dean Herbert
c23acb8f05
Merge pull request #14967 from bdach/fix-accidental-json-property-rename
Fix "most played beatmap" request breakage after property rename
2021-10-06 05:00:12 +09:00
Bartłomiej Dach
baa8baaa1e
Fix "most played beatmap" request breakage after property rename 2021-10-05 21:17:19 +02:00
Bartłomiej Dach
12da27cde7
Add test coverage for loading process on channel join 2021-10-05 20:52:40 +02:00
Dean Herbert
b41fa41c85 Rename APIRequest.Result to Response 2021-10-05 14:28:56 +09:00
Dean Herbert
853cf6feaa Rename last remaining BeatmapInfo Beatmap usage 2021-10-04 17:35:53 +09:00
Dan Balasescu
5937a93e2d
Merge pull request #14949 from peppy/login-error-display
Show login failure messages on login form
2021-10-04 17:23:11 +09:00