mirror of
https://github.com/ppy/osu.git
synced 2024-11-12 05:27:40 +08:00
Merge pull request #18300 from peppy/add-ruleset-context-tags
Add ruleset context to sentry error reports
This commit is contained in:
commit
ff85ce84ec
@ -1207,6 +1207,8 @@ namespace osu.Game
|
||||
Current = newScreen?.GetType().ReadableName(),
|
||||
Previous = current?.GetType().ReadableName(),
|
||||
};
|
||||
|
||||
scope.SetTag(@"screen", newScreen?.GetType().ReadableName() ?? @"none");
|
||||
});
|
||||
|
||||
switch (newScreen)
|
||||
|
@ -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
|
||||
{
|
||||
@ -125,6 +127,8 @@ namespace osu.Game.Utils
|
||||
BeatmapSets = realm.All<BeatmapSetInfo>().Count(),
|
||||
Beatmaps = realm.All<BeatmapInfo>().Count(),
|
||||
Files = realm.All<RealmFile>().Count(),
|
||||
Rulesets = realm.All<RulesetInfo>().Count(),
|
||||
RulesetsAvailable = realm.All<RulesetInfo>().Count(r => r.Available),
|
||||
Skins = realm.All<SkinInfo>().Count(),
|
||||
}
|
||||
};
|
||||
@ -137,14 +141,25 @@ namespace osu.Game.Utils
|
||||
scope.Contexts[@"beatmap"] = new
|
||||
{
|
||||
Name = beatmap.ToString(),
|
||||
Ruleset = beatmap.Ruleset.InstantiationInfo,
|
||||
beatmap.OnlineID,
|
||||
};
|
||||
|
||||
scope.Contexts[@"ruleset"] = new
|
||||
{
|
||||
ruleset.ShortName,
|
||||
ruleset.Name,
|
||||
ruleset.InstantiationInfo,
|
||||
ruleset.OnlineID
|
||||
};
|
||||
|
||||
scope.Contexts[@"clocks"] = new
|
||||
{
|
||||
Audio = game.Dependencies.Get<MusicController>().CurrentTrack.CurrentTime,
|
||||
Game = game.Clock.CurrentTime,
|
||||
};
|
||||
|
||||
scope.SetTag(@"ruleset", ruleset.ShortName);
|
||||
});
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user