From fbb002441ba03737f57d34ef399bc9ee07b95566 Mon Sep 17 00:00:00 2001 From: Vlad Firoiu Date: Sat, 1 Jun 2024 20:51:34 -0400 Subject: [PATCH] Skip game start/end if spectator server is not running. --- Source/Core/Core/Slippi/SlippiSpectate.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Core/Core/Slippi/SlippiSpectate.cpp b/Source/Core/Core/Slippi/SlippiSpectate.cpp index cd7a1aa86af5..e37b5723e187 100644 --- a/Source/Core/Core/Slippi/SlippiSpectate.cpp +++ b/Source/Core/Core/Slippi/SlippiSpectate.cpp @@ -37,6 +37,10 @@ void SlippiSpectateServer::write(u8* payload, u32 length) // CALLED FROM DOLPHIN MAIN THREAD void SlippiSpectateServer::startGame() { + if (!isSpectatorEnabled()) + { + return; + } json start_game_message; start_game_message["type"] = "start_game"; m_event_queue.Push(start_game_message.dump()); @@ -45,6 +49,10 @@ void SlippiSpectateServer::startGame() // CALLED FROM DOLPHIN MAIN THREAD void SlippiSpectateServer::endGame(bool dolphin_closed) { + if (!isSpectatorEnabled()) + { + return; + } json end_game_message; end_game_message["type"] = "end_game"; end_game_message["dolphin_closed"] = dolphin_closed;