mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:18:22 +08:00
Simplify population logic and match code style
This commit is contained in:
parent
09bfca4e4a
commit
4f009419b8
@ -8,7 +8,6 @@ using System.Threading;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Models;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.IO.Archives;
|
||||
@ -80,19 +79,12 @@ namespace osu.Game.Scoring
|
||||
{
|
||||
base.PostImport(model, realm);
|
||||
|
||||
var userRequest = new GetUserRequest(model.User.Username);
|
||||
api.Perform(userRequest);
|
||||
APIUser userReq = userRequest.Response;
|
||||
var userRequest = new GetUserRequest(model.RealmUser.Username);
|
||||
|
||||
if (!(userReq is null)) {
|
||||
Logger.Log($"Assignning UserID to RealmUser");
|
||||
var user = new RealmUser
|
||||
{
|
||||
OnlineID = userReq.Id,
|
||||
Username = model.User.Username
|
||||
};
|
||||
model.RealmUser = user;
|
||||
}
|
||||
api.Perform(userRequest);
|
||||
|
||||
if (userRequest.Response is APIUser user)
|
||||
model.RealmUser.OnlineID = user.Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user