mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 03:22:54 +08:00
Check if a user exists before creating new user
This commit is contained in:
parent
809ab86ed0
commit
8da671fa6c
@ -109,15 +109,27 @@ namespace osu.Game.Scoring
|
|||||||
public string UserString
|
public string UserString
|
||||||
{
|
{
|
||||||
get => User?.Username;
|
get => User?.Username;
|
||||||
set => User = new User { Username = value, Id = UserID};
|
set
|
||||||
|
{
|
||||||
|
if (User == null)
|
||||||
|
User = new User { Username = value, Id = UserID };
|
||||||
|
else
|
||||||
|
User.Username = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[Column("UserID")]
|
[Column("UserID")]
|
||||||
public long UserID
|
public long UserID
|
||||||
{
|
{
|
||||||
get => User?.Id ?? 1;
|
get => User.Id;
|
||||||
set => User = new User {Username = UserString, Id = value};
|
set
|
||||||
|
{
|
||||||
|
if (User == null)
|
||||||
|
User = new User { Username = UserString, Id = value };
|
||||||
|
else
|
||||||
|
User.Id = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
Loading…
Reference in New Issue
Block a user