修复多人连麦问题

This commit is contained in:
18142669586 2022-12-02 17:09:20 +08:00
parent 857206e3da
commit 5f487f74bd

View File

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