diff --git a/common/src/main/java/com/yunbao/common/http/base/CheckLiveCallBack.java b/common/src/main/java/com/yunbao/common/http/base/CheckLiveCallBack.java index 56e1d2067..ee90bcb57 100644 --- a/common/src/main/java/com/yunbao/common/http/base/CheckLiveCallBack.java +++ b/common/src/main/java/com/yunbao/common/http/base/CheckLiveCallBack.java @@ -26,5 +26,5 @@ public interface CheckLiveCallBack { * * @param error */ - void onError(String error); + void onError(String error,int code); } diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 7631dc829..a42aa216a 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -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(); diff --git a/common/src/main/java/com/yunbao/common/utils/LiveRoomCheckLivePresenter.java b/common/src/main/java/com/yunbao/common/utils/LiveRoomCheckLivePresenter.java index 6c7d2d6f3..c1c2435e8 100644 --- a/common/src/main/java/com/yunbao/common/utils/LiveRoomCheckLivePresenter.java +++ b/common/src/main/java/com/yunbao/common/utils/LiveRoomCheckLivePresenter.java @@ -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); } }); diff --git a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java index d7917ade1..4bcc60620 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java @@ -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_")) { //用户连麦