|
@@ -130,13 +130,14 @@ class robot extends Command
|
|
|
}
|
|
|
//获得题目
|
|
|
if($json_data->type == 'checkrobot'){
|
|
|
- if($room_id && $client_id){
|
|
|
+ if(!empty($room_id) && !empty($client_id)){
|
|
|
$clients = Gateway::getClientIdListByGroup($room_id);
|
|
|
if(count($clients) > 0 && count($clients) < 2){
|
|
|
Gateway::leaveGroup($client_id, $room_id);
|
|
|
//重新加入机器人队列
|
|
|
Redis::sadd('robot_list', $client_id);
|
|
|
$room_id = '';
|
|
|
+ echo "{$client_id} 离开房间:{$room_id}\n";
|
|
|
echo "{$client_id} 成功重回队列\n";
|
|
|
}
|
|
|
}
|