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

Merge pull request #11798 from smoogipoo/multiplayer-long-types

Use long type where required in multiplayer
This commit is contained in:
Dean Herbert 2021-02-17 15:50:12 +09:00 committed by GitHub
commit 86faa7f465
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 33 additions and 33 deletions

View File

@ -22,7 +22,7 @@ namespace osu.Game.Online.API.Requests.Responses
public double? PP { get; set; }
[JsonProperty(@"room_id")]
public int RoomID { get; set; }
public long RoomID { get; set; }
[JsonProperty("total_score")]
public long TotalScore { get; set; }

View File

@ -95,7 +95,7 @@ namespace osu.Game.Online.Multiplayer
private Room? apiRoom;
// Todo: This is temporary, until the multiplayer server returns the item id on match start or otherwise.
private int playlistItemId;
private long playlistItemId;
[BackgroundDependencyLoader]
private void load()

View File

@ -9,11 +9,11 @@ namespace osu.Game.Online.Rooms
{
public class CreateRoomScoreRequest : APIRequest<APIScoreToken>
{
private readonly int roomId;
private readonly int playlistItemId;
private readonly long roomId;
private readonly long playlistItemId;
private readonly string versionHash;
public CreateRoomScoreRequest(int roomId, int playlistItemId, string versionHash)
public CreateRoomScoreRequest(long roomId, long playlistItemId, string versionHash)
{
this.roomId = roomId;
this.playlistItemId = playlistItemId;

View File

@ -7,9 +7,9 @@ namespace osu.Game.Online.Rooms
{
public class GetRoomLeaderboardRequest : APIRequest<APILeaderboard>
{
private readonly int roomId;
private readonly long roomId;
public GetRoomLeaderboardRequest(int roomId)
public GetRoomLeaderboardRequest(long roomId)
{
this.roomId = roomId;
}

View File

@ -7,9 +7,9 @@ namespace osu.Game.Online.Rooms
{
public class GetRoomRequest : APIRequest<Room>
{
public readonly int RoomId;
public readonly long RoomId;
public GetRoomRequest(int roomId)
public GetRoomRequest(long roomId)
{
RoomId = roomId;
}

View File

@ -15,8 +15,8 @@ namespace osu.Game.Online.Rooms
/// </summary>
public class IndexPlaylistScoresRequest : APIRequest<IndexedMultiplayerScores>
{
public readonly int RoomId;
public readonly int PlaylistItemId;
public readonly long RoomId;
public readonly long PlaylistItemId;
[CanBeNull]
public readonly Cursor Cursor;
@ -24,13 +24,13 @@ namespace osu.Game.Online.Rooms
[CanBeNull]
public readonly IndexScoresParams IndexParams;
public IndexPlaylistScoresRequest(int roomId, int playlistItemId)
public IndexPlaylistScoresRequest(long roomId, long playlistItemId)
{
RoomId = roomId;
PlaylistItemId = playlistItemId;
}
public IndexPlaylistScoresRequest(int roomId, int playlistItemId, [NotNull] Cursor cursor, [NotNull] IndexScoresParams indexParams)
public IndexPlaylistScoresRequest(long roomId, long playlistItemId, [NotNull] Cursor cursor, [NotNull] IndexScoresParams indexParams)
: this(roomId, playlistItemId)
{
Cursor = cursor;

View File

@ -18,7 +18,7 @@ namespace osu.Game.Online.Rooms
public class MultiplayerScore
{
[JsonProperty("id")]
public int ID { get; set; }
public long ID { get; set; }
[JsonProperty("user")]
public User User { get; set; }

View File

@ -15,7 +15,7 @@ namespace osu.Game.Online.Rooms
public class PlaylistItem : IEquatable<PlaylistItem>
{
[JsonProperty("id")]
public int ID { get; set; }
public long ID { get; set; }
[JsonProperty("beatmap_id")]
public int BeatmapID { get; set; }

View File

@ -17,7 +17,7 @@ namespace osu.Game.Online.Rooms
{
[Cached]
[JsonProperty("id")]
public readonly Bindable<int?> RoomID = new Bindable<int?>();
public readonly Bindable<long?> RoomID = new Bindable<long?>();
[Cached]
[JsonProperty("name")]

View File

@ -7,11 +7,11 @@ namespace osu.Game.Online.Rooms
{
public class ShowPlaylistUserScoreRequest : APIRequest<MultiplayerScore>
{
private readonly int roomId;
private readonly int playlistItemId;
private readonly long roomId;
private readonly long playlistItemId;
private readonly long userId;
public ShowPlaylistUserScoreRequest(int roomId, int playlistItemId, long userId)
public ShowPlaylistUserScoreRequest(long roomId, long playlistItemId, long userId)
{
this.roomId = roomId;
this.playlistItemId = playlistItemId;

View File

@ -11,12 +11,12 @@ namespace osu.Game.Online.Rooms
{
public class SubmitRoomScoreRequest : APIRequest<MultiplayerScore>
{
private readonly int scoreId;
private readonly int roomId;
private readonly int playlistItemId;
private readonly long scoreId;
private readonly long roomId;
private readonly long playlistItemId;
private readonly ScoreInfo scoreInfo;
public SubmitRoomScoreRequest(int scoreId, int roomId, int playlistItemId, ScoreInfo scoreInfo)
public SubmitRoomScoreRequest(long scoreId, long roomId, long playlistItemId, ScoreInfo scoreInfo)
{
this.scoreId = scoreId;
this.roomId = roomId;

View File

@ -116,7 +116,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
joinedRoom.Value = null;
}
private readonly HashSet<int> ignoredRooms = new HashSet<int>();
private readonly HashSet<long> ignoredRooms = new HashSet<long>();
private void onRoomsReceived(List<Room> received)
{

View File

@ -11,7 +11,7 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components
public class MatchChatDisplay : StandAloneChatDisplay
{
[Resolved(typeof(Room), nameof(Room.RoomID))]
private Bindable<int?> roomId { get; set; }
private Bindable<long?> roomId { get; set; }
[Resolved(typeof(Room), nameof(Room.ChannelId))]
private Bindable<int> channelId { get; set; }

View File

@ -15,7 +15,7 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components
public class MatchLeaderboard : Leaderboard<MatchLeaderboardScope, APIUserScoreAggregate>
{
[Resolved(typeof(Room), nameof(Room.RoomID))]
private Bindable<int?> roomId { get; set; }
private Bindable<long?> roomId { get; set; }
[BackgroundDependencyLoader]
private void load()

View File

@ -357,7 +357,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
public class CreateOrUpdateButton : TriangleButton
{
[Resolved(typeof(Room), nameof(Room.RoomID))]
private Bindable<int?> roomId { get; set; }
private Bindable<long?> roomId { get; set; }
protected override void LoadComplete()
{

View File

@ -9,7 +9,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
{
public class MultiplayerResultsScreen : PlaylistsResultsScreen
{
public MultiplayerResultsScreen(ScoreInfo score, int roomId, PlaylistItem playlistItem)
public MultiplayerResultsScreen(ScoreInfo score, long roomId, PlaylistItem playlistItem)
: base(score, roomId, playlistItem, false, false)
{
}

View File

@ -13,7 +13,7 @@ namespace osu.Game.Screens.OnlinePlay
public class OnlinePlayComposite : CompositeDrawable
{
[Resolved(typeof(Room))]
protected Bindable<int?> RoomID { get; private set; }
protected Bindable<long?> RoomID { get; private set; }
[Resolved(typeof(Room), nameof(Room.Name))]
protected Bindable<string> RoomName { get; private set; }

View File

@ -24,7 +24,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
public Action Exited;
[Resolved(typeof(Room), nameof(Room.RoomID))]
protected Bindable<int?> RoomId { get; private set; }
protected Bindable<long?> RoomId { get; private set; }
protected readonly PlaylistItem PlaylistItem;

View File

@ -19,7 +19,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
{
public class PlaylistsResultsScreen : ResultsScreen
{
private readonly int roomId;
private readonly long roomId;
private readonly PlaylistItem playlistItem;
protected LoadingSpinner LeftSpinner { get; private set; }
@ -32,7 +32,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
[Resolved]
private IAPIProvider api { get; set; }
public PlaylistsResultsScreen(ScoreInfo score, int roomId, PlaylistItem playlistItem, bool allowRetry, bool allowWatchingReplay = true)
public PlaylistsResultsScreen(ScoreInfo score, long roomId, PlaylistItem playlistItem, bool allowRetry, bool allowWatchingReplay = true)
: base(score, allowRetry, allowWatchingReplay)
{
this.roomId = roomId;

View File

@ -25,7 +25,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
public override string ShortTitle => "playlist";
[Resolved(typeof(Room), nameof(Room.RoomID))]
private Bindable<int?> roomId { get; set; }
private Bindable<long?> roomId { get; set; }
private MatchSettingsOverlay settingsOverlay;
private MatchLeaderboard leaderboard;