-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #249 from smoogipoo/better-room-status
Update databased room status depending on gameplay state
- Loading branch information
Showing
6 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
osu.Server.Spectator/Database/Models/database_room_status.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using osu.Game.Online.Multiplayer; | ||
|
||
namespace osu.Server.Spectator.Database.Models | ||
{ | ||
// ReSharper disable once InconsistentNaming | ||
[Serializable] | ||
public enum database_room_status | ||
{ | ||
idle, | ||
playing | ||
} | ||
|
||
public static class DatabaseRoomStatusExtensions | ||
{ | ||
public static database_room_status ToDatabaseRoomStatus(this MultiplayerRoomState state) | ||
{ | ||
switch (state) | ||
{ | ||
case MultiplayerRoomState.Open: | ||
case MultiplayerRoomState.Closed: | ||
return database_room_status.idle; | ||
|
||
case MultiplayerRoomState.WaitingForLoad: | ||
case MultiplayerRoomState.Playing: | ||
return database_room_status.playing; | ||
|
||
default: | ||
throw new ArgumentOutOfRangeException(nameof(state), state, null); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters