Fixed disconnecting of a client.
This commit is contained in:
parent
bcfec98fa2
commit
c9a23bcbb7
@ -138,6 +138,7 @@ void ClientLobbyRoomProtocol::voteLaps(uint8_t laps, uint8_t track_nb)
|
||||
void ClientLobbyRoomProtocol::leave()
|
||||
{
|
||||
m_server->disconnect();
|
||||
STKHost::get()->removePeer(m_server);
|
||||
m_server_address.clear();
|
||||
} // leave
|
||||
|
||||
@ -364,6 +365,7 @@ void ClientLobbyRoomProtocol::disconnectedPlayer(Event* event)
|
||||
Log::error("ClientLobbyRoomProtocol",
|
||||
"The disconnected peer wasn't known.");
|
||||
}
|
||||
STKHost::get()->removePeer(event->getPeer());
|
||||
} // disconnectedPlayer
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -398,9 +398,9 @@ void ServerLobbyRoomProtocol::kartDisconnected(Event* event)
|
||||
sendMessage(msg);
|
||||
Log::info("ServerLobbyRoomProtocol", "Player disconnected : id %d",
|
||||
peer->getPlayerProfile()->getPlayerID());
|
||||
m_setup->removePlayer(peer->getPlayerProfile());
|
||||
// Remove the profile from the peer (to avoid double free)
|
||||
peer->setPlayerProfile(NULL);
|
||||
m_setup->removePlayer(peer->getPlayerProfile());
|
||||
STKHost::get()->removePeer(peer);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user