1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:47:26 +08:00

Merge branch 'master' into file-count-fix

This commit is contained in:
Dean Herbert 2017-09-18 10:43:49 +09:00 committed by GitHub
commit 067dac495f
5 changed files with 26 additions and 29 deletions

View File

@ -100,7 +100,7 @@ namespace osu.Desktop.Deploy
updateAssemblyInfo(version);
write("Running build process...");
runCommand(msbuild_path, $"/v:quiet /m /t:{TargetName.Replace('.', '_')} /p:OutputPath={stagingPath};Configuration=Release {SolutionName}.sln");
runCommand(msbuild_path, $"/v:quiet /m /t:{TargetName.Replace('.', '_')} /p:OutputPath={stagingPath};Targets=\"Clean;Build\";Configuration=Release {SolutionName}.sln");
write("Creating NuGet deployment package...");
runCommand(nuget_path, $"pack {NuSpecName} -Version {version} -Properties Configuration=Deploy -OutputDirectory {stagingPath} -BasePath {stagingPath}");

View File

@ -27,42 +27,45 @@ namespace osu.Game.Online.API
internal bool AuthenticateWithLogin(string username, string password)
{
var req = new AccessTokenRequestPassword(username, password)
using (var req = new AccessTokenRequestPassword(username, password)
{
Url = $@"{endpoint}/oauth/token",
Method = HttpMethod.POST,
ClientId = clientId,
ClientSecret = clientSecret
};
try
})
{
req.BlockingPerform();
}
catch
{
return false;
}
try
{
req.BlockingPerform();
}
catch
{
return false;
}
Token = req.ResponseObject;
return true;
Token = req.ResponseObject;
return true;
}
}
internal bool AuthenticateWithRefresh(string refresh)
{
try
{
var req = new AccessTokenRequestRefresh(refresh)
using (var req = new AccessTokenRequestRefresh(refresh)
{
Url = $@"{endpoint}/oauth/token",
Method = HttpMethod.POST,
ClientId = clientId,
ClientSecret = clientSecret
};
req.BlockingPerform();
})
{
req.BlockingPerform();
Token = req.ResponseObject;
return true;
Token = req.ResponseObject;
return true;
}
}
catch
{

View File

@ -5,7 +5,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using osu.Framework.IO.Network;
using osu.Game.Beatmaps;
using osu.Game.Users;
using osu.Game.Rulesets.Replays;
@ -19,6 +18,9 @@ namespace osu.Game.Online.API.Requests
public GetScoresRequest(BeatmapInfo beatmap)
{
if (!beatmap.OnlineBeatmapID.HasValue)
throw new InvalidOperationException($"Cannot lookup a beatmap's scores without having a populated {nameof(BeatmapInfo.OnlineBeatmapID)}.");
this.beatmap = beatmap;
Success += onSuccess;
@ -30,14 +32,6 @@ namespace osu.Game.Online.API.Requests
score.ApplyBeatmap(beatmap);
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
//req.AddParameter(@"c", beatmap.Hash);
//req.AddParameter(@"f", beatmap.Path);
return req;
}
protected override string Target => $@"beatmaps/{beatmap.OnlineBeatmapID}/scores";
}

View File

@ -108,7 +108,7 @@ namespace osu.Game.Screens.Play
private void pushWhenLoaded()
{
if (!player.IsLoaded)
if (player.LoadState != LoadState.Ready)
{
Schedule(pushWhenLoaded);
return;

View File

@ -130,7 +130,7 @@ namespace osu.Game.Screens.Select.Leaderboards
Scores = null;
getScoresRequest?.Cancel();
if (api == null || Beatmap == null) return;
if (api == null || Beatmap?.OnlineBeatmapID == null) return;
loading.Show();