|
@@ -131,7 +131,8 @@ class gamematch extends Command
|
|
|
//清理不在房间的用户
|
|
|
RoomUser::whereNotIn('user_id', array_values($group_users))->delete();
|
|
|
}
|
|
|
- $info['players'] = User::select('user_id', 'avatar', 'name', 'win_count', 'lose_count')->whereIn("user_id", array_values($group_users))->get();
|
|
|
+ $players = User::select('user_id', 'avatar', 'name', 'win_count', 'lose_count')->whereIn("user_id", array_values($group_users))->get();
|
|
|
+ $info['players'] = $players;
|
|
|
//发送可以开始消息
|
|
|
$message = [
|
|
|
"type" => 'player_join',
|
|
@@ -185,9 +186,10 @@ class gamematch extends Command
|
|
|
'created_at' => date('Y-m-d H:i:s'),
|
|
|
'updated_at' => date('Y-m-d H:i:s'),
|
|
|
]);
|
|
|
- //把当前用户加入当前房间 保险点获取用户最新 client_id
|
|
|
+ //把当前用户加入当前房间
|
|
|
Gateway::joinGroup($user->client_id, $room_id);
|
|
|
echo "玩家新建房间: {$user_id}\n";
|
|
|
+ /*
|
|
|
if($user->win_count == 0 || ($user->win_count == 0 && $user->lose_count == 0)){
|
|
|
$win_rate = 0;
|
|
|
}else{
|
|
@@ -210,6 +212,7 @@ class gamematch extends Command
|
|
|
"info" => $info
|
|
|
];
|
|
|
Gateway::sendToGroup($room_id, json_encode($message));
|
|
|
+ */
|
|
|
}
|
|
|
}
|
|
|
}
|