mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 20:22:55 +08:00
Merge pull request #10710 from peppy/user-id-as-int
Use int instead of long for user_id fields for now
This commit is contained in:
commit
972fc54c2d
@ -250,7 +250,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
public void EndPlay(int beatmapId)
|
||||
{
|
||||
((ISpectatorClient)this).UserFinishedPlaying((int)StreamingUser.Id, new SpectatorState
|
||||
((ISpectatorClient)this).UserFinishedPlaying(StreamingUser.Id, new SpectatorState
|
||||
{
|
||||
BeatmapID = beatmapId,
|
||||
RulesetID = 0,
|
||||
@ -273,7 +273,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
}
|
||||
|
||||
var bundle = new FrameDataBundle(frames);
|
||||
((ISpectatorClient)this).UserSentFrames((int)StreamingUser.Id, bundle);
|
||||
((ISpectatorClient)this).UserSentFrames(StreamingUser.Id, bundle);
|
||||
|
||||
if (!sentState)
|
||||
sendState(beatmapId);
|
||||
@ -293,7 +293,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
private void sendState(int beatmapId)
|
||||
{
|
||||
sentState = true;
|
||||
((ISpectatorClient)this).UserBeganPlaying((int)StreamingUser.Id, new SpectatorState
|
||||
((ISpectatorClient)this).UserBeganPlaying(StreamingUser.Id, new SpectatorState
|
||||
{
|
||||
BeatmapID = beatmapId,
|
||||
RulesetID = 0,
|
||||
|
@ -277,7 +277,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
userId.Value = user.Id.ToString();
|
||||
userId.BindValueChanged(idString =>
|
||||
{
|
||||
long.TryParse(idString.NewValue, out var parsed);
|
||||
int.TryParse(idString.NewValue, out var parsed);
|
||||
|
||||
user.Id = parsed;
|
||||
|
||||
|
@ -61,7 +61,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
private int[] ratings { get; set; }
|
||||
|
||||
[JsonProperty(@"user_id")]
|
||||
private long creatorId
|
||||
private int creatorId
|
||||
{
|
||||
set => Author.Id = value;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
public string OsuUsername { get; set; }
|
||||
|
||||
[JsonProperty("user_id")]
|
||||
public long? UserId { get; set; }
|
||||
public int? UserId { get; set; }
|
||||
|
||||
[JsonProperty("user_url")]
|
||||
public string UserUrl { get; set; }
|
||||
|
@ -22,7 +22,7 @@ namespace osu.Game.Online.Chat
|
||||
public readonly ObservableCollection<User> Users = new ObservableCollection<User>();
|
||||
|
||||
[JsonProperty(@"users")]
|
||||
private long[] userIds
|
||||
private int[] userIds
|
||||
{
|
||||
set
|
||||
{
|
||||
|
@ -278,7 +278,7 @@ namespace osu.Game
|
||||
break;
|
||||
|
||||
case LinkAction.OpenUserProfile:
|
||||
if (long.TryParse(link.Argument, out long userId))
|
||||
if (int.TryParse(link.Argument, out int userId))
|
||||
ShowUser(userId);
|
||||
break;
|
||||
|
||||
@ -321,7 +321,7 @@ namespace osu.Game
|
||||
/// Show a user's profile as an overlay.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user to display.</param>
|
||||
public void ShowUser(long userId) => waitForReady(() => userProfile, _ => userProfile.ShowUser(userId));
|
||||
public void ShowUser(int userId) => waitForReady(() => userProfile, _ => userProfile.ShowUser(userId));
|
||||
|
||||
/// <summary>
|
||||
/// Show a beatmap's set as an overlay, displaying the given beatmap.
|
||||
|
@ -59,7 +59,7 @@ namespace osu.Game.Overlays.Dashboard
|
||||
var request = new GetUserRequest(u);
|
||||
request.Success += user => Schedule(() =>
|
||||
{
|
||||
if (playingUsers.Contains((int)user.Id))
|
||||
if (playingUsers.Contains(user.Id))
|
||||
userFlow.Add(createUserPanel(user));
|
||||
});
|
||||
api.Queue(request);
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
}
|
||||
|
||||
public void ShowUser(long userId) => ShowUser(new User { Id = userId });
|
||||
public void ShowUser(int userId) => ShowUser(new User { Id = userId });
|
||||
|
||||
public void ShowUser(User user, bool fetchOnline = true)
|
||||
{
|
||||
|
@ -123,7 +123,7 @@ namespace osu.Game.Scoring
|
||||
|
||||
[JsonIgnore]
|
||||
[Column("UserID")]
|
||||
public long? UserID
|
||||
public int? UserID
|
||||
{
|
||||
get => User?.Id ?? 1;
|
||||
set
|
||||
|
@ -182,7 +182,7 @@ namespace osu.Game.Screens.Play
|
||||
spectatorStreaming.OnUserFinishedPlaying += userFinishedPlaying;
|
||||
spectatorStreaming.OnNewFrames += userSentFrames;
|
||||
|
||||
spectatorStreaming.WatchUser((int)targetUser.Id);
|
||||
spectatorStreaming.WatchUser(targetUser.Id);
|
||||
|
||||
managerUpdated = beatmaps.ItemUpdated.GetBoundCopy();
|
||||
managerUpdated.BindValueChanged(beatmapUpdated);
|
||||
@ -353,7 +353,7 @@ namespace osu.Game.Screens.Play
|
||||
spectatorStreaming.OnUserFinishedPlaying -= userFinishedPlaying;
|
||||
spectatorStreaming.OnNewFrames -= userSentFrames;
|
||||
|
||||
spectatorStreaming.StopWatchingUser((int)targetUser.Id);
|
||||
spectatorStreaming.StopWatchingUser(targetUser.Id);
|
||||
}
|
||||
|
||||
managerUpdated?.UnbindAll();
|
||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Users
|
||||
public class User : IEquatable<User>
|
||||
{
|
||||
[JsonProperty(@"id")]
|
||||
public long Id = 1;
|
||||
public int Id = 1;
|
||||
|
||||
[JsonProperty(@"join_date")]
|
||||
public DateTimeOffset JoinDate;
|
||||
|
Loading…
Reference in New Issue
Block a user