From 58ba80929be62e1c2b9ae17d027fea745caf5f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E7=9A=AE?= <14840170+lao-pi123@user.noreply.gitee.com> Date: Fri, 20 Sep 2024 10:52:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E4=B8=BB=E6=92=ADPK?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E7=94=A8=E6=88=B7=E7=82=B9=E5=87=BBPK?= =?UTF-8?q?=E5=AF=B9=E6=89=8B=E5=A4=B4=E5=83=8F=E7=9A=84=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E7=9B=B4=E6=92=AD=E9=97=B4=EF=BC=88=E8=A2=AB?= =?UTF-8?q?=E8=B8=A2=E5=87=BA=E8=BF=87=E7=9A=84=EF=BC=89=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E2=80=9C=E5=B7=B2=E8=A2=AB=E8=B8=A2=E5=87=BA=E7=9B=B4?= =?UTF-8?q?=E6=92=AD=E9=97=B4=E2=80=9D=EF=BC=8C=E4=B9=8B=E5=90=8E=E4=BC=9A?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=BF=9B=E5=85=A5=E5=88=B0=E5=88=AB=E7=9A=84?= =?UTF-8?q?=E4=B8=BB=E6=92=AD=E7=9B=B4=E6=92=AD=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/http/base/CheckLiveCallBack.java | 2 +- .../java/com/yunbao/common/http/live/LiveNetManager.java | 6 +++--- .../yunbao/common/utils/LiveRoomCheckLivePresenter.java | 9 ++++++--- .../main/java/com/yunbao/live/socket/SocketSwClient.java | 2 ++ 4 files changed, 12 insertions(+), 7 deletions(-) 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_")) { //用户连麦