From e8bcb52612d13667ef93842d570384c225297e43 Mon Sep 17 00:00:00 2001 From: Roman Kapustin Date: Sat, 28 Dec 2019 18:07:55 +0300 Subject: [PATCH 1/3] Set UserAgent for API requests --- osu.Game/Online/API/APIRequest.cs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/osu.Game/Online/API/APIRequest.cs b/osu.Game/Online/API/APIRequest.cs index fcbd4d314a..0956c749a2 100644 --- a/osu.Game/Online/API/APIRequest.cs +++ b/osu.Game/Online/API/APIRequest.cs @@ -14,7 +14,7 @@ namespace osu.Game.Online.API /// Type of the response (used for deserialisation). public abstract class APIRequest : APIRequest { - protected override WebRequest CreateWebRequest() => new JsonWebRequest(Uri); + protected override WebRequest CreateWebRequest() => new OsuJsonWebRequest(Uri); public T Result => ((JsonWebRequest)WebRequest).ResponseObject; @@ -30,6 +30,16 @@ namespace osu.Game.Online.API /// This will be scheduled to the API's internal scheduler (run on update thread automatically). /// public new event APISuccessHandler Success; + + private class OsuJsonWebRequest : JsonWebRequest + { + public OsuJsonWebRequest(string uri) + : base(uri) + { + } + + protected override string UserAgent => "osu!"; + } } /// @@ -39,7 +49,7 @@ namespace osu.Game.Online.API { protected abstract string Target { get; } - protected virtual WebRequest CreateWebRequest() => new WebRequest(Uri); + protected virtual WebRequest CreateWebRequest() => new OsuWebRequest(Uri); protected virtual string Uri => $@"{API.Endpoint}/api/v2/{Target}"; @@ -152,6 +162,16 @@ namespace osu.Game.Online.API [JsonProperty("error")] public string ErrorMessage { get; set; } } + + private class OsuWebRequest : WebRequest + { + public OsuWebRequest(string uri) + : base(uri) + { + } + + protected override string UserAgent => "osu!"; + } } public class APIException : InvalidOperationException From e9b57de76f245adc7a0dfc4d11384c07e9c65a6d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Jan 2020 17:23:17 +0900 Subject: [PATCH 2/3] Update framework --- osu.Android.props | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index 0b41d5cda4..e1e6f2e478 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -54,6 +54,6 @@ - + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 565608b40f..b497133e62 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -23,7 +23,7 @@ - + diff --git a/osu.iOS.props b/osu.iOS.props index 60355b8592..edd35b0774 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -74,7 +74,7 @@ - + @@ -82,7 +82,7 @@ - + From e33de0c2e423e2ae7a44c19797c40096f7ec6c7f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 7 Jan 2020 15:14:09 +0800 Subject: [PATCH 3/3] Fix ScrollContainer crashes --- osu.Game/Graphics/Containers/OsuScrollContainer.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuScrollContainer.cs b/osu.Game/Graphics/Containers/OsuScrollContainer.cs index ab72276ad0..cfd459da5e 100644 --- a/osu.Game/Graphics/Containers/OsuScrollContainer.cs +++ b/osu.Game/Graphics/Containers/OsuScrollContainer.cs @@ -123,8 +123,6 @@ namespace osu.Game.Graphics.Containers Masking = true; Child = box = new Box { RelativeSizeAxes = Axes.Both }; - - ResizeTo(1); } [BackgroundDependencyLoader]