优化为只有从主播PK中跳转直播间失败(被踢过)才不再随机匹配直播间了

This commit is contained in:
老皮 2024-09-20 13:22:46 +08:00
parent 58ba80929b
commit 0646c2c6a7
2 changed files with 6 additions and 3 deletions

View File

@ -43,8 +43,9 @@ public class LiveRoomCheckLivePresenter {
* @param context 上下文 * @param context 上下文
* @param liveUid 直播间ID * @param liveUid 直播间ID
* @param stream * @param stream
* @param isPk 是否是pk时点击头像打开弹窗后跳转来的
*/ */
public LiveRoomCheckLivePresenter(Context context, String liveUid, String stream, NewActionListener actionListener) { public LiveRoomCheckLivePresenter(Context context, String liveUid, String stream, NewActionListener actionListener,boolean... isPk) {
mContext = context; mContext = context;
LiveNetManager.get(context) LiveNetManager.get(context)
.checkLive(liveUid, stream, new CheckLiveCallBack() { .checkLive(liveUid, stream, new CheckLiveCallBack() {
@ -108,8 +109,10 @@ public class LiveRoomCheckLivePresenter {
@Override @Override
public void onError(String error,int code) { public void onError(String error,int code) {
Log.e("直播间异常", "onError: " + error + " code = " + code); Log.e("直播间异常", "onError: " + error + " code = " + code);
if (code != 1004) { if (code == 1004 && isPk != null && isPk.length > 0 && isPk[0]) {
// 1004 为用户被踢过不能进入直播间但是不能随机再进入别的直播间 // 1004 为用户被踢过不能进入直播间但是不能随机再进入别的直播间
Log.e("直播间异常", "onError: " + error + " code = " + code);
}else {
Bus.get().post(new LiveErrorEvent()); Bus.get().post(new LiveErrorEvent());
} }
ToastUtil.show(error); ToastUtil.show(error);

View File

@ -681,7 +681,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
public void onCheckError(String contextError) { public void onCheckError(String contextError) {
} }
}); },true);
} }
} }
}); });