mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
NetPlay: Allow hosts to stop the game by closing the game window
This commit is contained in:
@ -1049,6 +1049,7 @@ void CFrame::DoStop()
|
|||||||
DoRecordingSave();
|
DoRecordingSave();
|
||||||
if(Movie::IsPlayingInput() || Movie::IsRecordingInput())
|
if(Movie::IsPlayingInput() || Movie::IsRecordingInput())
|
||||||
Movie::EndPlayInput(false);
|
Movie::EndPlayInput(false);
|
||||||
|
NetPlay::StopGame();
|
||||||
|
|
||||||
wxBeginBusyCursor();
|
wxBeginBusyCursor();
|
||||||
BootManager::Stop();
|
BootManager::Stop();
|
||||||
|
@ -432,7 +432,7 @@ void NetPlayDiag::OnStart(wxCommandEvent&)
|
|||||||
|
|
||||||
void NetPlayDiag::OnStop(wxCommandEvent&)
|
void NetPlayDiag::OnStop(wxCommandEvent&)
|
||||||
{
|
{
|
||||||
netplay_server->StopGame();
|
NetPlay::StopGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetPlayDiag::BootGame(const std::string& filename)
|
void NetPlayDiag::BootGame(const std::string& filename)
|
||||||
@ -661,3 +661,11 @@ void PadMapDiag::OnAdjust(wxCommandEvent& event)
|
|||||||
for (unsigned int i=0; i<4; ++i)
|
for (unsigned int i=0; i<4; ++i)
|
||||||
m_mapping[i] = m_map_cbox[i]->GetSelection() - 1;
|
m_mapping[i] = m_map_cbox[i]->GetSelection() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NetPlay::StopGame()
|
||||||
|
{
|
||||||
|
if (netplay_server != NULL)
|
||||||
|
netplay_server->StopGame();
|
||||||
|
|
||||||
|
// TODO: allow non-hosting clients to close the window
|
||||||
|
}
|
||||||
|
@ -133,5 +133,10 @@ private:
|
|||||||
int* const m_mapping;
|
int* const m_mapping;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace NetPlay
|
||||||
|
{
|
||||||
|
void StopGame();
|
||||||
|
}
|
||||||
|
|
||||||
#endif // _NETWINDOW_H_
|
#endif // _NETWINDOW_H_
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user