Skip to content

Port g0v0-server features to v2 branch#6

Merged
MingxuanGame merged 19 commits into
v2from
copilot/sync-g0v0-features-to-v2
Apr 4, 2026
Merged

Port g0v0-server features to v2 branch#6
MingxuanGame merged 19 commits into
v2from
copilot/sync-g0v0-features-to-v2

Conversation

Copilot AI commented Mar 26, 2026

Copy link
Copy Markdown
Original prompt

仓库 ppy/osu-spectator-server 为上游仓库。
上游仓库基于 ppy/osu-web,本仓库基于 GooGuTeam/g0v0-server,两者在数据库的定义和逻辑上有所不同。
v2 分支为上游仓库的最新同步。根据旧分支(本仓库的master)将修改的 g0v0 特有特性(主要来自 MingxuanGame 和 GooGuJiang 的更改)同步到 v2 分支,并对旧代码可能存在的质量问题进行修复和格式化。
具体包括:

  • 数据库操作的更改。
  • RulesetManager的实现,以及基于其的代码的移植
  • MultiplayHub中对来自客户端的RulesetHash的存储和检查,参考客户端代码https://github.com/GooGuTeam/osu/blob/v2/osu.Game%2FOnline%2FHubClientConnector.cs
  • 鉴权更改
  • 配置的更改,参考 g0v0-server 的 config.py
  • 对RX, AP等模式的支持,对FailTime的储存
  • 对在线状态的更新
  • 其他我可能有遗漏的更改

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 7 commits March 26, 2026 15:58
- Replace S3/FileScoreStorage settings with g0v0 settings (EnableAllBeatmapLeaderboard, EnableAP, EnableRX)
- Add JWT authentication settings (HS256 support alongside legacy RSA)
- Add custom rulesets settings (RulesetsPath, CheckRulesetVersion)
- Change DB env vars to MYSQL_HOST/MYSQL_USER/MYSQL_PORT/MYSQL_PASSWORD/MYSQL_DATABASE
- Change default server port to 8086, database user to osu_api
- Change SentryDsn env var to SP_SENTRY_DSN
- Change BanchoBotUserId default to 2
- Simplify auth to single JWT scheme (remove lazer/referee dual-scheme)
- Create AuthSettings.cs for JWT configuration
- Update ConfigureJwtBearerOptions to support both HS256 and legacy RSA

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: MingxuanGame <68982190+MingxuanGame@users.noreply.github.com>
Add BlobHelper, GameModeHelper, TimeHelper in Helpers/
Add RulesetExtensions in Extensions/
Add RulesetVersionEntry in Entities/
Add RulesetManager, RulesetInitializer in Services/
Add fail_time, beatmap_sync, playlist_best_score in Database/Models/
Add ServerScoreStorage in Storage/

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: MingxuanGame <68982190+MingxuanGame@users.noreply.github.com>
…d code

- database_beatmap: rename difficultyrating to difficulty_rating, add total_length
- multiplayer_room: rename user_id to host_id
- multiplayer_playlist_item: rename difficultyrating to difficulty_rating
- room_category: add realtime enum value
- database_match_type: remove ranked_play enum and switch cases
- SoloScore: replace SoloScoreData/data with individual columns
- matchmaking_pool_beatmap: remove playmode, ToPlaylistItem, rename difficultyrating
- matchmaking_pool: remove type property and ToPoolType usage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: MingxuanGame <68982190+MingxuanGame@users.noreply.github.com>
- Remove GetDelegatedResourceOwnerIdFromTokenAsync
- Add roomId parameter to AnyScoreTokenExistsFor, GetAllScoresForPlaylistItem,
  GetPassingScoresForPlaylistItem, GetUserBestScoreAsync, GetUserRankInRoomAsync
- Change GetUserBestScoreAsync return type to playlist_best_score?
- Change GetUserRankInRoomAsync to accept playlistItemId and scoreId
- Add new methods: GetBeatmapOrFetchAsync, GetBeatmapFailTimeAsync,
  UpdateFailTimeAsync, GetUserPlaytimeAsync, UpdateUserPlaytimeAsync,
  GetChangedBeatmapSetsAsync, UpdateUserOnlineStatusAsync

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: MingxuanGame <68982190+MingxuanGame@users.noreply.github.com>
- Replace token auth with JWT sub claim parsing
- Remove GetDelegatedResourceOwnerIdFromTokenAsync
- Update user queries to use lazer_users table
- Replace restriction check with user_account_history
- Rename multiplayer_rooms to rooms throughout
- Update beatmap queries for g0v0 schema (beatmaps table with mode strings)
- Add GetBeatmapOrFetchAsync, fail_time, playtime, beatmap_sync methods
- Change playlist tables to room_playlists with new ID generation
- Update score queries to use playlist_best_scores and scores tables
- Change relationship queries to use relationship/lazer_users tables
- Return dummy values for build-related methods (no osu_builds table)
- Return empty list for chat filters
- Update connection string to use AppSettings.DatabasePassword/DatabaseName
- Add UpdateUserOnlineStatusAsync method
- Make AddLoginForUserAsync and ToggleUserPresenceAsync no-ops

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: MingxuanGame <68982190+MingxuanGame@users.noreply.github.com>
… SharedInterop, MetadataHub, and MetadataBroadcaster

