Merge pull request #7596 from Techjar/netplay-fix-force-stop

NetPlay: Allow force stopping
This commit is contained in:
Pierre Bourdon 2018-11-30 21:30:04 +01:00 committed by GitHub
commit 754d934a18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -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();

View File

@ -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); });
}