Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure ranks are properly populated in spectated scores #231

Merged
merged 3 commits into from
May 7, 2024

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented May 6, 2024

Warning

This - or an alternative PR fixing this same issue - must be merged before the next bump of game packages in spectator server. Without fixing this issue one way or another, all online replays after next game bump & deploy thereof will have rank D stored to the replay and read client-side.

RFC.

This begins to matter after ppy/osu#28058, as with that pull the rank is encoded to the replay, so it must be correctly set on the server side. Otherwise spectator server will default to storing D rank, which the client will happily read and use raw without checking.

This is purposefully computed server-side rather than sent in replay headers for the reasons of simplicity and backwards compatibility. You could add score rank to the replay headers, but to ensure that replays recorded with old clients don't have D rank set, recomputing server-side would have to be done at least for the old clients. And you could argue recomputing ranks always server-side removes a tamper vector too (although that's not a very strong argument).


Also includes a sentry package bump in e160320 - without this the server dies at runtime with newest game packages.

bdach added 3 commits May 6, 2024 17:54
Spectator server dies at runtime without this.
This begins to matter after ppy/osu#28058, as
with that pull the rank is encoded to the replay, so it must be
correctly set on the server side. Otherwise spectator server will
default to storing D rank, which the client will happily read and use
raw without checking.

This is purposefully computed server-side rather than sent in replay
headers for the reasons of simplicity and backwards compatibility. You
could add score rank to the replay headers, but to ensure that replays
recorded with old clients don't have D rank set, recomputing server-side
would have to be done at least for the old clients. And you could argue
recomputing ranks always server-side removes a tamper vector too
(although that's not a very strong argument).
@bdach bdach requested a review from a team May 6, 2024 16:21
@peppy peppy self-requested a review May 7, 2024 03:35
@peppy
Copy link
Member

peppy commented May 7, 2024

@bdach i'm quite confident it is, but just to confirm, this is fine to deploy immediately yes?

@bdach
Copy link
Collaborator Author

bdach commented May 7, 2024

As far as I'm aware yes, this change is basically inert until the next game package bump.

@peppy
Copy link
Member

peppy commented May 7, 2024

Inert assuming no funny business, sure.

I ask because I was planning a new spectator deploy today, will include this 👍

@peppy peppy merged commit 681debc into ppy:master May 7, 2024
2 checks passed
@bdach bdach deleted the make-sure-ranks-are-not-missing branch May 8, 2024 07:59
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.

2 participants