1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:52:55 +08:00

Merge branch 'master' into remove-multiplayer-selection-poller

This commit is contained in:
Bartłomiej Dach 2020-12-29 12:51:33 +01:00
commit 05f212eb3c
3 changed files with 8 additions and 6 deletions

View File

@ -42,8 +42,6 @@ namespace osu.Game.Online.Multiplayer
/// </summary> /// </summary>
public MultiplayerRoomUser? Host { get; set; } public MultiplayerRoomUser? Host { get; set; }
private object writeLock = new object();
[JsonConstructor] [JsonConstructor]
public MultiplayerRoom(in long roomId) public MultiplayerRoom(in long roomId)
{ {

View File

@ -156,11 +156,11 @@ namespace osu.Game.Screens.Menu
private void onMultiplayer() private void onMultiplayer()
{ {
if (!api.IsLoggedIn) if (api.State.Value != APIState.Online)
{ {
notifications?.Post(new SimpleNotification notifications?.Post(new SimpleNotification
{ {
Text = "You gotta be logged in to multi 'yo!", Text = "You gotta be online to multi 'yo!",
Icon = FontAwesome.Solid.Globe, Icon = FontAwesome.Solid.Globe,
Activated = () => Activated = () =>
{ {
@ -177,11 +177,11 @@ namespace osu.Game.Screens.Menu
private void onPlaylists() private void onPlaylists()
{ {
if (!api.IsLoggedIn) if (api.State.Value != APIState.Online)
{ {
notifications?.Post(new SimpleNotification notifications?.Post(new SimpleNotification
{ {
Text = "You gotta be logged in to multi 'yo!", Text = "You gotta be online to view playlists 'yo!",
Icon = FontAwesome.Solid.Globe, Icon = FontAwesome.Solid.Globe,
Activated = () => Activated = () =>
{ {

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Logging;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Beatmaps.Drawables; using osu.Game.Beatmaps.Drawables;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
@ -165,7 +166,10 @@ namespace osu.Game.Screens.OnlinePlay
private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule(() => private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule(() =>
{ {
if (state.NewValue != APIState.Online) if (state.NewValue != APIState.Online)
{
Logger.Log("API connection was lost, can't continue with online play", LoggingTarget.Network, LogLevel.Important);
Schedule(forcefullyExit); Schedule(forcefullyExit);
}
}); });
protected override void LoadComplete() protected override void LoadComplete()