|
@@ -78,25 +78,25 @@ class room_processor implements IProcessor
|
|
|
{
|
|
|
$op = $input['op'];
|
|
|
if($op == 'build') {
|
|
|
- return $this->factory_build($input);
|
|
|
+ return $this->factory_build($bufid,$input);
|
|
|
}
|
|
|
elseif($op == 'list_room') {
|
|
|
return $this->success(['rooms' => $this->mRooms]);
|
|
|
}
|
|
|
elseif($op == 'invite') {
|
|
|
- return $this->factory_invite($input);
|
|
|
+ return $this->factory_invite($bufid,$input);
|
|
|
}
|
|
|
elseif($op == 'change') {
|
|
|
- return $this->factory_change($input);
|
|
|
+ return $this->factory_change($bufid,$input);
|
|
|
}
|
|
|
elseif($op == 'leave') {
|
|
|
- return $this->factory_leave($input);
|
|
|
+ return $this->factory_leave($bufid,$input);
|
|
|
}
|
|
|
elseif($op == 'kickout') {
|
|
|
- return $this->factory_kickout($input);
|
|
|
+ return $this->factory_kickout($bufid,$input);
|
|
|
}
|
|
|
elseif($op == 'push') {
|
|
|
- return $this->factory_push($input);
|
|
|
+ return $this->factory_push($bufid,$input);
|
|
|
}
|
|
|
else {
|
|
|
return $this->error(errcode::ErrRoomFactoryOp);
|
|
@@ -106,7 +106,7 @@ class room_processor implements IProcessor
|
|
|
* @param $input
|
|
|
* @return mixed|string
|
|
|
*/
|
|
|
- private function factory_build($input)
|
|
|
+ private function factory_build($bufid,$input)
|
|
|
{
|
|
|
$roomid = intval($input['room']);
|
|
|
$newroom = boolval($input['newroom']);
|
|
@@ -135,7 +135,7 @@ class room_processor implements IProcessor
|
|
|
* @param $input
|
|
|
* @return mixed|string
|
|
|
*/
|
|
|
- private function factory_invite($input)
|
|
|
+ private function factory_invite($bufid,$input)
|
|
|
{
|
|
|
$roomid = intval($input['room']);
|
|
|
$inviter = intval($input['inviter']);
|
|
@@ -178,7 +178,7 @@ class room_processor implements IProcessor
|
|
|
return $this->error(errcode::ErrRoomInvite);
|
|
|
}
|
|
|
|
|
|
- private function factory_leave($input)
|
|
|
+ private function factory_leave($bufid,$input)
|
|
|
{
|
|
|
$roomid = intval($input['room']);
|
|
|
if ($roomid <= 0) {
|
|
@@ -209,7 +209,7 @@ class room_processor implements IProcessor
|
|
|
return $this->error(errcode::ErrRoomLeave);
|
|
|
}
|
|
|
|
|
|
- private function factory_kickout($input)
|
|
|
+ private function factory_kickout($bufid,$input)
|
|
|
{
|
|
|
$roomid = intval($input['room']);
|
|
|
if ($roomid <= 0) {
|
|
@@ -224,18 +224,20 @@ class room_processor implements IProcessor
|
|
|
|
|
|
if ($user > 0)
|
|
|
{
|
|
|
- $result = $room->kickout($user,$kicks);
|
|
|
- if ($result != false)
|
|
|
+ $users = $room->kickout($user,$kicks);
|
|
|
+ if ($users != false)
|
|
|
{
|
|
|
- $this->broad_access(msg_builder::leave_message($roomid, $room->room_type(), $result));
|
|
|
- $this->reply_roomsg($bufid,$room);
|
|
|
+ $this->broad_access(msg_builder::leave_message($roomid, $room->room_type(), $users));
|
|
|
$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);
|
|
|
+ return $this->success(['users' => $users]);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return $this->success(['users' => []]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -243,7 +245,7 @@ class room_processor implements IProcessor
|
|
|
return $this->error(errcode::ErrRoomLeave);
|
|
|
}
|
|
|
|
|
|
- private function factory_change($input)
|
|
|
+ private function factory_change($bufid,$input)
|
|
|
{
|
|
|
$roomid = intval($input['room']);
|
|
|
if ($roomid <= 0) {
|
|
@@ -263,7 +265,7 @@ class room_processor implements IProcessor
|
|
|
return $this->error(errcode::ErrRoomChange);
|
|
|
}
|
|
|
|
|
|
- private function factory_push($input)
|
|
|
+ private function factory_push($bufid,$input)
|
|
|
{
|
|
|
$content = $input['content'];
|
|
|
$this->write_push($content);
|