1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 00:02:54 +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)
{
((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,

View File

@ -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;

View File

@ -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;
}

View File

@ -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; }

View File

@ -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
{

View File

@ -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.

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)
{

View File

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

View File

@ -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;