郑晓宇 6 роки тому
батько
коміт
66b4a93f01
1 змінених файлів з 4 додано та 2 видалено
  1. 4 2
      app/Console/Commands/gamematch.php

+ 4 - 2
app/Console/Commands/gamematch.php

@@ -54,8 +54,10 @@ class gamematch extends Command
                     $message = [
                         "type" => 'gotomatch',
                     ];
-                    Gateway::sendToClient($robot, $message);
-                    echo "启动机器人: {$robot}\n";
+                    if(Gateway::isOnline($robot)){
+                        Gateway::sendToClient($robot, $message);
+                        echo "启动机器人: {$robot}\n";
+                    }
                 }
                 sleep(1);
                 $match_times++;