NetPlay: Stop game when mapped Wii Remote disconnects
This commit is contained in:
1 parent
29e577d966
commit
5585aa0474
1 file changed
+15
@@ -539,6 +539,21 @@ unsigned int NetPlayServer::OnDisconnect(const Client& player)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (PlayerId& mapping : m_wiimote_map)
|
||||||
|
{
|
||||||
|
if (m_is_running && mapping == pid && pid != 1)
|
||||||
|
{
|
||||||
|
std::lock_guard lkg(m_crit.game);
|
||||||
|
m_is_running = false;
|
||||||
|
|
||||||
|
sf::Packet spac;
|
||||||
|
spac << MessageID::DisableGame;
|
||||||
|
// this thread doesn't need players lock
|
||||||
|
SendToClients(spac);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_start_pending)
|
if (m_start_pending)
|
||||||
|
|||||||
Reference in new issue
Block a user