Wait up to 5 seconds for the local server connection to retrieve all controllers before continuing, so that CLI mode has all controllers available for applying changes

This commit is contained in:
Adam Honse 2021-05-31 23:44:33 -05:00
parent 4a6c4f0e52
commit 563ff31fe3

View file

@ -129,6 +129,19 @@ bool AttemptLocalConnection()
ResourceManager::get()->RegisterNetworkClient(client);
success = true;
/*-----------------------------------------------------*\
| Wait up to 5 seconds for the client connection to |
| retrieve all controllers |
\*-----------------------------------------------------*/
for(int timeout = 0; timeout < 1000; timeout++)
{
if(client->GetOnline())
{
break;
}
std::this_thread::sleep_for(5ms);
}
}
return success;