修复:主播PK中,用户点击PK对手头像的方式进入直播间(被踢出过的),提示“已被踢出直播间”,之后会自动进入到别的主播直播间

This commit is contained in:
老皮 2024-09-20 10:52:34 +08:00
parent d63cba7db1
commit 58ba80929b
4 changed files with 12 additions and 7 deletions

View File

@ -26,5 +26,5 @@ public interface CheckLiveCallBack {
*
* @param error
*/
void onError(String error);
void onError(String error,int code);
}

View File

@ -426,12 +426,12 @@ public class LiveNetManager {
}
} else {
if (callBack != null) {
callBack.onError(listResponseModel.getData().getMsg());
callBack.onError(listResponseModel.getData().getMsg(), listResponseModel.getData().getCode());
}
}
} else {
if (callBack != null) {
callBack.onError(listResponseModel.getData().getMsg());
callBack.onError(listResponseModel.getData().getMsg(), listResponseModel.getData().getCode());
}
}
}
@ -440,7 +440,7 @@ public class LiveNetManager {
public void accept(Throwable throwable) throws Exception {
Log.e("异常", "checkLive: ", throwable);
if (callBack != null) {
callBack.onError(throwable.getMessage());
callBack.onError(throwable.getMessage(), -1008611);
}
}
}).isDisposed();

View File

@ -106,9 +106,12 @@ public class LiveRoomCheckLivePresenter {
}
@Override
public void onError(String error) {
Log.e("直播间异常", "onError: " + error);
Bus.get().post(new LiveErrorEvent());
public void onError(String error,int code) {
Log.e("直播间异常", "onError: " + error + " code = " + code);
if (code != 1004) {
// 1004 为用户被踢过不能进入直播间但是不能随机再进入别的直播间
Bus.get().post(new LiveErrorEvent());
}
ToastUtil.show(error);
}
});

View File

@ -201,6 +201,8 @@ public class SocketSwClient {
SocketReceiveBean received = JSON.parseObject(socketMsg, SocketReceiveBean.class);
JSONObject map = received.getMsg().getJSONObject(0);
L.e("收到IM数据--->" + map.toString());
String ct="";
switch (map.getString("_method_")) {
//用户连麦