郑晓宇 6 years ago
parent
commit
a9ae586612
3 changed files with 6 additions and 3 deletions
  1. 2 3
      app/Console/Commands/robot.php
  2. 1 0
      app/Jobs/Distribute.php
  3. 3 0
      app/Jobs/Settlement.php

+ 2 - 3
app/Console/Commands/robot.php

@@ -78,8 +78,8 @@ class robot extends Command
             ]);
             // $robot = $response->getBody()->getContents();
 
-            // $con = new AsyncTcpConnection('ws://183.234.61.252:8282');
-            $con = new AsyncTcpConnection('ws://127.0.0.1:8282');
+            $con = new AsyncTcpConnection('ws://183.234.61.252:8282');
+            // $con = new AsyncTcpConnection('ws://127.0.0.1:8282');
             $con->onConnect = function($con) use($client) {
             };
             $con->onMessage = function($con, $data) use($client, &$room_id, &$client_id, $user, $http_addr){
@@ -96,7 +96,6 @@ class robot extends Command
                         ]
                     ]);
                     $result = json_decode($response->getBody()->getContents());
-                    echo $result->msg;
                     if($result->code == 400 || ($result->code == 0 && $result->info->in_game == 1)){
                         return 0;
                     }

+ 1 - 0
app/Jobs/Distribute.php

@@ -68,6 +68,7 @@ class Distribute implements ShouldQueue
             //发送题目
             $info['question'] = $question; 
             $info['options'] = $options; 
+            $info['start_at'] = $date; 
             $message = [
                 "type" => 'question',
                 "msg" => "获取题目成功",

+ 3 - 0
app/Jobs/Settlement.php

@@ -134,6 +134,9 @@ class Settlement implements ShouldQueue
             }
 
         }else{
+            //返回各个用户回答的问题
+            
+
             //执行发题
             Distribute::dispatch($this->room_id)->onQueue('distribute');
         }