diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java index 5bef0d5ee..4756f499f 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java @@ -1197,14 +1197,17 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { @Override public void onSuccess(int code, String msg, String[] info) { Log.i(TAG, "code = " + code + ", msg = " + msg + ", info = " + Arrays.deepToString(info)); + JSONObject datas = JSONObject.parseObject(info[0]); boolean agree=true; - if (code != 0) { + if (datas.getIntValue("pk_num_day") <= 0) { ToastUtil.show("多人PK次数已用完"); agree=false; } + boolean finalAgree = agree; rtcRoom.getLocalUser().responseJoinOtherRoom(mApplyUid, mApplyUid, agree, true, SOCKET_LIVE_DRPK, new IRCRTCResultCallback() { @Override public void onSuccess() { + if(finalAgree == true){ HttpClient.getInstance().get("live.joinDRPKroom", "live.joinDRPKroom") .params("uid", CommonAppConfig.getInstance().getUid()) .params("roomid", u.getId()) @@ -1286,7 +1289,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { } } }); - + } } @Override