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

Enable NRT for multiplayer and playlists #30807

Merged
merged 6 commits into from
Nov 22, 2024
Merged

Conversation

smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Nov 21, 2024

Most relevant changes:

  • RoomSubScreen.CreateGameplayScreen() - PlaylistItem parameter added with non-null precondition in RoomSubScreen.StartPlay().
  • DrawableRoomPlaylistItem - this class is totally boned, with a virtual method call that's never called in the base class. Fields made nullable because there is at least one usage that doesn't call said virtual method at all.
  • OnlinePlayScreen - moved screen stack construction to class init because it's referenced externally via CursorVisible.

@smoogipoo smoogipoo added the blocked Don't merge this. label Nov 21, 2024
This one is super duper annoying to test, because we already have e.g.
`TestScenePlaylistsScreen`. The only way to test it would be to use an
`OsuGameTestScene`.

Maybe this is okay?
@smoogipoo smoogipoo removed the blocked Don't merge this. label Nov 21, 2024
@bdach
Copy link
Collaborator

bdach commented Nov 21, 2024

DrawableRoomPlaylistItem - this class is totally boned, with a virtual method call that's never called in the base class. Fields made nullable because there is at least one usage that doesn't call said virtual method at all.

Yeah that one is a stinker. To call it overloaded with functionality is underselling it. If you find yourself taking a hammer to that atrocity I'd be overjoyed.

@bdach bdach self-requested a review November 21, 2024 12:35
@smoogipoo
Copy link
Contributor Author

It'll happen at some point for sure...

Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems generally ok

public RoomStatusFilter Status;
public string Category;
public RulesetInfo Ruleset;
public string Category = string.Empty;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would also accept string? here, but either works

Comment on lines +70 to +71
[Resolved(CanBeNull = true)]
private IdleTracker? idleTracker { get; set; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder a bit, at this point the CanBeNull thing on ResolvedAttribute is redundant right? Like the NRT annotation on the field itself is enough to convey the same meaning? Is there any reason to keep specifying it then?

Copy link
Contributor Author

@smoogipoo smoogipoo Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is redundant, yes. I kept it for conformity. We have an analyser to automatically clean up or warn, but it was disabled due to iOS/Mono not supporting NRT completely back in the day.

These days we compile with source gen'd activators as well so it should be a non-issue in any case.

@@ -84,7 +83,7 @@ public GameTypePickerItem(MatchType value)
};
}

private Sample selectSample;
private Sample selectSample = null!;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little funny, most places will declare samples as nullable, I guess for safety against the audio store lookup failing. Not something that matters either way, just noticed in passing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is a very weird one and I was a bit conflicted in what changes to make. I decided to keep existing code as much as possible at the end of the day such that if something was used in a may-be-null way then I tended towards assuming null is still a valid value, and suspending my own analysis. Except things in load() and similar.

We can probably do a pass through the rest of the game and remove this pattern later.

osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs Outdated Show resolved Hide resolved
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not gonna overthink this

@bdach bdach enabled auto-merge November 22, 2024 07:09
@bdach bdach merged commit ce3d4e8 into ppy:master Nov 22, 2024
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants