You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add database table for storing lazer multiplayer room events
The goal of this table is to power display of multiplayer match history
for lazer rooms, e.g. #10455.
If you squint a bit, you'll notice that the table structure is
*extremely* similar to `osu_mp.events`, but to spell things out:
- `id` (PK)`: Self-explanatory.
- `room_id` (FK referencing `multiplayer_rooms`): Self-explanatory.
- `event_type`: Self-explanatory. Uses `string` rather than any explicit
`enum` type for more flexibility and to reduce ceremony when adding
new types in.
- `playlist_item_id` (FK referencing `multiplayer_playlist_items`,
optional): Valid if `event_type` is `game_{started,aborted}`. Points
at the game in question.
- `user_id` (FK referencing `phpbb_users`, optional): If the event can
be associated with a user, it will be via this column.
- `{created,updated}_at`: Decided to just let laravel generate this one,
although osu-web won't really be writing to this table, and I expect
99.999% of records (if not all) to just contain the same value twice
here. Not sure. Maybe this can be a single timestamp column or
something, please advise.
- `event_detail`: This is somewhat new. The goal of this column is to
store extra data, in particular in the case of `game_started` events.
The specific data I want to store there are: the game mode at the time
of starting (be it head-to-head, or team vs, or whichever), and also
who's on what team in the room (if team vs). This information is
currently not stored anywhere in the database; only the latest game
mode is preserved, and the team composition is only stored in memory
of the spectator server. This came up recently in
ppy/osu#32680 (comment).
Potentially, this could also be used to do things like store the
users' total scores at the end of the match, which we presumably want
to be 'frozen in time' at the point of match completion for archival
purposes; because in lazer multiplayer scores just land in the
`scores` table and will be treated the same way as solo scores, any
potential rebalances could have a side effect of rewriting multiplayer
match history if this sort of thing is not done preventatively. (The
old `osu_mp` structure is immune from this because it completely
mirrors score rows into its `game_scores` table.)
Note that currently the assumption is that this table will store events
for all rooms going forward, because there is no correspondent of the
`osu_mp.matches.keep_forever` flag anywhere for lazer multiplayer rooms.
Up for discussion as to whether we want to have one.
0 commit comments