Commit a6a9d860 authored by Colomban Wendling's avatar Colomban Wendling
Browse files

Bot: don't block while waiting in order to let other join

parent 654f8472
......@@ -179,11 +179,20 @@ public int main (string[] args)
try {
bot.join (server);
/* wait to let others join */
Thread.usleep (5000000);
bot.play();
Timeout.add_seconds (5, () => {
if (bot.game.state != OVCC.GameState.STARTED) {
debug ("let the show begin!");
try {
bot.play ();
} catch (Error e) {
warning ("Failed to start playing: %s", e.message);
}
}
return false;
});
loop.run ();
} catch (Error e) {
warning ("Failed to join & play on the server: %s", e.message);
warning ("Failed to join on the server: %s", e.message);
}
return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment