1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 18:53:21 +08:00

Use int instead of long for user_id fields for now

This commit is contained in:
Dean Herbert 2020-11-06 12:40:54 +09:00
parent 3e652fdf9c
commit 1e1569eb53
9 changed files with 12 additions and 12 deletions

View File

@ -250,7 +250,7 @@ namespace osu.Game.Tests.Visual.Gameplay
public void EndPlay(int beatmapId) public void EndPlay(int beatmapId)
{ {
((ISpectatorClient)this).UserFinishedPlaying((int)StreamingUser.Id, new SpectatorState ((ISpectatorClient)this).UserFinishedPlaying(StreamingUser.Id, new SpectatorState
{ {
BeatmapID = beatmapId, BeatmapID = beatmapId,
RulesetID = 0, RulesetID = 0,
@ -273,7 +273,7 @@ namespace osu.Game.Tests.Visual.Gameplay
} }
var bundle = new FrameDataBundle(frames); var bundle = new FrameDataBundle(frames);
((ISpectatorClient)this).UserSentFrames((int)StreamingUser.Id, bundle); ((ISpectatorClient)this).UserSentFrames(StreamingUser.Id, bundle);
if (!sentState) if (!sentState)
sendState(beatmapId); sendState(beatmapId);
@ -293,7 +293,7 @@ namespace osu.Game.Tests.Visual.Gameplay
private void sendState(int beatmapId) private void sendState(int beatmapId)
{ {
sentState = true; sentState = true;
((ISpectatorClient)this).UserBeganPlaying((int)StreamingUser.Id, new SpectatorState ((ISpectatorClient)this).UserBeganPlaying(StreamingUser.Id, new SpectatorState
{ {
BeatmapID = beatmapId, BeatmapID = beatmapId,
RulesetID = 0, RulesetID = 0,

View File

@ -277,7 +277,7 @@ namespace osu.Game.Tournament.Screens.Editors
userId.Value = user.Id.ToString(); userId.Value = user.Id.ToString();
userId.BindValueChanged(idString => userId.BindValueChanged(idString =>
{ {
long.TryParse(idString.NewValue, out var parsed); int.TryParse(idString.NewValue, out var parsed);
user.Id = parsed; user.Id = parsed;

View File

@ -61,7 +61,7 @@ namespace osu.Game.Online.API.Requests.Responses
private int[] ratings { get; set; } private int[] ratings { get; set; }
[JsonProperty(@"user_id")] [JsonProperty(@"user_id")]
private long creatorId private int creatorId
{ {
set => Author.Id = value; set => Author.Id = value;
} }

View File

@ -20,7 +20,7 @@ namespace osu.Game.Online.API.Requests.Responses
public string OsuUsername { get; set; } public string OsuUsername { get; set; }
[JsonProperty("user_id")] [JsonProperty("user_id")]
public long? UserId { get; set; } public int? UserId { get; set; }
[JsonProperty("user_url")] [JsonProperty("user_url")]
public string UserUrl { get; set; } public string UserUrl { get; set; }

View File

@ -22,7 +22,7 @@ namespace osu.Game.Online.Chat
public readonly ObservableCollection<User> Users = new ObservableCollection<User>(); public readonly ObservableCollection<User> Users = new ObservableCollection<User>();
[JsonProperty(@"users")] [JsonProperty(@"users")]
private long[] userIds private int[] userIds
{ {
set set
{ {

View File

@ -278,7 +278,7 @@ namespace osu.Game
break; break;
case LinkAction.OpenUserProfile: case LinkAction.OpenUserProfile:
if (long.TryParse(link.Argument, out long userId)) if (int.TryParse(link.Argument, out int userId))
ShowUser(userId); ShowUser(userId);
break; break;
@ -321,7 +321,7 @@ namespace osu.Game
/// Show a user's profile as an overlay. /// Show a user's profile as an overlay.
/// </summary> /// </summary>
/// <param name="userId">The user to display.</param> /// <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> /// <summary>
/// Show a beatmap's set as an overlay, displaying the given beatmap. /// Show a beatmap's set as an overlay, displaying the given beatmap.

View File

@ -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) public void ShowUser(User user, bool fetchOnline = true)
{ {

View File

@ -123,7 +123,7 @@ namespace osu.Game.Scoring
[JsonIgnore] [JsonIgnore]
[Column("UserID")] [Column("UserID")]
public long? UserID public int? UserID
{ {
get => User?.Id ?? 1; get => User?.Id ?? 1;
set set

View File

@ -12,7 +12,7 @@ namespace osu.Game.Users
public class User : IEquatable<User> public class User : IEquatable<User>
{ {
[JsonProperty(@"id")] [JsonProperty(@"id")]
public long Id = 1; public int Id = 1;
[JsonProperty(@"join_date")] [JsonProperty(@"join_date")]
public DateTimeOffset JoinDate; public DateTimeOffset JoinDate;