1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-10 21:40:34 +08:00

LoungePollingComponent -> LoungeListingPoller

This commit is contained in:
Dean Herbert 2025-03-04 14:40:33 +09:00
parent f3e9d1931c
commit 0696cfa4f2
No known key found for this signature in database
3 changed files with 11 additions and 11 deletions

View File

@ -805,7 +805,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddUntilStep("wait for room", () => this.ChildrenOfType<DrawableRoom>().Any());
AddStep("select room", () => InputManager.Key(Key.Down));
AddStep("disable polling", () => this.ChildrenOfType<LoungePollingComponent>().Single().TimeBetweenPolls.Value = 0);
AddStep("disable polling", () => this.ChildrenOfType<LoungeListingPoller>().Single().TimeBetweenPolls.Value = 0);
AddStep("change server-side settings", () =>
{
multiplayerClient.ServerSideRooms[0].Name = "New name";

View File

@ -14,9 +14,9 @@ using osu.Game.Screens.OnlinePlay.Lounge.Components;
namespace osu.Game.Screens.OnlinePlay.Lounge
{
/// <summary>
/// A <see cref="PollingComponent"/> that polls for the lounge listing.
/// Polls for rooms for the main lounge listing.
/// </summary>
public partial class LoungePollingComponent : PollingComponent
public partial class LoungeListingPoller : PollingComponent
{
[Resolved]
private IAPIProvider api { get; set; } = null!;

View File

@ -75,7 +75,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
private readonly IBindable<bool> operationInProgress = new Bindable<bool>();
private readonly IBindable<bool> isIdle = new BindableBool();
private RoomsContainer roomsContainer = null!;
private LoungePollingComponent pollingComponent = null!;
private LoungeListingPoller listingPoller = null!;
private PopoverContainer popoverContainer = null!;
private LoadingLayer loadingLayer = null!;
private SearchTextBox searchTextBox = null!;
@ -92,7 +92,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
InternalChildren = new Drawable[]
{
pollingComponent = new LoungePollingComponent
listingPoller = new LoungeListingPoller
{
RoomsReceived = onListingReceived,
Filter = { BindTarget = filter }
@ -187,7 +187,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
{
roomsContainer.Rooms.Clear();
hasListingResults.Value = false;
pollingComponent.PollImmediately();
listingPoller.PollImmediately();
});
updateFilter();
@ -268,7 +268,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
onReturning();
// Poll for any newly-created rooms (including potentially the user's own).
pollingComponent.PollImmediately();
listingPoller.PollImmediately();
}
public override bool OnExiting(ScreenExitEvent e)
@ -379,7 +379,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
protected virtual void OpenNewRoom(Room room) => this.Push(CreateRoomSubScreen(room));
public void RefreshRooms() => pollingComponent.PollImmediately();
public void RefreshRooms() => listingPoller.PollImmediately();
private void updateLoadingLayer()
{
@ -392,11 +392,11 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
private void updatePollingRate(bool isCurrentScreen)
{
if (!isCurrentScreen)
pollingComponent.TimeBetweenPolls.Value = 0;
listingPoller.TimeBetweenPolls.Value = 0;
else
pollingComponent.TimeBetweenPolls.Value = isIdle.Value ? 120000 : 15000;
listingPoller.TimeBetweenPolls.Value = isIdle.Value ? 120000 : 15000;
Logger.Log($"Polling adjusted (listing: {pollingComponent.TimeBetweenPolls.Value})");
Logger.Log($"Polling adjusted (listing: {listingPoller.TimeBetweenPolls.Value})");
}
protected abstract OsuButton CreateNewRoomButton();