Procházet zdrojové kódy

Fix invalid host connection

nordsoft před 2 roky
rodič
revize
c0c1be2645
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      server/CVCMIServer.cpp

+ 4 - 0
server/CVCMIServer.cpp

@@ -201,6 +201,10 @@ void CVCMIServer::run()
 
 void CVCMIServer::establishRemoteConnections()
 {
+	//wait for host connection
+	while(connections.empty())
+		boost::this_thread::sleep(boost::posix_time::milliseconds(50));
+	
 	uuid = cmdLineOptions["lobby-uuid"].as<std::string>();
     int numOfConnections = cmdLineOptions["connections"].as<ui16>();
 	auto address = cmdLineOptions["lobby"].as<std::string>();