Agent-Logs-Url: https://github.com/GooGuTeam/osu-server-spectator/sessions/fed5a5cd-8fc3-49ea-ac42-ef2d727bb19b

Co-authored-by: MingxuanGame <68982190+MingxuanGame@users.noreply.github.com>
…tionExtensions

Agent-Logs-Url: https://github.com/GooGuTeam/osu-server-spectator/sessions/fed5a5cd-8fc3-49ea-ac42-ef2d727bb19b

Co-authored-by: MingxuanGame <68982190+MingxuanGame@users.noreply.github.com>
Copilot AI changed the title [WIP] Sync g0v0 specific features to v2 branch Port g0v0-server features to v2 branch Mar 26, 2026
Copilot AI requested a review from MingxuanGame March 26, 2026 16:39
Copilot AI and others added 4 commits March 26, 2026 17:05
…ger integration, failtime/playtime processing, RulesetHash headers, IMemoryCache migration, PlaymodeTypeHandler

Agent-Logs-Url: https://github.com/GooGuTeam/osu-server-spectator/sessions/3007fd6f-d9b2-4454-9560-06c94ace4a05

Co-authored-by: MingxuanGame <68982190+MingxuanGame@users.noreply.github.com>
…nges

- Rename multiplayer_room.user_id to host_id in all test files
- Update GetAllScoresForPlaylistItem mock setups to use (long, long) signature
- Update AnyScoreTokenExistsFor mock setup to use (long, long) signature
- Add RulesetManager parameter to MultiplayerRoomController, MatchmakingQueueBackgroundService,
  ServerMultiplayerRoom.InitialiseAsync, and InitialiseMatchmakingRoomAsync calls
- Add IConnectionMultiplexer parameter to MetadataHub and SpectatorHub constructors
- Add RulesetManager + IConnectionMultiplexer to SpectatorHub constructor
- Remove assertion on removed matchmaking_pool_beatmap.playmode field
- Replace database_match_type.ranked_play with matchmaking in RankedPlayStageImplementationTest

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: MingxuanGame <68982190+MingxuanGame@users.noreply.github.com>
…ks, RankedPlay type restored, RulesetManager throws InvalidStateException, ResultsStage callback params

Agent-Logs-Url: https://github.com/GooGuTeam/osu-server-spectator/sessions/3007fd6f-d9b2-4454-9560-06c94ace4a05

Co-authored-by: MingxuanGame <68982190+MingxuanGame@users.noreply.github.com>
Agent-Logs-Url: https://github.com/GooGuTeam/osu-server-spectator/sessions/3007fd6f-d9b2-4454-9560-06c94ace4a05

Co-authored-by: MingxuanGame <68982190+MingxuanGame@users.noreply.github.com>
bdach and others added 4 commits March 28, 2026 01:41
)

* Allow referees to join matches via the lazer client to spectate

* Allow referees to perform room management actions via multiplayer hub too

* Do not allow referees to perform actions related to direct gameplay

* Document spectating-while-refereeing & its limitations

* Fix spectating referee being removed from users on leaving room inside client

* Allow referee to start match from client even when not readied up

* Fix referee's player state getting into half broken state if the room gets closed via referee commands

* Re-do referee kick/leave pathways

I realised that my previous fixes weren't going far enough and really to
avoid breakage *any* departure of the referee from their refereed room
should prompt a kick from spectate in lazer as well.
* Make `RefereeHub` inherit `LoggingHub`

Mostly because I'm starting to look at sentry issues from the referee
hub and noticing that they're missing the user ID which is useful
information, and in other hubs it is supplied by `LoggingHub` and its
related hub filter. It'll also add some datadog monitoring which may
come in useful going forward as well.

Not sure why I never did this. I think I convinced myself that the
generics didn't work in my usage because of it being tied to
`StatefulUserHub`, but on closer inspection, no, that's not the case.

* Allow argument of `Roll` referee hub operation to be nullable

Spotted via ppy#459.

I reproduced this by calling `Roll(roomId, null)` from a JS client.

You could argue that the user was at fault here for passing `null`
rather than `{}` or something, but you could also argue that there's no
reason not to make this work with a nullable for user convenience. While
I'm not clairvoyant I can't see a future where rolling has a required
parameter in it either.
… referee hub (ppy#463)

* Add failing test

* Use case insensitive comparisons when treating mod acronyms

* Defensively convert mod acronyms to uppercase when validating
…, roll nullable, post-discard timing, mod casing fix)

Co-authored-by: MingxuanGame <68982190+MingxuanGame@users.noreply.github.com>
@MingxuanGame MingxuanGame marked this pull request as ready for review April 4, 2026 07:31
@MingxuanGame MingxuanGame merged commit 38fead6 into v2 Apr 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants