mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 15:31:17 +01:00
Make sure netplay player IDs are actually unique.
Fixes issue 7329.
This commit is contained in:
parent
3d21c6777e
commit
8c70ee7194
@ -153,7 +153,16 @@ unsigned int NetPlayServer::OnConnect(sf::SocketTCP& socket)
|
|||||||
rpac >> player.name;
|
rpac >> player.name;
|
||||||
|
|
||||||
// give new client first available id
|
// give new client first available id
|
||||||
player.pid = (PlayerId)(m_players.size() + 1);
|
PlayerId pid = 1;
|
||||||
|
for (auto i = m_players.begin(); i != m_players.end(); ++i)
|
||||||
|
{
|
||||||
|
if (i->second.pid == pid)
|
||||||
|
{
|
||||||
|
pid++;
|
||||||
|
i = m_players.begin();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
player.pid = pid;
|
||||||
|
|
||||||
// try to automatically assign new user a pad
|
// try to automatically assign new user a pad
|
||||||
for (PadMapping& mapping : m_pad_map)
|
for (PadMapping& mapping : m_pad_map)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user