Skip to content
Permalink
Browse files
Merge pull request #7596 from Techjar/netplay-fix-force-stop
NetPlay: Allow force stopping
  • Loading branch information
delroth committed Nov 30, 2018
2 parents 6388992 + 9c51439 commit 754d934
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
@@ -245,6 +245,10 @@ void Stop() // - Hammertime!

s_is_stopping = true;

// Notify state changed callback
if (s_on_state_changed_callback)
s_on_state_changed_callback(State::Stopping);

// Dump left over jobs
HostDispatchJobs();

@@ -338,6 +338,11 @@ void NetPlayDialog::ConnectWidgets()
if (isVisible())
{
GameStatusChanged(state != Core::State::Uninitialized);
if ((state == Core::State::Uninitialized || state == Core::State::Stopping) &&
!m_got_stop_request)
{
Settings::Instance().GetNetPlayClient()->RequestStopGame();
}
if (state == Core::State::Uninitialized)
DisplayMessage(tr("Stopped game"), "red");
}
@@ -808,9 +813,6 @@ void NetPlayDialog::OnMsgChangeGame(const std::string& title)

void NetPlayDialog::GameStatusChanged(bool running)
{
if (!running && !m_got_stop_request)
Settings::Instance().GetNetPlayClient()->RequestStopGame();

QueueOnObject(this, [this, running] { SetOptionsEnabled(!running); });
}

0 comments on commit 754d934

Please sign in to comment.