request->request('params_from'); // 客户端 if ($params_from == "wxmin") { Gateway::$registerAddress = "127.0.0.1:1239"; } else { Gateway::$registerAddress = "127.0.0.1:1238"; } } /** * 直播间中发送大礼物,全服通告 */ public static function sendBigGiftInParty($sender, $receiver, $partyInfo, $giftUserParty) { $aData = [ 'code' => 'party', 'data' => [ 'cmd' => 'send_big_gift_in_party', 'content' => [ 'party_info' => [ 'party_id' => $partyInfo['id'], 'room_type' => $partyInfo['room_type'], 'party_name' => $partyInfo['party_name'] ], 'notice_info' => [ 'sender' => $sender, 'receiver' => $receiver, 'gift_num' => $giftUserParty['number'], 'gift_name' => $giftUserParty['gift_name'], 'gift_image' => $giftUserParty['gift_gif_image'] ] ] ] ]; dump($aData); Gateway::sendToAll(json_encode($aData)); } /** * 直播间中发送礼物,本房间飘屏 */ public static function sendGiftInParty($sender, $receiver, $partyInfo, $giftUserParty) { $aData = [ 'code' => 'party', 'data' => [ 'cmd' => 'send_gift_in_party', 'content' => [ 'party_info' => [ 'party_id' => $partyInfo['id'], 'room_type' => $partyInfo['room_type'], 'party_name' => $partyInfo['party_name'] ], 'notice_info' => [ 'sender' => $sender, 'receiver' => $receiver, 'gift_num' => $giftUserParty['number'], 'gift_name' => $giftUserParty['gift_name'], 'gift_image' => $giftUserParty['gift_gif_image'] ] ] ] ]; Gateway::sendToGroup($partyInfo['id'],json_encode($aData)); } // 注意除了不支持sendToCurrentClient和closeCurrentClient方法 // Gateway::sendToAll($data); // Gateway::sendToClient($client_id, $data); // Gateway::closeClient($client_id); // Gateway::isOnline($client_id); // Gateway::bindUid($client_id, $uid); // Gateway::isUidOnline($uid); // Gateway::getClientIdByUid($uid); // Gateway::unbindUid($client_id, $uid); // Gateway::sendToUid($uid, $data); // Gateway::joinGroup($client_id, $group); // Gateway::sendToGroup($group, $data); // Gateway::leaveGroup($client_id, $group); // Gateway::getClientCountByGroup($group); // Gateway::getClientSessionsByGroup($group); // Gateway::getAllClientCount(); // Gateway::getAllClientSessions(); // Gateway::setSession($client_id, $session); // Gateway::updateSession($client_id, $session); // Gateway::getSession($client_id); }