ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15k stars 2.21k forks source link

Discord rich presence throws exception on some beatmaps #7311

Closed smoogipoo closed 4 years ago

smoogipoo commented 4 years ago

https://osu.ppy.sh/beatmapsets/874178#osu/1827120 https://osu.ppy.sh/beatmapsets/925343#osu/1932924

Throws the following exception upon entering gameplay:

2019-12-20 15:46:57: DiscordRPC.Exceptions.StringOutOfRangeException: Length of string is out of range. Expected a value with a maximum length of 128
2019-12-20 15:46:57: at DiscordRPC.RichPresence.set_Details(String value)
2019-12-20 15:46:57: at osu.Desktop.DiscordRichPresence.updateStatus()
2019-12-20 15:46:57: at osu.Desktop.DiscordRichPresence.<load>b__10_4(ValueChangedEvent`1 _)
2019-12-20 15:46:57: at osu.Framework.Bindables.Bindable`1.TriggerValueChange(T previousValue, Bindable`1 source, Boolean propagateToBindings, Boolean bypassChecks)
2019-12-20 15:46:57: at osu.Framework.Bindables.Bindable`1.TriggerValueChange(T previousValue, Bindable`1 source, Boolean propagateToBindings, Boolean bypassChecks)
2019-12-20 15:46:57: at osu.Framework.Bindables.Bindable`1.TriggerValueChange(T previousValue, Bindable`1 source, Boolean propagateToBindings, Boolean bypassChecks)
2019-12-20 15:46:57: at osu.Framework.Bindables.Bindable`1.set_Value(T value)
2019-12-20 15:46:57: at osu.Game.Screens.OsuScreen.updateActivity()
2019-12-20 15:46:57: at osu.Game.Screens.OsuScreen.set_Activity(UserActivity value)
2019-12-20 15:46:57: at osu.Game.Screens.OsuScreen.OnEntering(IScreen last)
2019-12-20 15:46:57: at osu.Game.Screens.Play.Player.OnEntering(IScreen last)
2019-12-20 15:46:57: at osu.Framework.Screens.ScreenStack.<>c__DisplayClass15_0.<Push>b__0(Drawable _)
2019-12-20 15:46:57: at osu.Framework.Graphics.Drawable.loadComplete()
2019-12-20 15:46:57: at osu.Framework.Graphics.Drawable.UpdateSubTree()

The game doesn't crash, Player finishes loading but does not continue playing the beatmap.

GSculerlor commented 4 years ago

Same problem that issued on #7305

smoogipoo commented 4 years ago

Ah I got sniped. Thanks.

peppy commented 4 years ago

Let's keep this one open. Better issue.

Game4all commented 4 years ago

What is stable behaviour for truncating beatmap info in rich presences when it exceeds the max length? Would a basic truncation of the string to 128 bits suffice?

peppy commented 4 years ago

see other truncation in lazer. should be able to work something out.