Skip to content

Commit

Permalink
Skip game start/end if spectator server is not running.
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfi1 committed Oct 30, 2024
1 parent 21e930d commit fbb0024
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/Core/Core/Slippi/SlippiSpectate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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;
Expand Down

0 comments on commit fbb0024

Please sign in to comment.