1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Fixed CID 1197453

This commit is contained in:
AlexVinS 2016-11-25 17:39:06 +03:00
parent b908c70468
commit e7a0bd690a

View File

@ -471,16 +471,11 @@ void CVCMIServer::loadGame()
c << ui8(0); c << ui8(0);
CConnection* cc; //tcp::socket * ss; gh.conns.insert(firstConnection);
for(int i=0; i<clients; i++)
for(int i=1; i<clients; i++)
{ {
if(!i) auto s = make_unique<boost::asio::ip::tcp::socket>(acceptor->get_io_service());
{
cc = &c;
}
else
{
auto s = new boost::asio::ip::tcp::socket(acceptor->get_io_service());
acceptor->accept(*s,error); acceptor->accept(*s,error);
if(error) //retry if(error) //retry
{ {
@ -488,9 +483,8 @@ void CVCMIServer::loadGame()
i--; i--;
continue; continue;
} }
cc = new CConnection(s,NAME);
} gh.conns.insert(new CConnection(s.release(),NAME));
gh.conns.insert(cc);
} }
gh.run(true); gh.run(true);