mirror of
https://github.com/LCEMP/LCEMP.git
synced 2026-05-27 02:44:30 +00:00
LCEMP v1.1.0, bugfixes, multithreading server, local leaderboard, performance fixes, and more
This commit is contained in:
@@ -603,18 +603,19 @@ bool MultiPlayerLevel::doSetTileAndData(int x, int y, int z, int tile, int data)
|
||||
|
||||
void MultiPlayerLevel::disconnect(bool sendDisconnect /*= true*/)
|
||||
{
|
||||
vector<ClientConnection *> connectionsTemp = connections;
|
||||
if( sendDisconnect )
|
||||
{
|
||||
for(AUTO_VAR(it, connections.begin()); it < connections.end(); ++it )
|
||||
for(AUTO_VAR(it, connectionsTemp.begin()); it < connectionsTemp.end(); ++it )
|
||||
{
|
||||
(*it)->sendAndDisconnect( shared_ptr<DisconnectPacket>( new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting) ) );
|
||||
if( *it ) (*it)->sendAndDisconnect( shared_ptr<DisconnectPacket>( new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting) ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(AUTO_VAR(it, connections.begin()); it < connections.end(); ++it )
|
||||
for(AUTO_VAR(it, connectionsTemp.begin()); it < connectionsTemp.end(); ++it )
|
||||
{
|
||||
(*it)->close();
|
||||
if( *it ) (*it)->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user