Major redesign: The game can not be left without disconnecting from the server. This happens if a player is kicked, if he wishes to leave, or for other reasons. Error packets from the server will always cause a disconnect, however.
If joining a game fails, there is a proper failure packet now.
This commit is contained in:
@@ -97,6 +97,14 @@ ClientThread::SendKickPlayer(unsigned playerId)
|
||||
m_outPacketList.push_back(request);
|
||||
}
|
||||
|
||||
void
|
||||
ClientThread::SendLeaveCurrentGame()
|
||||
{
|
||||
boost::shared_ptr<NetPacket> request(new NetPacketLeaveCurrentGame);
|
||||
boost::mutex::scoped_lock lock(m_outPacketListMutex);
|
||||
m_outPacketList.push_back(request);
|
||||
}
|
||||
|
||||
void
|
||||
ClientThread::SendStartEvent(bool fillUpWithCpuPlayers)
|
||||
{
|
||||
@@ -507,6 +515,12 @@ ClientThread::RemovePlayerData(unsigned playerId)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ClientThread::ClearPlayerDataList()
|
||||
{
|
||||
m_playerDataList.clear();
|
||||
}
|
||||
|
||||
void
|
||||
ClientThread::MapPlayerDataList()
|
||||
{
|
||||
@@ -692,6 +706,13 @@ ClientThread::ModifyGameInfoRemovePlayer(unsigned gameId, unsigned playerId)
|
||||
GetCallback().SignalNetClientGameListPlayerLeft(gameId, playerId);
|
||||
}
|
||||
|
||||
void
|
||||
ClientThread::ClearGameInfoMap()
|
||||
{
|
||||
boost::mutex::scoped_lock lock(m_gameInfoMapMutex);
|
||||
m_gameInfoMap.clear();
|
||||
}
|
||||
|
||||
bool
|
||||
ClientThread::IsSessionEstablished() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user