mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 04:13:00 +08:00
Merge pull request #11798 from smoogipoo/multiplayer-long-types
Use long type where required in multiplayer
This commit is contained in:
commit
86faa7f465
@ -22,7 +22,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
public double? PP { get; set; }
|
public double? PP { get; set; }
|
||||||
|
|
||||||
[JsonProperty(@"room_id")]
|
[JsonProperty(@"room_id")]
|
||||||
public int RoomID { get; set; }
|
public long RoomID { get; set; }
|
||||||
|
|
||||||
[JsonProperty("total_score")]
|
[JsonProperty("total_score")]
|
||||||
public long TotalScore { get; set; }
|
public long TotalScore { get; set; }
|
||||||
|
@ -95,7 +95,7 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
private Room? apiRoom;
|
private Room? apiRoom;
|
||||||
|
|
||||||
// Todo: This is temporary, until the multiplayer server returns the item id on match start or otherwise.
|
// Todo: This is temporary, until the multiplayer server returns the item id on match start or otherwise.
|
||||||
private int playlistItemId;
|
private long playlistItemId;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
|
@ -9,11 +9,11 @@ namespace osu.Game.Online.Rooms
|
|||||||
{
|
{
|
||||||
public class CreateRoomScoreRequest : APIRequest<APIScoreToken>
|
public class CreateRoomScoreRequest : APIRequest<APIScoreToken>
|
||||||
{
|
{
|
||||||
private readonly int roomId;
|
private readonly long roomId;
|
||||||
private readonly int playlistItemId;
|
private readonly long playlistItemId;
|
||||||
private readonly string versionHash;
|
private readonly string versionHash;
|
||||||
|
|
||||||
public CreateRoomScoreRequest(int roomId, int playlistItemId, string versionHash)
|
public CreateRoomScoreRequest(long roomId, long playlistItemId, string versionHash)
|
||||||
{
|
{
|
||||||
this.roomId = roomId;
|
this.roomId = roomId;
|
||||||
this.playlistItemId = playlistItemId;
|
this.playlistItemId = playlistItemId;
|
||||||
|
@ -7,9 +7,9 @@ namespace osu.Game.Online.Rooms
|
|||||||
{
|
{
|
||||||
public class GetRoomLeaderboardRequest : APIRequest<APILeaderboard>
|
public class GetRoomLeaderboardRequest : APIRequest<APILeaderboard>
|
||||||
{
|
{
|
||||||
private readonly int roomId;
|
private readonly long roomId;
|
||||||
|
|
||||||
public GetRoomLeaderboardRequest(int roomId)
|
public GetRoomLeaderboardRequest(long roomId)
|
||||||
{
|
{
|
||||||
this.roomId = roomId;
|
this.roomId = roomId;
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,9 @@ namespace osu.Game.Online.Rooms
|
|||||||
{
|
{
|
||||||
public class GetRoomRequest : APIRequest<Room>
|
public class GetRoomRequest : APIRequest<Room>
|
||||||
{
|
{
|
||||||
public readonly int RoomId;
|
public readonly long RoomId;
|
||||||
|
|
||||||
public GetRoomRequest(int roomId)
|
public GetRoomRequest(long roomId)
|
||||||
{
|
{
|
||||||
RoomId = roomId;
|
RoomId = roomId;
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,8 @@ namespace osu.Game.Online.Rooms
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class IndexPlaylistScoresRequest : APIRequest<IndexedMultiplayerScores>
|
public class IndexPlaylistScoresRequest : APIRequest<IndexedMultiplayerScores>
|
||||||
{
|
{
|
||||||
public readonly int RoomId;
|
public readonly long RoomId;
|
||||||
public readonly int PlaylistItemId;
|
public readonly long PlaylistItemId;
|
||||||
|
|
||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
public readonly Cursor Cursor;
|
public readonly Cursor Cursor;
|
||||||
@ -24,13 +24,13 @@ namespace osu.Game.Online.Rooms
|
|||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
public readonly IndexScoresParams IndexParams;
|
public readonly IndexScoresParams IndexParams;
|
||||||
|
|
||||||
public IndexPlaylistScoresRequest(int roomId, int playlistItemId)
|
public IndexPlaylistScoresRequest(long roomId, long playlistItemId)
|
||||||
{
|
{
|
||||||
RoomId = roomId;
|
RoomId = roomId;
|
||||||
PlaylistItemId = playlistItemId;
|
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)
|
: this(roomId, playlistItemId)
|
||||||
{
|
{
|
||||||
Cursor = cursor;
|
Cursor = cursor;
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Online.Rooms
|
|||||||
public class MultiplayerScore
|
public class MultiplayerScore
|
||||||
{
|
{
|
||||||
[JsonProperty("id")]
|
[JsonProperty("id")]
|
||||||
public int ID { get; set; }
|
public long ID { get; set; }
|
||||||
|
|
||||||
[JsonProperty("user")]
|
[JsonProperty("user")]
|
||||||
public User User { get; set; }
|
public User User { get; set; }
|
||||||
|
@ -15,7 +15,7 @@ namespace osu.Game.Online.Rooms
|
|||||||
public class PlaylistItem : IEquatable<PlaylistItem>
|
public class PlaylistItem : IEquatable<PlaylistItem>
|
||||||
{
|
{
|
||||||
[JsonProperty("id")]
|
[JsonProperty("id")]
|
||||||
public int ID { get; set; }
|
public long ID { get; set; }
|
||||||
|
|
||||||
[JsonProperty("beatmap_id")]
|
[JsonProperty("beatmap_id")]
|
||||||
public int BeatmapID { get; set; }
|
public int BeatmapID { get; set; }
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Online.Rooms
|
|||||||
{
|
{
|
||||||
[Cached]
|
[Cached]
|
||||||
[JsonProperty("id")]
|
[JsonProperty("id")]
|
||||||
public readonly Bindable<int?> RoomID = new Bindable<int?>();
|
public readonly Bindable<long?> RoomID = new Bindable<long?>();
|
||||||
|
|
||||||
[Cached]
|
[Cached]
|
||||||
[JsonProperty("name")]
|
[JsonProperty("name")]
|
||||||
|
@ -7,11 +7,11 @@ namespace osu.Game.Online.Rooms
|
|||||||
{
|
{
|
||||||
public class ShowPlaylistUserScoreRequest : APIRequest<MultiplayerScore>
|
public class ShowPlaylistUserScoreRequest : APIRequest<MultiplayerScore>
|
||||||
{
|
{
|
||||||
private readonly int roomId;
|
private readonly long roomId;
|
||||||
private readonly int playlistItemId;
|
private readonly long playlistItemId;
|
||||||
private readonly long userId;
|
private readonly long userId;
|
||||||
|
|
||||||
public ShowPlaylistUserScoreRequest(int roomId, int playlistItemId, long userId)
|
public ShowPlaylistUserScoreRequest(long roomId, long playlistItemId, long userId)
|
||||||
{
|
{
|
||||||
this.roomId = roomId;
|
this.roomId = roomId;
|
||||||
this.playlistItemId = playlistItemId;
|
this.playlistItemId = playlistItemId;
|
||||||
|
@ -11,12 +11,12 @@ namespace osu.Game.Online.Rooms
|
|||||||
{
|
{
|
||||||
public class SubmitRoomScoreRequest : APIRequest<MultiplayerScore>
|
public class SubmitRoomScoreRequest : APIRequest<MultiplayerScore>
|
||||||
{
|
{
|
||||||
private readonly int scoreId;
|
private readonly long scoreId;
|
||||||
private readonly int roomId;
|
private readonly long roomId;
|
||||||
private readonly int playlistItemId;
|
private readonly long playlistItemId;
|
||||||
private readonly ScoreInfo scoreInfo;
|
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.scoreId = scoreId;
|
||||||
this.roomId = roomId;
|
this.roomId = roomId;
|
||||||
|
@ -116,7 +116,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
|||||||
joinedRoom.Value = null;
|
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)
|
private void onRoomsReceived(List<Room> received)
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components
|
|||||||
public class MatchChatDisplay : StandAloneChatDisplay
|
public class MatchChatDisplay : StandAloneChatDisplay
|
||||||
{
|
{
|
||||||
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
||||||
private Bindable<int?> roomId { get; set; }
|
private Bindable<long?> roomId { get; set; }
|
||||||
|
|
||||||
[Resolved(typeof(Room), nameof(Room.ChannelId))]
|
[Resolved(typeof(Room), nameof(Room.ChannelId))]
|
||||||
private Bindable<int> channelId { get; set; }
|
private Bindable<int> channelId { get; set; }
|
||||||
|
@ -15,7 +15,7 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components
|
|||||||
public class MatchLeaderboard : Leaderboard<MatchLeaderboardScope, APIUserScoreAggregate>
|
public class MatchLeaderboard : Leaderboard<MatchLeaderboardScope, APIUserScoreAggregate>
|
||||||
{
|
{
|
||||||
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
||||||
private Bindable<int?> roomId { get; set; }
|
private Bindable<long?> roomId { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
|
@ -357,7 +357,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
public class CreateOrUpdateButton : TriangleButton
|
public class CreateOrUpdateButton : TriangleButton
|
||||||
{
|
{
|
||||||
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
||||||
private Bindable<int?> roomId { get; set; }
|
private Bindable<long?> roomId { get; set; }
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
{
|
{
|
||||||
public class MultiplayerResultsScreen : PlaylistsResultsScreen
|
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)
|
: base(score, roomId, playlistItem, false, false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
public class OnlinePlayComposite : CompositeDrawable
|
public class OnlinePlayComposite : CompositeDrawable
|
||||||
{
|
{
|
||||||
[Resolved(typeof(Room))]
|
[Resolved(typeof(Room))]
|
||||||
protected Bindable<int?> RoomID { get; private set; }
|
protected Bindable<long?> RoomID { get; private set; }
|
||||||
|
|
||||||
[Resolved(typeof(Room), nameof(Room.Name))]
|
[Resolved(typeof(Room), nameof(Room.Name))]
|
||||||
protected Bindable<string> RoomName { get; private set; }
|
protected Bindable<string> RoomName { get; private set; }
|
||||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
public Action Exited;
|
public Action Exited;
|
||||||
|
|
||||||
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
||||||
protected Bindable<int?> RoomId { get; private set; }
|
protected Bindable<long?> RoomId { get; private set; }
|
||||||
|
|
||||||
protected readonly PlaylistItem PlaylistItem;
|
protected readonly PlaylistItem PlaylistItem;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
{
|
{
|
||||||
public class PlaylistsResultsScreen : ResultsScreen
|
public class PlaylistsResultsScreen : ResultsScreen
|
||||||
{
|
{
|
||||||
private readonly int roomId;
|
private readonly long roomId;
|
||||||
private readonly PlaylistItem playlistItem;
|
private readonly PlaylistItem playlistItem;
|
||||||
|
|
||||||
protected LoadingSpinner LeftSpinner { get; private set; }
|
protected LoadingSpinner LeftSpinner { get; private set; }
|
||||||
@ -32,7 +32,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private IAPIProvider api { get; set; }
|
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)
|
: base(score, allowRetry, allowWatchingReplay)
|
||||||
{
|
{
|
||||||
this.roomId = roomId;
|
this.roomId = roomId;
|
||||||
|
@ -25,7 +25,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
public override string ShortTitle => "playlist";
|
public override string ShortTitle => "playlist";
|
||||||
|
|
||||||
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
||||||
private Bindable<int?> roomId { get; set; }
|
private Bindable<long?> roomId { get; set; }
|
||||||
|
|
||||||
private MatchSettingsOverlay settingsOverlay;
|
private MatchSettingsOverlay settingsOverlay;
|
||||||
private MatchLeaderboard leaderboard;
|
private MatchLeaderboard leaderboard;
|
||||||
|
Loading…
Reference in New Issue
Block a user