|
@@ -178,30 +178,6 @@ class room_processor implements IProcessor
|
|
|
return $this->error(errcode::ErrRoomInvite);
|
|
|
}
|
|
|
|
|
|
- private function factory_change($input)
|
|
|
- {
|
|
|
- $roomid = intval($input['room']);
|
|
|
- if ($roomid <= 0) {
|
|
|
- return $this->error(errcode::ErrRoomParam);
|
|
|
- }
|
|
|
-
|
|
|
- $room = $this->room($roomid);
|
|
|
- if ($room != false)
|
|
|
- {
|
|
|
- $result = $room->change();
|
|
|
- if ($result != false) {
|
|
|
- $this->broad_access(msg_builder::change_push($roomid, $room->room_info()));
|
|
|
- return $this->success($result);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return $this->error(errcode::ErrRoomChange);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @param $input
|
|
|
- * @return mixed|string
|
|
|
- */
|
|
|
private function factory_leave($input)
|
|
|
{
|
|
|
$roomid = intval($input['room']);
|
|
@@ -214,8 +190,17 @@ class room_processor implements IProcessor
|
|
|
$userid = intval($input['user']);
|
|
|
if ($userid > 0) {
|
|
|
$result = $room->leave($userid);
|
|
|
- if ($result != false) {
|
|
|
+ if ($result != false)
|
|
|
+ {
|
|
|
$this->broad_access(msg_builder::leave_message($roomid, $room->room_type(), $userid));
|
|
|
+ $this->reply_roomsg($bufid,$room);
|
|
|
+ $this->broadcast_roomsg($room);
|
|
|
+
|
|
|
+ $user_count = $room->usercount();
|
|
|
+ if($user_count >= 0 && $user_count < 10) {
|
|
|
+ QueueClient::push("OnUpdateRoom",['room_id' => $roomid]);
|
|
|
+ }
|
|
|
+
|
|
|
return $this->success($result);
|
|
|
}
|
|
|
}
|
|
@@ -240,8 +225,16 @@ class room_processor implements IProcessor
|
|
|
if ($user > 0)
|
|
|
{
|
|
|
$result = $room->kickout($user,$kicks);
|
|
|
- if ($result != false) {
|
|
|
+ if ($result != false)
|
|
|
+ {
|
|
|
$this->broad_access(msg_builder::leave_message($roomid, $room->room_type(), $result));
|
|
|
+ $this->reply_roomsg($bufid,$room);
|
|
|
+ $this->broadcast_roomsg($room);
|
|
|
+
|
|
|
+ $user_count = $room->usercount();
|
|
|
+ if($user_count >= 0 && $user_count < 10) {
|
|
|
+ QueueClient::push("OnUpdateRoom",['room_id' => $roomid]);
|
|
|
+ }
|
|
|
return $this->success($result);
|
|
|
}
|
|
|
}
|
|
@@ -249,10 +242,27 @@ class room_processor implements IProcessor
|
|
|
|
|
|
return $this->error(errcode::ErrRoomLeave);
|
|
|
}
|
|
|
- /**
|
|
|
- * @param $input
|
|
|
- * @return mixed|string
|
|
|
- */
|
|
|
+
|
|
|
+ private function factory_change($input)
|
|
|
+ {
|
|
|
+ $roomid = intval($input['room']);
|
|
|
+ if ($roomid <= 0) {
|
|
|
+ return $this->error(errcode::ErrRoomParam);
|
|
|
+ }
|
|
|
+
|
|
|
+ $room = $this->room($roomid);
|
|
|
+ if ($room != false)
|
|
|
+ {
|
|
|
+ $result = $room->change();
|
|
|
+ if ($result != false) {
|
|
|
+ $this->broad_access(msg_builder::change_push($roomid, $room->room_info()));
|
|
|
+ return $this->success($result);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this->error(errcode::ErrRoomChange);
|
|
|
+ }
|
|
|
+
|
|
|
private function factory_push($input)
|
|
|
{
|
|
|
$content = $input['content'];
|