1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 20:23:00 +08:00

Add ruleset context to sentry error reports

This commit is contained in:
Dean Herbert 2022-05-16 15:47:00 +09:00
parent 328561f5c8
commit 8c9edee360

View File

@ -18,6 +18,7 @@ using osu.Game.Database;
using osu.Game.Models;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays;
using osu.Game.Rulesets;
using osu.Game.Skinning;
using Sentry;
using Sentry.Protocol;
@ -109,6 +110,7 @@ namespace osu.Game.Utils
}, scope =>
{
var beatmap = game.Dependencies.Get<IBindable<WorkingBeatmap>>().Value.BeatmapInfo;
var ruleset = game.Dependencies.Get<IBindable<RulesetInfo>>().Value;
scope.Contexts[@"config"] = new
{
@ -137,9 +139,17 @@ namespace osu.Game.Utils
scope.Contexts[@"beatmap"] = new
{
Name = beatmap.ToString(),
Ruleset = beatmap.Ruleset.InstantiationInfo,
beatmap.OnlineID,
};
scope.Contexts[@"ruleset"] = new
{
ruleset.Name,
ruleset.InstantiationInfo,
ruleset.OnlineID
};
scope.Contexts[@"clocks"] = new
{
Audio = game.Dependencies.Get<MusicController>().CurrentTrack.CurrentTime,