|
@@ -98,15 +98,6 @@ abstract class base_room extends base_info
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
- private function all_users()
|
|
|
- {
|
|
|
- $result = [];
|
|
|
- foreach ($this->mRoomkeys as $key => $item) {
|
|
|
- $result[] = $key;
|
|
|
- }
|
|
|
- return $result;
|
|
|
- }
|
|
|
-
|
|
|
public function joinOp($input)
|
|
|
{
|
|
|
$this->clear();
|
|
@@ -119,7 +110,7 @@ abstract class base_room extends base_info
|
|
|
$this->mAccReq = true;
|
|
|
if($this->join($room_key))
|
|
|
{
|
|
|
- $this->add_return([$room_key],'room_info',$this->room_info($room_key));
|
|
|
+ $this->add_return([$room_key],'ret_join',$this->room_info($room_key));
|
|
|
$this->add_broad('join',$this->mRoomkeys[$room_key]);
|
|
|
return true;
|
|
|
}
|
|
@@ -127,6 +118,20 @@ abstract class base_room extends base_info
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
+ public function messageOp($input)
|
|
|
+ {
|
|
|
+ $this->clear();
|
|
|
+
|
|
|
+ $room_key = $input['room_key'];
|
|
|
+ if(empty($room_key)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $type = $input['type'];
|
|
|
+ $content = $input['content'];
|
|
|
+
|
|
|
+ $this->add_broad('message',['from' => $this->mRoomkeys[$room_key],'type' => $type,'content' => $content]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
public function return_msgs()
|
|
|
{
|
|
@@ -149,7 +154,7 @@ abstract class base_room extends base_info
|
|
|
$msg['receivers'] = ['type' => 'roomkey', 'users' => $roomkeys];
|
|
|
$msg['room'] = $this->mRoomid;
|
|
|
$msg['act'] = "room";
|
|
|
- $msg['op'] = "broadcast";
|
|
|
+ $msg['op'] = $op;
|
|
|
|
|
|
$msg['body']['act'] = 'room';
|
|
|
$msg['body']['op'] = $op;
|
|
@@ -165,7 +170,7 @@ abstract class base_room extends base_info
|
|
|
$msg['receivers'] = ['type' => 'broadcast'];
|
|
|
$msg['room'] = $this->mRoomid;
|
|
|
$msg['act'] = "room";
|
|
|
- $msg['op'] = "broadcast";
|
|
|
+ $msg['op'] = $op;
|
|
|
|
|
|
$msg['body']['act'] = 'room';
|
|
|
$msg['body']['op'] = $op;
|