mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-08 21:53:31 +01:00
NetPlayServer: Drop all the pads for a client when she disconnects
This makes intuitive sense, and prevents issues with users stealing up all the pads and requiring admin intervention to participate.
This commit is contained in:
parent
0040e66282
commit
f830b85d10
@ -238,9 +238,11 @@ unsigned int NetPlayServer::OnDisconnect(sf::SocketTCP& socket)
|
||||
SendToClients(spac);
|
||||
}
|
||||
|
||||
int pid = m_players[socket].pid;
|
||||
|
||||
sf::Packet spac;
|
||||
spac << (MessageId)NP_MSG_PLAYER_LEAVE;
|
||||
spac << m_players[socket].pid;
|
||||
spac << pid;
|
||||
|
||||
m_selector.Remove(socket);
|
||||
|
||||
@ -251,6 +253,11 @@ unsigned int NetPlayServer::OnDisconnect(sf::SocketTCP& socket)
|
||||
std::lock_guard<std::recursive_mutex> lks(m_crit.send);
|
||||
SendToClients(spac);
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
if (m_pad_map[i] == pid)
|
||||
m_pad_map[i] = -1;
|
||||
UpdatePadMapping();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user