Skip to content

Commit 563ff31

Browse files
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
1 parent 4a6c4f0 commit 563ff31

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

main.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,19 @@ bool AttemptLocalConnection()
129129
ResourceManager::get()->RegisterNetworkClient(client);
130130

131131
success = true;
132+
133+
/*-----------------------------------------------------*\
134+
| Wait up to 5 seconds for the client connection to |
135+
| retrieve all controllers |
136+
\*-----------------------------------------------------*/
137+
for(int timeout = 0; timeout < 1000; timeout++)
138+
{
139+
if(client->GetOnline())
140+
{
141+
break;
142+
}
143+
std::this_thread::sleep_for(5ms);
144+
}
132145
}
133146

134147
return success;

0 commit comments

Comments
 (0)