Skip to content

Commit 9ac1ad2

Browse files
author
Bartłomiej Dach
authored
Reduce log spam from spectator client when playing offline (ppy#37316)
Noticed in passing when doing something else.
1 parent c2ed2f7 commit 9ac1ad2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

osu.Game/Online/Spectator/SpectatorClient.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,11 @@ public void BeginPlaying(long? scoreToken, GameplayState state, Score score)
232232

233233
if (!success)
234234
{
235-
Logger.Log($"Clearing {nameof(SpectatorClient)} state due to failed {nameof(BeginPlayingInternal)} call.");
236235
Schedule(() =>
237236
{
237+
if (IsConnected.Value)
238+
Logger.Log($"Clearing {nameof(SpectatorClient)} state due to failed {nameof(BeginPlayingInternal)} call.");
239+
238240
clearScoreState();
239241

240242
currentState.BeatmapID = null;
@@ -252,7 +254,8 @@ public void HandleFrame(ReplayFrame frame) => Schedule(() =>
252254
{
253255
if (!isPlaying)
254256
{
255-
Logger.Log($"Frames arrived at {nameof(SpectatorClient)} outside of gameplay scope and will be ignored.");
257+
if (IsConnected.Value)
258+
Logger.Log($"Frames arrived at {nameof(SpectatorClient)} outside of gameplay scope and will be ignored.");
256259
return;
257260
}
258261

0 commit comments

Comments
 (0)