郑晓宇 6 anni fa
parent
commit
66b4a93f01
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  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++;