add[声望升级]
This commit is contained in:
parent
3f68e2a3aa
commit
0db8eefbe6
@ -898,6 +898,66 @@ public class UserBean implements Parcelable {
|
||||
this.bubble = bubble;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserBean{" +
|
||||
"id='" + id + '\'' +
|
||||
", userNiceName='" + userNiceName + '\'' +
|
||||
", avatar='" + avatar + '\'' +
|
||||
", avatarThumb='" + avatarThumb + '\'' +
|
||||
", sex=" + sex +
|
||||
", signature='" + signature + '\'' +
|
||||
", coin='" + coin + '\'' +
|
||||
", gold='" + gold + '\'' +
|
||||
", votes='" + votes + '\'' +
|
||||
", consumption='" + consumption + '\'' +
|
||||
", votestotal='" + votestotal + '\'' +
|
||||
", province='" + province + '\'' +
|
||||
", city='" + city + '\'' +
|
||||
", location='" + location + '\'' +
|
||||
", birthday='" + birthday + '\'' +
|
||||
", level=" + level +
|
||||
", levelAnchor=" + levelAnchor +
|
||||
", lives=" + lives +
|
||||
", follows=" + follows +
|
||||
", fans=" + fans +
|
||||
", vip=" + vip +
|
||||
", liang=" + liang +
|
||||
", car=" + car +
|
||||
", medal_level=" + medal_level +
|
||||
", medal_name='" + medal_name + '\'' +
|
||||
", Dress=" + Dress +
|
||||
", noble_id='" + noble_id + '\'' +
|
||||
", yuanbao='" + yuanbao + '\'' +
|
||||
", noble_name='" + noble_name + '\'' +
|
||||
", islive='" + islive + '\'' +
|
||||
", medal_no_display_src='" + medal_no_display_src + '\'' +
|
||||
", hot_num='" + hot_num + '\'' +
|
||||
", goodnum='" + goodnum + '\'' +
|
||||
", fans_pic='" + fans_pic + '\'' +
|
||||
", gifticon='" + gifticon + '\'' +
|
||||
", department_name='" + department_name + '\'' +
|
||||
", token_rong='" + token_rong + '\'' +
|
||||
", noble_end_time='" + noble_end_time + '\'' +
|
||||
", slide='" + slide + '\'' +
|
||||
", users_type='" + users_type + '\'' +
|
||||
", is_bind='" + is_bind + '\'' +
|
||||
", mobile='" + mobile + '\'' +
|
||||
", front_task='" + front_task + '\'' +
|
||||
", is_admin='" + is_admin + '\'' +
|
||||
", praise=" + praise +
|
||||
", isHide=" + isHide +
|
||||
", randomPk=" + randomPk +
|
||||
", mRankPkImgUrl='" + mRankPkImgUrl + '\'' +
|
||||
", user_info_complete=" + user_info_complete +
|
||||
", fansLevel=" + fansLevel +
|
||||
", typeMic=" + typeMic +
|
||||
", isMicList=" + isMicList +
|
||||
", isRequest=" + isRequest +
|
||||
", fansEnterRoomUrl='" + fansEnterRoomUrl + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -19,7 +19,6 @@ import io.agora.rtc2.ChannelMediaOptions;
|
||||
import io.agora.rtc2.Constants;
|
||||
import io.agora.rtc2.IRtcEngineEventHandler;
|
||||
import io.agora.rtc2.RtcConnection;
|
||||
import io.agora.rtc2.RtcEngine;
|
||||
import io.agora.rtc2.RtcEngineConfig;
|
||||
import io.agora.rtc2.RtcEngineEx;
|
||||
import io.agora.rtc2.video.VideoCanvas;
|
||||
@ -55,7 +54,6 @@ public class SWManager extends BaseCacheManager {
|
||||
|
||||
/**
|
||||
* 获取单列
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static SWManager get() {
|
||||
@ -117,6 +115,10 @@ public class SWManager extends BaseCacheManager {
|
||||
mRtcEngine.setupLocalVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置清晰度
|
||||
* @param selectClarity
|
||||
*/
|
||||
public void setDimensions(int selectClarity) {
|
||||
if (cfg != null && mRtcEngine != null) {
|
||||
switch (selectClarity) {
|
||||
@ -135,9 +137,9 @@ public class SWManager extends BaseCacheManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建房间
|
||||
* 创建直播间
|
||||
*/
|
||||
public void createRoom(String token, String channelName) {
|
||||
public void createChannel(String token, String channelName) {
|
||||
ChannelMediaOptions options = new ChannelMediaOptions();
|
||||
// 设置角色 BROADCASTER (主播) 或 AUDIENCE (观众)
|
||||
options.clientRoleType = Constants.CLIENT_ROLE_BROADCASTER;
|
||||
@ -145,23 +147,28 @@ public class SWManager extends BaseCacheManager {
|
||||
mRtcEngine.joinChannel(token, channelName, uid, options);
|
||||
}
|
||||
|
||||
public void updateMyVideoView(FrameLayout frameLayout, String channelName) {
|
||||
mRtcEngine.setupRemoteVideoEx(null, null);
|
||||
|
||||
RtcConnection rtcConnection = new RtcConnection();
|
||||
rtcConnection.channelId = channelName; //自己频道名称
|
||||
rtcConnection.localUid = uid;//自己的ID
|
||||
|
||||
/**
|
||||
* 更新主播视图
|
||||
* @param frameLayout
|
||||
*/
|
||||
public void updateMyChannelView(FrameLayout frameLayout) {
|
||||
mRtcEngine.setupLocalVideo(null);
|
||||
SurfaceView surfaceView = new SurfaceView(mContext);
|
||||
surfaceView.setZOrderMediaOverlay(true);
|
||||
frameLayout.addView(surfaceView);
|
||||
|
||||
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid);
|
||||
mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection);
|
||||
mRtcEngine.setupLocalVideo(videoCanvas);
|
||||
}
|
||||
|
||||
|
||||
public void joinExRoomEx(String strUid, String token,String toUid, String channelName) {
|
||||
/**
|
||||
* PK-加入对方主播直播间
|
||||
* @param strUid
|
||||
* @param token
|
||||
* @param toUid
|
||||
* @param channelName
|
||||
*/
|
||||
public void joinChannelEx(String strUid, String token, String toUid, String channelName) {
|
||||
int tempUid;
|
||||
if (StringUtil.isEmpty(strUid)) {
|
||||
tempUid = 0;
|
||||
@ -199,6 +206,11 @@ public class SWManager extends BaseCacheManager {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLeaveChannel(RtcStats stats) {
|
||||
super.onLeaveChannel(stats);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int err) {
|
||||
super.onError(err);
|
||||
@ -207,6 +219,30 @@ public class SWManager extends BaseCacheManager {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出对方直播间
|
||||
* @param uid 自己的ID
|
||||
* @param liveUid 对方直播间号
|
||||
*/
|
||||
public void exitChannelToUid(int uid, String liveUid){
|
||||
RtcConnection rtcConnection = new RtcConnection();
|
||||
rtcConnection.channelId = getChannelName(liveUid); //對方主播的頻道
|
||||
rtcConnection.localUid = uid;//自己的ID
|
||||
mRtcEngine.leaveChannelEx(rtcConnection);
|
||||
}
|
||||
|
||||
//设置对方主播视图
|
||||
private void setupRemoteVideo(int uid) {
|
||||
SurfaceView surfaceView = new SurfaceView(mContext);
|
||||
surfaceView.setZOrderMediaOverlay(true);
|
||||
pkContainer1.addView(surfaceView);
|
||||
// 将 SurfaceView 对象传入声网实时互动 SDK,设置远端视图
|
||||
mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_FIT, uid));
|
||||
}
|
||||
|
||||
public void setAnchorContainer(FrameLayout anchorContainer) {
|
||||
this.anchorContainer = anchorContainer;
|
||||
}
|
||||
//远程监听
|
||||
private final IRtcEngineEventHandler mRtcEventHandler = new IRtcEngineEventHandler() {
|
||||
@Override
|
||||
@ -224,6 +260,7 @@ public class SWManager extends BaseCacheManager {
|
||||
@Override
|
||||
public void onJoinChannelSuccess(String channel, int uid, int elapsed) {
|
||||
super.onJoinChannelSuccess(channel, uid, elapsed);
|
||||
L.eSw("onJoinChannelSuccess 加入频道:channel"+channel+" uid:"+uid+" elapsed:"+elapsed);
|
||||
if (onRtcEngineListener != null) {
|
||||
onRtcEngineListener.onOpenSuccess(channel, uid);
|
||||
}
|
||||
@ -232,20 +269,29 @@ public class SWManager extends BaseCacheManager {
|
||||
@Override
|
||||
public void onError(int err) {
|
||||
super.onError(err);
|
||||
L.eSw("onError 错误码:"+err);
|
||||
ToastUtil.show("onError:" + err);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTokenPrivilegeWillExpire(String token) {
|
||||
super.onTokenPrivilegeWillExpire(token);
|
||||
L.eSw("onTokenPrivilegeWillExpire_Token 即将失效");
|
||||
refreshToken();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestToken() {
|
||||
super.onRequestToken();
|
||||
L.eSw("onRequestToken_Token失效");
|
||||
refreshToken();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLeaveChannel(RtcStats stats) {
|
||||
super.onLeaveChannel(stats);
|
||||
L.eSw("onLeaveChannel退出頻道");
|
||||
}
|
||||
};
|
||||
|
||||
private void refreshToken() {
|
||||
@ -255,6 +301,7 @@ public class SWManager extends BaseCacheManager {
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.renewToken(data.getToken());
|
||||
}
|
||||
L.eSw("refreshToken_重新获取Token成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -264,19 +311,6 @@ public class SWManager extends BaseCacheManager {
|
||||
});
|
||||
}
|
||||
|
||||
//设置对方主播视图
|
||||
private void setupRemoteVideo(int uid) {
|
||||
SurfaceView surfaceView = new SurfaceView(mContext);
|
||||
surfaceView.setZOrderMediaOverlay(true);
|
||||
pkContainer1.addView(surfaceView);
|
||||
// 将 SurfaceView 对象传入声网实时互动 SDK,设置远端视图
|
||||
mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_FIT, uid));
|
||||
}
|
||||
|
||||
public void setAnchorContainer(FrameLayout anchorContainer) {
|
||||
this.anchorContainer = anchorContainer;
|
||||
}
|
||||
|
||||
public interface onRtcEngineListener {
|
||||
void onOpenSuccess(String channel, int uid);
|
||||
}
|
||||
@ -296,4 +330,7 @@ public class SWManager extends BaseCacheManager {
|
||||
public void setLinkUserContainer(FrameLayout linkUserContainer) {
|
||||
this.linkUserContainer = linkUserContainer;
|
||||
}
|
||||
public static String getChannelName(String liveUid) {
|
||||
return CommonAppConfig.SWChannelPrefix + liveUid;
|
||||
}
|
||||
}
|
||||
|
@ -1476,7 +1476,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
|
||||
@Override
|
||||
public void onLinkMicToPk(String uid, String pkhead, String pkname) {
|
||||
|
||||
L.eSw("onLinkMicToPkonLinkMicToPkonLinkMicToPk");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -887,7 +887,17 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
|
||||
// TODO: 2024/4/12 视图渲染
|
||||
livePushRyViewHolder.setAnPkRtc(bean);
|
||||
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
public void run() {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.UN_LEAVELIVE));
|
||||
LiveRyAnchorActivity.isDRPK = 1;
|
||||
LivePushRyViewHolder.btn_close.setVisibility(View.VISIBLE);
|
||||
SocketRyLinkMicPkUtil.linkMicPkAccept(mSocketRyClient, mApplyUid, mApplyUrl, mApplyNmae);
|
||||
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.UP_PK_TWO).setObject(mApplyUid));
|
||||
onLinkMicPkStart(mApplyUid, 2);
|
||||
}
|
||||
});
|
||||
|
||||
/*IMRTCManager.getInstance().responseJoinOtherRoom(mApplyUid, true, msg1.toString(), new IRCRTCResultCallback() {
|
||||
@Override
|
||||
@ -2294,6 +2304,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
mPkUid = pkUid;
|
||||
mApplyUid = null;
|
||||
mApplyStream = null;
|
||||
|
||||
if (mLiveLinkMicPkViewHolder == null) {
|
||||
mLiveLinkMicPkViewHolder = new LiveLinkMicPkViewHolder(mContext, mPkContainer);
|
||||
mLiveLinkMicPkViewHolder.addToParent();
|
||||
@ -2301,7 +2312,6 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
if (mContext instanceof LiveAudienceActivity) {
|
||||
((LiveAudienceActivity) mContext).getmLivePlayViewHolder().setPkview();
|
||||
}
|
||||
|
||||
}
|
||||
mLiveLinkMicPkViewHolder.startAnim();
|
||||
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_START).setObject(pkUid));
|
||||
|
@ -204,10 +204,7 @@ public class SocketRyClient {
|
||||
EventBus.getDefault().post("UsertoRY");
|
||||
} else if (actions == 5) {
|
||||
JSONObject mic_data = map.getJSONObject("ct");
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_UPDATE_MIC_LIST)
|
||||
.setObject(JSONArray.parseArray(mic_data.getJSONArray("userlist").toString(), LinkMicUserBean.class))
|
||||
);
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_UPDATE_MIC_LIST).setObject(JSONArray.parseArray(mic_data.getJSONArray("userlist").toString(), LinkMicUserBean.class)));
|
||||
MicedUserManager.get().upDataMicUserList(JSONArray.parseArray(mic_data.getJSONArray("userlist").toString(), LinkMicUserBean.class));
|
||||
} else if (actions == 6) {
|
||||
if (WordUtil.isNewZh()) {
|
||||
@ -216,9 +213,7 @@ public class SocketRyClient {
|
||||
ToastUtil.show("The host has disabled the voice connection function");
|
||||
}
|
||||
EventBus.getDefault().post("endMic");
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_CLOSE)
|
||||
.setObject(map.toJavaObject(LinkMicUserBean.class)));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_CLOSE).setObject(map.toJavaObject(LinkMicUserBean.class)));
|
||||
} else if (actions == 8) {
|
||||
if (WordUtil.isNewZh()) {
|
||||
ToastUtil.show("您已被移出多人語音連麥");
|
||||
@ -227,24 +222,16 @@ public class SocketRyClient {
|
||||
}
|
||||
EventBus.getDefault().post("endMic");
|
||||
} else if (actions == 3) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC)
|
||||
.setObject(map.toJavaObject(LinkMicUserBean.class))
|
||||
);
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC).setObject(map.toJavaObject(LinkMicUserBean.class)));
|
||||
MicUserManager.get().upDataMicUser(map);
|
||||
} else if (actions == 7) {//取消连麦
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_CANCEL)
|
||||
);
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_CANCEL));
|
||||
MicUserManager.get().removeMiscUser(map);
|
||||
}
|
||||
break;
|
||||
case Constants.UP_USER_LIST:
|
||||
mListener.onUpUserList(map.getJSONObject("ct"));
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_UPDATE_AUDIENCE_LIST)
|
||||
.setObject(JSON.parseArray(map.getJSONObject("ct").getString("userlist"), LiveUserGiftBean.class))
|
||||
);
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_UPDATE_AUDIENCE_LIST).setObject(JSON.parseArray(map.getJSONObject("ct").getString("userlist"), LiveUserGiftBean.class)));
|
||||
break;
|
||||
case Constants.CARD:
|
||||
// LiveLinkMicPresenter.setHD(map.getString("ct"));
|
||||
@ -263,9 +250,7 @@ public class SocketRyClient {
|
||||
} else {
|
||||
if (!WordUtil.isNewZh() && map.getString("ct").contains("退出比賽") && map.getString("ct").contains("獲得勝利")) {
|
||||
String ctTmp = map.getString("ct");
|
||||
ctTmp = ctTmp.replace("由於", "Due to")
|
||||
.replace("退出比賽", "withdrawing from the competition")
|
||||
.replace("獲得勝利", "won");
|
||||
ctTmp = ctTmp.replace("由於", "Due to").replace("退出比賽", "withdrawing from the competition").replace("獲得勝利", "won");
|
||||
map.put("ct", ctTmp);
|
||||
}
|
||||
systemChatMessage2(map.getString("ct"));
|
||||
@ -333,16 +318,10 @@ public class SocketRyClient {
|
||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
// LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, map.getIntValue("drpk_time"));
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LEAVE_PK_SCORE)
|
||||
.setPkScores(map.getJSONArray("userlist"))
|
||||
.setUid(mLiveUid)
|
||||
.setTime(map.getIntValue("drpk_time")));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LEAVE_PK_SCORE).setPkScores(map.getJSONArray("userlist")).setUid(mLiveUid).setTime(map.getIntValue("drpk_time")));
|
||||
if (livePushRyViewHolder == null) {
|
||||
// LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW)
|
||||
);
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW));
|
||||
}
|
||||
|
||||
|
||||
@ -352,14 +331,11 @@ public class SocketRyClient {
|
||||
if (LiveRyAnchorActivity.mLiveAnchorViewHolder != null) {
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
|
||||
params.topMargin = 0;
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LEAVE_DR_ROOM));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LEAVE_DR_ROOM));
|
||||
isDRPK = 0;
|
||||
} else {
|
||||
// LiveAudienceActivity.getmLivePlayViewHolder().setPkEndview();
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_END_VIEW)
|
||||
);
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_END_VIEW));
|
||||
|
||||
}
|
||||
//創建了多人房間
|
||||
@ -367,16 +343,12 @@ public class SocketRyClient {
|
||||
/* if (LiveAudienceActivity.getmLivePlayViewHolder() != null) {
|
||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||
}*/
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW)
|
||||
);
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW));
|
||||
isDRPK = 1;
|
||||
} else if (action3 == 10) {
|
||||
if (!map.getString("uid").equals(CommonAppConfig.getInstance().getUid())) {
|
||||
// LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW)
|
||||
);
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW));
|
||||
}
|
||||
}
|
||||
|
||||
@ -413,39 +385,19 @@ public class SocketRyClient {
|
||||
} else {
|
||||
boxTypeName = WordUtil.isNewZh() ? "PD盲盒" : "PD blind box";
|
||||
}
|
||||
AllServerNotifyEvent allServerNotifyEvent
|
||||
= new AllServerNotifyEvent()
|
||||
.setBlindBoxId(map.getString("blind_box_id"))
|
||||
.setBoxType(boxType)
|
||||
.setBoxTypeName(boxTypeName)
|
||||
.setDressName(WordUtil.isNewZh() ? map.getString("dress_name") : TextUtils.isEmpty(map.getString("dress_nameen")) ? map.getString("dress_name") : map.getString("dress_nameen"))
|
||||
.setGiftNotification(map.getString("gift_notification"))
|
||||
.setGiftName(WordUtil.isNewZh() ? mCt.getString("giftname") : mCt.getString("giftnameen"))
|
||||
.setUserNiceName(map.getString("uname"))
|
||||
.setGiftIcon(map.getString("gifticon"))
|
||||
.setAnchorName(map.getString("ancherName"))
|
||||
.setDisplaySrc(map.getString("display_src"));
|
||||
AllServerNotifyEvent allServerNotifyEvent = new AllServerNotifyEvent().setBlindBoxId(map.getString("blind_box_id")).setBoxType(boxType).setBoxTypeName(boxTypeName).setDressName(WordUtil.isNewZh() ? map.getString("dress_name") : TextUtils.isEmpty(map.getString("dress_nameen")) ? map.getString("dress_name") : map.getString("dress_nameen")).setGiftNotification(map.getString("gift_notification")).setGiftName(WordUtil.isNewZh() ? mCt.getString("giftname") : mCt.getString("giftnameen")).setUserNiceName(map.getString("uname")).setGiftIcon(map.getString("gifticon")).setAnchorName(map.getString("ancherName")).setDisplaySrc(map.getString("display_src"));
|
||||
Log.e("AllServerNotifyEvent", allServerNotifyEvent.toString());
|
||||
Log.e("AllServerNotifyEvent", map.toJSONString());
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.BLIND_BOX)
|
||||
.setAllServerNotifyEvent(allServerNotifyEvent));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.BLIND_BOX).setAllServerNotifyEvent(allServerNotifyEvent));
|
||||
} else if (action2 == 89) {//红包
|
||||
JSONObject mCt = map.getJSONObject("ct");
|
||||
AllServerNotifyEvent allServerNotifyEvent
|
||||
= new AllServerNotifyEvent()
|
||||
.setUserNiceName(mCt.getString("user_nicename"))
|
||||
.setGiftName(WordUtil.isNewZh() ? map.getString("giftname") : map.getString("giftname_en"))
|
||||
.setGiftIcon(mCt.getString("gifticon"))
|
||||
.setRedPacket(true);
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.BLIND_BOX)
|
||||
.setAllServerNotifyEvent(allServerNotifyEvent));
|
||||
AllServerNotifyEvent allServerNotifyEvent = new AllServerNotifyEvent().setUserNiceName(mCt.getString("user_nicename")).setGiftName(WordUtil.isNewZh() ? map.getString("giftname") : map.getString("giftname_en")).setGiftIcon(mCt.getString("gifticon")).setRedPacket(true);
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.BLIND_BOX).setAllServerNotifyEvent(allServerNotifyEvent));
|
||||
} else if (action2 == 90) {
|
||||
NewAllServerNotifyGuardEvent notifyGuardEvent = GsonUtils.fromJson(map.toString(), NewAllServerNotifyGuardEvent.class);
|
||||
Bus.get().post(notifyGuardEvent);
|
||||
buyGuardInSameRoom(map);
|
||||
}else if (action2==91){
|
||||
} else if (action2 == 91) {
|
||||
AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent = GsonUtils.fromJson(map.toString(), AllServerNotifyFFGGGDJANEvent.class);
|
||||
Bus.get().post(notifyFFGGGDJANEvent);
|
||||
}
|
||||
@ -473,12 +425,7 @@ public class SocketRyClient {
|
||||
mListener.onAnchorInvalid();
|
||||
}
|
||||
//主播强制下播
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_END)
|
||||
.setVotes(map.getString("votes"))
|
||||
.setLength(map.getString("length"))
|
||||
.setNums(map.getIntValue("nums"))
|
||||
.setUname(map.getString("uname")));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LIVE_END).setVotes(map.getString("votes")).setLength(map.getString("length")).setNums(map.getIntValue("nums")).setUname(map.getString("uname")));
|
||||
break;
|
||||
case Constants.SOCKET_CHANGE_LIVE://主播切换计时收费类型
|
||||
mListener.onChangeTimeCharge(map.getIntValue("type_val"));
|
||||
@ -619,9 +566,7 @@ public class SocketRyClient {
|
||||
List<MsgModel> msg = model.getMsg();
|
||||
if (msg.size() > 0) {
|
||||
// EventBus.getDefault().post(msg.get(0));
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.TRUMPET_NOTIFY)
|
||||
.setMsgModel(msg.get(0)));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.TRUMPET_NOTIFY).setMsgModel(msg.get(0)));
|
||||
}
|
||||
break;
|
||||
case Constants.RECOMMEND_CARD_NOTIFY://推荐卡消息通知
|
||||
@ -629,9 +574,7 @@ public class SocketRyClient {
|
||||
List<MsgModel> recommendCardNotifyMsg = recommendCardNotifyModel.getMsg();
|
||||
if (recommendCardNotifyMsg.size() > 0) {
|
||||
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.RECOMMEND_CARD_NOTIFY)
|
||||
.setMsgModel(recommendCardNotifyMsg.get(0)));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.RECOMMEND_CARD_NOTIFY).setMsgModel(recommendCardNotifyMsg.get(0)));
|
||||
}
|
||||
break;
|
||||
case Constants.STAR_CHALLENGE_UPDATE://星级助力
|
||||
@ -648,29 +591,21 @@ public class SocketRyClient {
|
||||
case Constants.AI_AUTOMATIC_SPEECH_LIVE:
|
||||
//{"name_color":"#f19ec2","ai_name":"助手小小P","content":"@1 ","user_name":"1","icon":"https://downs.yaoulive.com/xzs_tab.png","system_bubble":"https://downs.yaoulive.com/xzs_qipao.9.png"}
|
||||
AiAutomaticSpeechModel aiAutomaticSpeechModel = GsonUtils.fromJson(map.getString("ct"), AiAutomaticSpeechModel.class);
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.AI_AUTOMATIC_SPEECH)
|
||||
.setAiAutomaticSpeechModel(aiAutomaticSpeechModel));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.AI_AUTOMATIC_SPEECH).setAiAutomaticSpeechModel(aiAutomaticSpeechModel));
|
||||
break;
|
||||
case Constants.STAR_CHALLENGE_UPGRADE_NOTIFY:
|
||||
SocketModel starChallengeUpgradeNotify = GsonUtils.fromJson(socketMsg, SocketModel.class);
|
||||
List<MsgModel> starChallengeUpgradeNotifyMsg = starChallengeUpgradeNotify.getMsg();
|
||||
if (starChallengeUpgradeNotifyMsg.size() > 0) {
|
||||
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.STAR_CHALLENGE_UPGRADE_NOTIFY)
|
||||
.setMsgModel(starChallengeUpgradeNotifyMsg.get(0)));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.STAR_CHALLENGE_UPGRADE_NOTIFY).setMsgModel(starChallengeUpgradeNotifyMsg.get(0)));
|
||||
}
|
||||
break;
|
||||
case Constants.LuckyAngel:
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LUCKY_ANGEL)
|
||||
.setMsgModel(GsonUtils.fromJson(map.getJSONObject("ct").toString(), MsgModel.class)));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LUCKY_ANGEL).setMsgModel(GsonUtils.fromJson(map.getJSONObject("ct").toString(), MsgModel.class)));
|
||||
break;
|
||||
case Constants.Lucky100Check:
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LUCKY_100_CHECK)
|
||||
.setMsgModel(GsonUtils.fromJson(map.getJSONObject("ct").toString(), MsgModel.class)));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LUCKY_100_CHECK).setMsgModel(GsonUtils.fromJson(map.getJSONObject("ct").toString(), MsgModel.class)));
|
||||
break;
|
||||
case Constants.PK_RANK_UPDATE:
|
||||
Log.i("PK排位", map.toString());
|
||||
@ -680,117 +615,68 @@ public class SocketRyClient {
|
||||
pkRankBean.setName(item.getString("new_rank_name"));
|
||||
pkRankBean.setImg(item.getString("new_rank_img"));
|
||||
pkRankBean.setNewRankNameEn(item.getString("new_rank_name_en"));
|
||||
EventBus.getDefault().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.PK_RANK_UPDATE)
|
||||
.setObject(pkRankBean));
|
||||
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_RANK_UPDATE).setObject(pkRankBean));
|
||||
break;
|
||||
case Constants.CUSTOM_FULL_SERVICE_NOTIFY:
|
||||
Log.e("全服通知", map.toString());
|
||||
CustomFullServiceNotifyEvent customFullServiceNotifyEvent = GsonUtils.fromJson(map.toString(), CustomFullServiceNotifyEvent.class);
|
||||
EventBus.getDefault().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.CUSTOM_FULL_SERVICE_NOTIFY)
|
||||
.setCustomFullServiceNotifyEvent(customFullServiceNotifyEvent));
|
||||
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.CUSTOM_FULL_SERVICE_NOTIFY).setCustomFullServiceNotifyEvent(customFullServiceNotifyEvent));
|
||||
break;
|
||||
case Constants.XYD_COMPLETE:
|
||||
|
||||
// xydComplete(map);
|
||||
XydCompleteModel xydCompleteModel = GsonUtils.fromJson(map.toString(), XydCompleteModel.class);
|
||||
EventBus.getDefault().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.XYD_COMPLETE)
|
||||
.setXydCompleteModel(xydCompleteModel)
|
||||
.setLiveReceiveGiftBean(JSON.parseObject(map.toString(), LiveReceiveGiftBean.class)));
|
||||
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.XYD_COMPLETE).setXydCompleteModel(xydCompleteModel).setLiveReceiveGiftBean(JSON.parseObject(map.toString(), LiveReceiveGiftBean.class)));
|
||||
break;
|
||||
case "GuardSpecialEffect":
|
||||
LiveReceiveGiftBean giftBean = JSON.parseObject(map.toString(), LiveReceiveGiftBean.class);
|
||||
giftBean.setMedal_name(map.getString("medal_name"));
|
||||
EventBus.getDefault().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GuardSpecialEffect)
|
||||
.setLiveReceiveGiftBean(giftBean));
|
||||
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.GuardSpecialEffect).setLiveReceiveGiftBean(giftBean));
|
||||
break;
|
||||
case Constants.WISH_LIST_PROGRESS:
|
||||
StringBuffer conString = new StringBuffer();
|
||||
conString.append(WordUtil.isNewZh() ? map.getString("msg") : map.getString("msg_en"));
|
||||
EventBus.getDefault().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.WISH_LIST_PROGRESS)
|
||||
.setWishListProgress(new WishModel()
|
||||
.setWishlistProgress(map.getString("wishlist_progress"))
|
||||
.setWishlistIcon(map.getString("wishlist_icon"))
|
||||
.setWishlistName(map.getString("wishlist_name"))
|
||||
.setWishlistNum(map.getString("wishlist_num"))
|
||||
.setGiftType(map.getInteger("giftId"))
|
||||
.setLuid(conString.toString())).setUname(map.getString("userName")).setLiveType(Integer.parseInt(map.getString("level"))));
|
||||
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.WISH_LIST_PROGRESS).setWishListProgress(new WishModel().setWishlistProgress(map.getString("wishlist_progress")).setWishlistIcon(map.getString("wishlist_icon")).setWishlistName(map.getString("wishlist_name")).setWishlistNum(map.getString("wishlist_num")).setGiftType(map.getInteger("giftId")).setLuid(conString.toString())).setUname(map.getString("userName")).setLiveType(Integer.parseInt(map.getString("level"))));
|
||||
break;
|
||||
case Constants.LIVE_VOTE_CREATE:
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.VOTE_CREATE)
|
||||
.setObject(map)
|
||||
);
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.VOTE_CREATE).setObject(map));
|
||||
break;
|
||||
case Constants.LIVE_VOTE_END:
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.VOTE_END)
|
||||
.setObject(map)
|
||||
);
|
||||
EventBus.getDefault().post(new LiveAnchorEvent()
|
||||
.setType(LiveAnchorEvent.LiveAnchorType.VOTE_ANCHOR_END)
|
||||
.setObject(map)
|
||||
);
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.VOTE_END).setObject(map));
|
||||
EventBus.getDefault().post(new LiveAnchorEvent().setType(LiveAnchorEvent.LiveAnchorType.VOTE_ANCHOR_END).setObject(map));
|
||||
break;
|
||||
case Constants.LIVE_VOTE_UPDATE:
|
||||
//通知给观众
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.VOTE_UPDATE)
|
||||
.setObject(map)
|
||||
);
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.VOTE_UPDATE).setObject(map));
|
||||
//通知给主播
|
||||
EventBus.getDefault().post(new LiveAnchorEvent()
|
||||
.setType(LiveAnchorEvent.LiveAnchorType.VOTE_ANCHOR_UPDATE)
|
||||
.setObject(map)
|
||||
);
|
||||
EventBus.getDefault().post(new LiveAnchorEvent().setType(LiveAnchorEvent.LiveAnchorType.VOTE_ANCHOR_UPDATE).setObject(map));
|
||||
break;
|
||||
case Constants.LIVE_PK_END:
|
||||
|
||||
mListener.onEndPk(map.getLong("uid"),
|
||||
map.getLong("pkuid"),
|
||||
map.getLong("uid_score"),
|
||||
map.getLong("pkuid_score"),
|
||||
JSONObject.parseObject(map.getJSONObject("ct").getJSONObject("pk_top_users").toJSONString(), LivePKUserListBean.class)
|
||||
);
|
||||
mListener.onEndPk(map.getLong("uid"), map.getLong("pkuid"), map.getLong("uid_score"), map.getLong("pkuid_score"), JSONObject.parseObject(map.getJSONObject("ct").getJSONObject("pk_top_users").toJSONString(), LivePKUserListBean.class));
|
||||
break;
|
||||
case Constants.RED_PACKET:
|
||||
RedPacketModel redPacketModel = GsonUtils.fromJson(map.toString(), RedPacketModel.class);
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.RED_PACKET)
|
||||
.setRedPacketModel(redPacketModel));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.RED_PACKET).setRedPacketModel(redPacketModel));
|
||||
break;
|
||||
case Constants.RED_PACKET_SUPER_JACKPOT:
|
||||
RedPacketInfoModel redPacketInfoModel = GsonUtils.fromJson(map.toString(), RedPacketInfoModel.class);
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.RED_PACKET_SUPER_JACKPOT)
|
||||
.setRedPacketInfoModel(redPacketInfoModel));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.RED_PACKET_SUPER_JACKPOT).setRedPacketInfoModel(redPacketInfoModel));
|
||||
break;
|
||||
case "GiftWallIlluminate":
|
||||
Log.e("GiftWallIlluminate", map.toString());
|
||||
Bus.get().post(new GiftWallIlluminateEvent()
|
||||
.setNewNumber(map.getInteger("new_number"))
|
||||
.setMaxNumber(map.getInteger("max_number")));
|
||||
Bus.get().post(new GiftWallIlluminateEvent().setNewNumber(map.getInteger("new_number")).setMaxNumber(map.getInteger("max_number")));
|
||||
break;
|
||||
case SOCKET_LIVE_MSG_TO_USER:
|
||||
sendToUserMsg(map);
|
||||
break;
|
||||
case "SudGameCreateRoom":
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.SUD_GAME_CREATE_ROOM)
|
||||
.setAvatar(WordUtil.isNewZh() ? map.getString("sud_game_name") : map.getString("sud_game_name_en"))
|
||||
.setCreateSudRoomModel(GsonUtils.fromJson(map.toString(), SudGameDateModel.class)));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.SUD_GAME_CREATE_ROOM).setAvatar(WordUtil.isNewZh() ? map.getString("sud_game_name") : map.getString("sud_game_name_en")).setCreateSudRoomModel(GsonUtils.fromJson(map.toString(), SudGameDateModel.class)));
|
||||
break;
|
||||
case "sendQuickGift":
|
||||
SendQuickGiftModel sendQuickGiftModel = GsonUtils.fromJson(map.toString(), SendQuickGiftModel.class);
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(sendQuickGiftModel.getUserNicename())
|
||||
.append(WordUtil.isNewZh() ? " 送出了 " : " sent ")
|
||||
.append(sendQuickGiftModel.getQuickGiftNumber())
|
||||
.append(WordUtil.isNewZh() ? " 個小PD " : " small pandas ");
|
||||
stringBuffer.append(sendQuickGiftModel.getUserNicename()).append(WordUtil.isNewZh() ? " 送出了 " : " sent ").append(sendQuickGiftModel.getQuickGiftNumber()).append(WordUtil.isNewZh() ? " 個小PD " : " small pandas ");
|
||||
systemChatMessage2(stringBuffer.toString());
|
||||
Bus.get().post(new QuickGiftingEvent().setHotNum(sendQuickGiftModel.getHotNum()));
|
||||
break;
|
||||
@ -805,9 +691,7 @@ public class SocketRyClient {
|
||||
pkRankBean.setRedVal(item.getString("uid_win_continuity"));
|
||||
pkRankBean.setPkTopImgUrl(item.getString("pktt_img"));
|
||||
|
||||
EventBus.getDefault().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.PK_RANK_START)
|
||||
.setObject(pkRankBean));
|
||||
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_RANK_START).setObject(pkRankBean));
|
||||
break;
|
||||
case "guardMaturityDateRemind":
|
||||
GuardMaturityDateRemindModel maturityDateRemindModel = GsonUtils.fromJson(map.toString(), GuardMaturityDateRemindModel.class);
|
||||
@ -1059,8 +943,7 @@ public class SocketRyClient {
|
||||
FansModel fansMedalBean = new NewLevelManager(mContext).getFansModel(map.getIntValue("medal_level"));
|
||||
u.setFansLevel(obj.getIntValue("medal_level"));
|
||||
u.setFansEnterRoomUrl(obj.getString("medal_backgroup_thumb"));
|
||||
if (fansMedalBean != null)
|
||||
chatBean.setMedalLevelImageUrl(fansMedalBean.getThumb());
|
||||
if (fansMedalBean != null) chatBean.setMedalLevelImageUrl(fansMedalBean.getThumb());
|
||||
mListener.onEnterRoom(new LiveEnterRoomBean(u, chatBean));
|
||||
}
|
||||
}
|
||||
@ -1092,8 +975,7 @@ public class SocketRyClient {
|
||||
//增加粉丝徽章信息
|
||||
chatBean.setMedalNmae(map.getString("medal_name"));
|
||||
FansModel fansMedalBean = new NewLevelManager(mContext).getFansModel(map.getIntValue("medal_level"));
|
||||
if (fansMedalBean != null)
|
||||
chatBean.setMedalLevelImageUrl(fansMedalBean.getThumb());
|
||||
if (fansMedalBean != null) chatBean.setMedalLevelImageUrl(fansMedalBean.getThumb());
|
||||
//聊天列表显示 玩家名 送 1 个 礼物名
|
||||
|
||||
if (CommonAppContext.lang.equals("chinese")) {
|
||||
@ -1118,8 +1000,7 @@ public class SocketRyClient {
|
||||
mListener.onSendGift(receiveGiftBean, null);
|
||||
}
|
||||
//同一个直播间时才刷新pk
|
||||
if (mLiveUid.equals(map.getString("pkuid1")) ||
|
||||
mLiveUid.equals(map.getString("pkuid2"))) {
|
||||
if (mLiveUid.equals(map.getString("pkuid1")) || mLiveUid.equals(map.getString("pkuid2"))) {
|
||||
mListener.onSendGiftPk(map.getLongValue("pktotal2"), map.getLongValue("pktotal1"), livePKUserListBean);
|
||||
}
|
||||
}
|
||||
@ -1215,8 +1096,7 @@ public class SocketRyClient {
|
||||
//增加粉丝徽章信息
|
||||
chatBean.setMedalNmae(map.getString("medal_name"));
|
||||
FansModel fansMedalBean = new NewLevelManager(mContext).getFansModel(map.getIntValue("medal_level"));
|
||||
if (fansMedalBean != null)
|
||||
chatBean.setMedalLevelImageUrl(fansMedalBean.getThumb());
|
||||
if (fansMedalBean != null) chatBean.setMedalLevelImageUrl(fansMedalBean.getThumb());
|
||||
|
||||
receiveGiftBean.setLiveChatBean(chatBean);
|
||||
|
||||
@ -1244,11 +1124,7 @@ public class SocketRyClient {
|
||||
|
||||
}
|
||||
if (map.getIntValue("drpk_status") == 1) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LEAVE_PK_SCORE)
|
||||
.setPkScores(map.getJSONArray("userlist"))
|
||||
.setUid(mLiveUid)
|
||||
.setTime(0));
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LEAVE_PK_SCORE).setPkScores(map.getJSONArray("userlist")).setUid(mLiveUid).setTime(0));
|
||||
// LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, 0);
|
||||
}
|
||||
|
||||
@ -1387,6 +1263,11 @@ public class SocketRyClient {
|
||||
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_START);
|
||||
mListener.onLinkMicToPk(map.getString("uid"), map.getString("pkhead"), map.getString("pkname"));
|
||||
mListener.onLinkMicPkStart(map.getString("uid"), map.getString("pkhead"), map.getString("pkname"), map.getString("is_ladders"));// mListener.onLinkMicPkStart(map.getString("uid"));
|
||||
if (livePushRyViewHolder != null) {
|
||||
UserBean userBean = new UserBean();
|
||||
userBean.setId(map.getString("uid"));
|
||||
livePushRyViewHolder.setAnPkRtc(userBean);
|
||||
}
|
||||
break;
|
||||
case 3://对方主播拒绝PK的回调
|
||||
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_REFUSE);
|
||||
@ -1399,30 +1280,18 @@ public class SocketRyClient {
|
||||
break;
|
||||
case 5://PK时候断开连麦的回调
|
||||
// if (rtcRoom != null) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.DISCONNEXT_PK_TIME));
|
||||
RCRTCEngine.getInstance().leaveOtherRoom(map.getString("pkuid"), true, new IRCRTCResultCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("ry", map.getString("pkuid") + "退出多人成功a as");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(RTCErrorCode rtcErrorCode) {
|
||||
Log.e("ry", map.getString("pkuid") + "退asa出多人失败" + rtcErrorCode);
|
||||
|
||||
}
|
||||
});
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.DISCONNEXT_PK_TIME));
|
||||
//断开连麦
|
||||
HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout")
|
||||
.execute(new HttpCallback() {
|
||||
HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout").execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
|
||||
}
|
||||
});
|
||||
// }
|
||||
if (livePushRyViewHolder != null) {
|
||||
livePushRyViewHolder.onLinkMicAnchorClose();
|
||||
}
|
||||
mListener.onLinkMicPkClose(1);
|
||||
if (RandomPkManager.getInstance().isRandomModel()) {
|
||||
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_DEFAULT);
|
||||
@ -1436,8 +1305,10 @@ public class SocketRyClient {
|
||||
break;
|
||||
case 9://pk结束的回调
|
||||
mListener.onLinkMicPkEnd(map.getString("win_uid"));
|
||||
EventBus.getDefault().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_PK_END));
|
||||
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LIVE_PK_END));
|
||||
if (livePushRyViewHolder != null) {
|
||||
livePushRyViewHolder.onLinkMicAnchorClose();
|
||||
}
|
||||
break;
|
||||
case 10://系统发起PK回调
|
||||
JSONObject msg1 = new JSONObject();
|
||||
|
@ -120,6 +120,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
||||
private boolean isPk = false;
|
||||
private boolean isNeedOpenCamera = false;
|
||||
private SWManager swManager;
|
||||
private String pkUid1;
|
||||
|
||||
//修改上面主播的头像
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@ -515,31 +516,13 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
||||
if (code == 0) {
|
||||
JSONObject datas = JSONObject.parseObject(info[0]);
|
||||
String pkUid = datas.getString("pkuid");
|
||||
|
||||
//退出副房间
|
||||
RCRTCEngine.getInstance().leaveOtherRoom(pkUid, true, new IRCRTCResultCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("ry", "退出房间成功" + pkUid);
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
public void run() {
|
||||
mPreView1.removeAllViews();
|
||||
mPreView1.setVisibility(View.GONE);
|
||||
inputStreamList.clear();
|
||||
inputStreamList1.clear();
|
||||
changeToBig();
|
||||
//清理PK上面对方的头像
|
||||
// TODO: 2024/4/13 退出对方主播直播间
|
||||
SWManager.get().exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()),pkUid1);
|
||||
SWManager.get().updateMyChannelView((FrameLayout) mBigContainer);
|
||||
EventBus.getDefault().post(new AnchorInfoEvent(true, "", "", ""));
|
||||
closeButtonGone();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(RTCErrorCode rtcErrorCode) {
|
||||
Log.e("ry", pkUid + "退出房间s失败" + rtcErrorCode);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
SocketSendBean seed_msg = new SocketSendBean()
|
||||
.param("_method_", Constants.SOCKET_LINK_MIC_PK)
|
||||
@ -772,7 +755,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
||||
*/
|
||||
private void initRtcEngine() {
|
||||
swManager = SWManager.get();
|
||||
swManager.setAnchorContainer((FrameLayout) mLeftContainer);
|
||||
swManager.setAnchorContainer((FrameLayout) mBigContainer);
|
||||
swManager.initRtcEngine((Activity) mContext, CommonAppConfig.getInstance().getUid());
|
||||
swManager.setOnRtcEngineListener(new SWManager.onRtcEngineListener() {
|
||||
@Override
|
||||
@ -788,14 +771,21 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
||||
L.eSw("设置对方主播的视图setAnPkRtc" + u);
|
||||
|
||||
//将自己的渲染视图设置到 leftContainer
|
||||
//swManager.updateMyVideoView((FrameLayout) mLeftContainer,SWAuManager.getChannelName(CommonAppConfig.getInstance().getUid()));
|
||||
swManager.updateMyChannelView((FrameLayout) mLeftContainer);
|
||||
|
||||
//清除 mBigContainer 中的渲染
|
||||
mBigContainer.removeAllViews();
|
||||
|
||||
//设置对方主播的渲染视图 设置到 rightContainer
|
||||
swManager.setPkContainer1(mRightContainer);
|
||||
swManager.joinExRoomEx(CommonAppConfig.getInstance().getUid(), CommonAppConfig.SWToken,u.getId(), SWAuManager.getChannelName(u.getId()));
|
||||
swManager.joinChannelEx(CommonAppConfig.getInstance().getUid(), CommonAppConfig.SWToken,u.getId(), SWAuManager.getChannelName(u.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
public void onLinkMicAnchorClose(){
|
||||
swManager.updateMyChannelView((FrameLayout) mBigContainer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeToLeft() {
|
||||
if (mPreView != null) {
|
||||
@ -868,7 +858,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
||||
public void startPush(String pushUrl) {
|
||||
//开播成功,创建频道
|
||||
if (swManager != null) {
|
||||
swManager.createRoom(CommonAppConfig.SWToken, CommonAppConfig.getChannelName());
|
||||
swManager.createChannel(CommonAppConfig.SWToken, CommonAppConfig.getChannelName());
|
||||
}
|
||||
if (rcrtcLiveInfo != null) {
|
||||
rcrtcLiveInfo.addPublishStreamUrl(pushUrl, new IRCRTCResultDataCallback<String[]>() {
|
||||
@ -1066,7 +1056,6 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
||||
.param("ct", ct);
|
||||
seed_msg.create();
|
||||
|
||||
|
||||
HttpClient.getInstance().get("Tx.sendmsgzs2", "Tx.sendmsgzs2")
|
||||
.params("GroupId", "g" + pkUid)
|
||||
.params("jsonstr", seed_msg.mResult.toString())
|
||||
|
@ -94,10 +94,7 @@
|
||||
<FrameLayout
|
||||
android:id="@+id/big_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_surface"
|
||||
@ -158,20 +155,17 @@
|
||||
android:id="@+id/pk_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="270dp"
|
||||
android:background="@color/red"
|
||||
android:layout_marginTop="130dp">
|
||||
|
||||
<com.yunbao.live.custom.MyFrameLayout4
|
||||
android:id="@+id/left_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/green"
|
||||
android:layout_marginBottom="20dp" />
|
||||
|
||||
<com.yunbao.live.custom.MyFrameLayout4
|
||||
android:id="@+id/right_container"
|
||||
android:layout_width="0dp"
|
||||
android:background="@color/gray1"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginBottom="20dp" />
|
||||
|
Loading…
Reference in New Issue
Block a user