Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
NetPlay: Allow hosts to stop the game by closing the game window
  • Loading branch information
magcius committed Aug 14, 2013
1 parent 92f8d79 commit 5241dea
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions Source/Core/DolphinWX/Src/FrameTools.cpp
Expand Up @@ -1049,6 +1049,7 @@ void CFrame::DoStop()
DoRecordingSave();
if(Movie::IsPlayingInput() || Movie::IsRecordingInput())
Movie::EndPlayInput(false);
NetPlay::StopGame();

wxBeginBusyCursor();
BootManager::Stop();
Expand Down
10 changes: 9 additions & 1 deletion Source/Core/DolphinWX/Src/NetWindow.cpp
Expand Up @@ -432,7 +432,7 @@ void NetPlayDiag::OnStart(wxCommandEvent&)

void NetPlayDiag::OnStop(wxCommandEvent&)
{
netplay_server->StopGame();
NetPlay::StopGame();
}

void NetPlayDiag::BootGame(const std::string& filename)
Expand Down Expand Up @@ -661,3 +661,11 @@ void PadMapDiag::OnAdjust(wxCommandEvent& event)
for (unsigned int i=0; i<4; ++i)
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
}
5 changes: 5 additions & 0 deletions Source/Core/DolphinWX/Src/NetWindow.h
Expand Up @@ -133,5 +133,10 @@ class PadMapDiag : public wxDialog
int* const m_mapping;
};

namespace NetPlay
{
void StopGame();
}

#endif // _NETWINDOW_H_

0 comments on commit 5241dea

Please sign in to comment.