diff options
| author | skidau <skidau@gmail.com> | 2015-03-12 13:28:38 +1100 |
|---|---|---|
| committer | skidau <skidau@gmail.com> | 2015-03-12 13:28:38 +1100 |
| commit | f3bb30f17f1185a89969f1e13617fea0af148a82 (patch) | |
| tree | c60b73db241a11b116e0c737d69697c428da49ac /Source/Core | |
| parent | 647cd3c8e0270a85166f47cf0f0f62236a0c04cc (diff) | |
| parent | 3df51e553fe7800e7da8250e36c70487a29964f7 (diff) | |
Merge pull request #2180 from RachelBryk/netplay-quit
Fix crash when server's client disconnects.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/NetPlayClient.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Core/NetPlayServer.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index 6fcbd6c70f..66c4e507f6 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -397,7 +397,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet) case NP_MSG_DISABLE_GAME: { - PanicAlertT("Other client disconnected while game is running!! NetPlay is disabled. You manually stop the game."); + PanicAlertT("Other client disconnected while game is running!! NetPlay is disabled. You must manually stop the game."); std::lock_guard<std::recursive_mutex> lkg(m_crit.game); m_is_running = false; NetPlay_Disable(); diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index 79acbb6918..1ea6055815 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -334,7 +334,7 @@ unsigned int NetPlayServer::OnDisconnect(Client& player) { for (PadMapping mapping : m_pad_map) { - if (mapping == pid) + if (mapping == pid && pid != 1) { PanicAlertT("Client disconnect while game is running!! NetPlay is disabled. You must manually stop the game."); std::lock_guard<std::recursive_mutex> lkg(m_crit.game); @@ -344,7 +344,7 @@ unsigned int NetPlayServer::OnDisconnect(Client& player) spac << (MessageId)NP_MSG_DISABLE_GAME; // this thread doesn't need players lock std::lock_guard<std::recursive_mutex> lks(m_crit.send); - SendToClients(spac); + SendToClients(spac, 1); break; } } |
