15
15
using osu . Game . Beatmaps ;
16
16
using osu . Game . Input . Handlers ;
17
17
using osu . Game . Screens . Play ;
18
+ using osu . Game . Utils ;
18
19
19
20
namespace osu . Game . Rulesets . UI
20
21
{
@@ -29,6 +30,7 @@ public sealed partial class FrameStabilityContainer : Container, IHasReplayHandl
29
30
public ReplayInputHandler ? ReplayInputHandler { get ; set ; }
30
31
31
32
public bool AllowBackwardsSeeks { get ; set ; }
33
+ private double ? lastBackwardsSeekLogTime ;
32
34
33
35
/// <summary>
34
36
/// The number of CPU milliseconds to spend at most during seek catch-up.
@@ -163,10 +165,17 @@ private void updateClock()
163
165
// time should never go backwards". If it does, we stop running gameplay until it returns to normal.
164
166
if ( ! hasReplayAttached && FrameStablePlayback && proposedTime > referenceClock . CurrentTime && ! AllowBackwardsSeeks )
165
167
{
166
- Logger . Log ( $ "Denying backwards seek during gameplay (reference: { referenceClock . CurrentTime : N2} stable: { proposedTime : N2} )") ;
168
+ if ( lastBackwardsSeekLogTime == null || Math . Abs ( Clock . CurrentTime - lastBackwardsSeekLogTime . Value ) > 1000 )
169
+ {
170
+ lastBackwardsSeekLogTime = Clock . CurrentTime ;
171
+
172
+ string loggableContent = $ "Denying backwards seek during gameplay (reference: { referenceClock . CurrentTime : N2} stable: { proposedTime : N2} )";
167
173
168
- if ( parentGameplayClock is GameplayClockContainer gcc )
169
- Logger . Log ( $ "{ gcc . ChildrenOfType < FramedBeatmapClock > ( ) . Single ( ) . GetSnapshot ( ) } ") ;
174
+ if ( parentGameplayClock is GameplayClockContainer gcc )
175
+ loggableContent += $ "\n { gcc . ChildrenOfType < FramedBeatmapClock > ( ) . Single ( ) . GetSnapshot ( ) } ";
176
+
177
+ Logger . Error ( new SentryOnlyDiagnosticsException ( "backwards seek" ) , loggableContent ) ;
178
+ }
170
179
171
180
state = PlaybackState . NotValid ;
172
181
return ;
0 commit comments