|
@@ -109,12 +109,12 @@ class robot extends Command
|
|
|
//更新机器人登陆状态
|
|
|
User::where("user_id", $user->user_id)->update($update_data);
|
|
|
//启动匹配
|
|
|
- $response = $client->request('GET', $http_addr . 'Home/Game/Join',[
|
|
|
- 'form_params' => [
|
|
|
- 'client_id' => $client_id,
|
|
|
- ]
|
|
|
- ]);
|
|
|
- echo "{$client_id} 成功加入匹配\n";
|
|
|
+ // $response = $client->request('GET', $http_addr . 'Home/Game/Join',[
|
|
|
+ // 'form_params' => [
|
|
|
+ // 'client_id' => $client_id,
|
|
|
+ // ]
|
|
|
+ // ]);
|
|
|
+ // echo "{$client_id} 成功加入匹配\n";
|
|
|
}
|
|
|
//唤起匹配
|
|
|
if($json_data->type == 'gotomatch'){
|
|
@@ -155,20 +155,11 @@ class robot extends Command
|
|
|
|
|
|
//结算
|
|
|
if($json_data->type == 'game_end'){
|
|
|
- $update_data = [
|
|
|
- "is_login" => 0,
|
|
|
- "client_id" => '',
|
|
|
- ];
|
|
|
- //更新机器人登陆状态
|
|
|
- User::where("user_id", $user->user_id)->update($update_data);
|
|
|
unset($update_data);
|
|
|
$update_data['state'] = 2;
|
|
|
RoomUser::where("user_id", $user->user_id)->where("state", 1)->update($update_data);
|
|
|
- echo "已结算,关闭机器人";
|
|
|
+ echo "已结算,机器人离开房间";
|
|
|
Gateway::leaveGroup($client_id, $room_id);
|
|
|
- Gateway::unbindUid($client_id, $user->user_id);
|
|
|
- Gateway::closeClient($client_id);
|
|
|
- $worker->stopAll();
|
|
|
}
|
|
|
|
|
|
};
|