Removed ruleset rankings request from DiscordRichPresence.cs

This commit is contained in:
tornac1234 2022-06-01 12:05:24 +02:00
parent bcee9ac438
commit caa29e1f9e
1 changed files with 1 additions and 22 deletions

View File

@ -12,7 +12,6 @@
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Extensions; using osu.Game.Extensions;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Users; using osu.Game.Users;
@ -81,7 +80,7 @@ private void load(OsuConfigManager config)
private void onReady(object _, ReadyMessage __) private void onReady(object _, ReadyMessage __)
{ {
Logger.Log("Discord RPC Client ready.", LoggingTarget.Network, LogLevel.Debug); Logger.Log("Discord RPC Client ready.", LoggingTarget.Network, LogLevel.Debug);
requestUserRulesetsRankings(); updateStatus();
} }
private void updateStatus() private void updateStatus()
@ -124,26 +123,6 @@ private void updateStatus()
client.SetPresence(presence); client.SetPresence(presence);
} }
private void requestUserRulesetsRankings()
{
RulesetInfo cachedRuleset = ruleset.Value;
var req = new GetUsersRequest(new int[] { provider.LocalUser.Value.Id });
req.Success += result =>
{
if (result.Users.Count == 1)
{
APIUser apiUser = result.Users[0];
user.Value.RulesetsStatistics = apiUser.RulesetsStatistics;
}
updateStatus();
};
req.Failure += _ => updateStatus();
provider.Queue(req);
}
private static readonly int ellipsis_length = Encoding.UTF8.GetByteCount(new[] { '…' }); private static readonly int ellipsis_length = Encoding.UTF8.GetByteCount(new[] { '…' });
private string truncate(string str) private string truncate(string str)