|
@@ -123,9 +123,11 @@ class UserController extends Controller
|
|
|
"type" => "replace_login",
|
|
|
"msg" => "用户在其他地方登录了,当前用户端断开连接",
|
|
|
];
|
|
|
- Gateway::sendToClient($user->client_id, json_encode($message));
|
|
|
- //断开旧ID
|
|
|
- Gateway::closeClient($user->client_id);
|
|
|
+ if(Gateway::isOnline($client_id)){
|
|
|
+ Gateway::sendToClient($user->client_id, json_encode($message));
|
|
|
+ //断开旧ID
|
|
|
+ Gateway::closeClient($user->client_id);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//绑定用户ID
|
|
@@ -140,8 +142,8 @@ class UserController extends Controller
|
|
|
"state" => 1,
|
|
|
])->value("room_id");
|
|
|
//查看房间状态
|
|
|
- $room_state = Room::where("room_id", $room_id)->value("is_close");
|
|
|
- if($room_id && !$room_state){
|
|
|
+ $is_end = Room::where("room_id", $room_id)->value("is_end");
|
|
|
+ if($room_id && !$is_end){
|
|
|
Gateway::joinGroup($client_id, $room_id);
|
|
|
$response['info']['in_game'] = 1;
|
|
|
}elseif($room_id){
|