Merge branch 'master' into realm-integration/score-and-beatmaps

This commit is contained in:
Bartłomiej Dach
2022-01-15 14:45:42 +01:00
86 changed files with 169 additions and 171 deletions

View File

@ -90,13 +90,16 @@ namespace osu.Game.Online.Chat
{
// Polling will eventually be replaced with websocket, but let's avoid doing these background operations as much as possible for now.
// The only loss will be delayed PM/message highlight notifications.
int millisecondsBetweenPolls = HighPollRate.Value ? 1000 : 60000;
if (HighPollRate.Value)
TimeBetweenPolls.Value = 1000;
else if (!isIdle.Value)
TimeBetweenPolls.Value = 60000;
else
TimeBetweenPolls.Value = 600000;
if (isIdle.Value)
millisecondsBetweenPolls *= 10;
if (TimeBetweenPolls.Value != millisecondsBetweenPolls)
{
TimeBetweenPolls.Value = millisecondsBetweenPolls;
Logger.Log($"Chat is now polling every {TimeBetweenPolls.Value} ms");
}
}
/// <summary>

View File

@ -25,7 +25,7 @@ namespace osu.Game.Online.Chat
protected readonly ChatTextBox TextBox;
protected ChannelManager ChannelManager;
private ChannelManager channelManager;
private StandAloneDrawableChannel drawableChannel;
@ -80,7 +80,7 @@ namespace osu.Game.Online.Chat
[BackgroundDependencyLoader(true)]
private void load(ChannelManager manager)
{
ChannelManager ??= manager;
channelManager ??= manager;
}
protected virtual StandAloneDrawableChannel CreateDrawableChannel(Channel channel) =>
@ -94,9 +94,9 @@ namespace osu.Game.Online.Chat
return;
if (text[0] == '/')
ChannelManager?.PostCommand(text.Substring(1), Channel.Value);
channelManager?.PostCommand(text.Substring(1), Channel.Value);
else
ChannelManager?.PostMessage(text, target: Channel.Value);
channelManager?.PostMessage(text, target: Channel.Value);
TextBox.Text = string.Empty;
}