From 3747f214b10b8b1de0aac0b88cd48c1111edd57a Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Sat, 10 Dec 2022 14:47:37 +0800 Subject: [PATCH] =?UTF-8?q?*=E6=96=B0=E5=A2=9E=E9=95=BF=E6=8C=89=E9=9A=8F?= =?UTF-8?q?=E6=9C=BAPK=E3=80=90=E5=BC=80=E5=A7=8B=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E3=80=91=E6=8C=89=E9=92=AE=E5=8F=AF=E8=BE=93=E5=85=A5=E6=8C=87?= =?UTF-8?q?=E5=AE=9AUIDPk=E7=9A=84=E6=B5=8B=E8=AF=95=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/http/live/LiveNetManager.java | 7 +------ .../com/yunbao/common/manager/RandomPkManager.java | 8 +++++++- .../yunbao/live/activity/LiveRyAnchorActivity.java | 4 ++-- .../yunbao/live/dialog/RandomPkDialogFragment.java | 12 ++++++++++++ 4 files changed, 22 insertions(+), 9 deletions(-) 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 ce73964ab..d1613154e 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 @@ -600,12 +600,7 @@ public class LiveNetManager { @Override public void accept(ResponseModel responseModel) throws Exception { if (callback != null) { - if(CommonAppConfig.getInstance().getUid().equals("98196")) { - callback.onSuccess("98274"); - }else{ - callback.onSuccess("98196"); - } - // callback.onSuccess(responseModel.getData().getInfo()); + callback.onSuccess(responseModel.getData().getInfo()); } } }, new Consumer() { diff --git a/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java b/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java index 032445ad7..2a0d75816 100644 --- a/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java +++ b/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java @@ -34,6 +34,7 @@ public class RandomPkManager { private TimerTask task; private final List randomPkTimer = new ArrayList<>();//监听器集合 private String pkUid;//对方房间ID + public static String debugUid; private RankPkInfoBean rankPkInfoBean;//排位赛信息 Handler handler = new Handler(Looper.getMainLooper()); @@ -123,6 +124,9 @@ public class RandomPkManager { @Override public void onSuccess(String data) { pkUid = data; + if (debugUid != null) { + pkUid = data = debugUid; + } for (OnRandomPkTimer pkTimer : randomPkTimer) { pkTimer.onStartPK(data); } @@ -163,7 +167,8 @@ public class RandomPkManager { timer.schedule(task, 0, 1000); return true; } - private void getRankInfo(){ + + private void getRankInfo() { LiveNetManager.get(CommonAppContext.getTopActivity()) .getRankPkInfoBean(new HttpCallback() { @Override @@ -358,6 +363,7 @@ public class RandomPkManager { /** * 匹配到对方 + * * @param pkUid 对方uid */ public void onStartPK(String pkUid) { diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index 770feab05..c7653605b 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -402,8 +402,8 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl break; case Constants.LIVE_FUNC_LINK_MIC://连麦 if (isDRPK != 1) { - //openLinkMicAnchorWindow(false); - openFreePkWindow(); + openLinkMicAnchorWindow(false); + //openFreePkWindow(); } else { ToastUtil.show("您已在PK中"); } diff --git a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java index 72ab30e93..032f61be7 100644 --- a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java @@ -117,6 +117,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On super.onActivityCreated(savedInstanceState); initView(); initData(); + RandomPkManager.debugUid = null; } private void initView() { @@ -127,6 +128,17 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On mRandomPkSwitch.setTag(true); mRandomPkSwitch.setOnClickListener(this); mPkBtn.setOnClickListener(this); + mPkBtn.setOnLongClickListener(v -> { + DialogUitl.showSimpleInputDialog(mContext, "输入指定UID", new DialogUitl.SimpleCallback() { + @Override + public void onConfirmClick(Dialog dialog, String content) { + RandomPkManager.debugUid = content; + ToastUtil.show("随机PK指定id = " + content); + dialog.dismiss(); + } + }); + return false; + }); } private void initData() {