mirror of
https://github.com/ppy/osu
synced 2025-01-22 05:43:14 +00: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
|
||||
{
|
||||
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]
|
||||
[Column("UserID")]
|
||||
public long UserID
|
||||
{
|
||||
get => User?.Id ?? 1;
|
||||
set => User = new User {Username = UserString, Id = value};
|
||||
get => User.Id;
|
||||
set
|
||||
{
|
||||
if (User == null)
|
||||
User = new User { Username = UserString, Id = value };
|
||||
else
|
||||
User.Id = value;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
|
Loading…
Reference in New Issue
Block a user