v681内部提测版本

This commit is contained in:
2024-08-21 17:04:50 +08:00
parent 04ae7eeacc
commit 38f3b721e0
16 changed files with 355 additions and 60 deletions

View File

@@ -36,6 +36,7 @@ import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.HttpCallbackModel;
import com.yunbao.common.bean.RoomMicStatusModel;
import com.yunbao.common.bean.SudActivityGameInfoBean;
import com.yunbao.common.bean.SudGameActivityInfoRoomBean;
import com.yunbao.common.bean.SudGameChatImModel;
import com.yunbao.common.bean.SudGameInfoBean;
import com.yunbao.common.bean.SudGameScoreBean;
@@ -241,7 +242,9 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
@Override
protected void onDestroy() {
if(isActivityGame){
RandomSudGameManager.getManager().destroy();
}
LiveNetManager.get(mContext).leaveMic(mLiveUid, new HttpCallback<HttpCallbackModel>() {
@Override
public void onSuccess(HttpCallbackModel data) {
@@ -278,9 +281,6 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
//第二次进入时viewmodel数据丢失所以初始化时直接获取
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(), mContext);
if (isActivityGame) {
RandomSudGameManager.getManager().setGameViewModel(gameViewModel);
}
gameContainer = findViewById(R.id.game_container);
roomName = findViewById(R.id.room_name);
roomNumber = findViewById(R.id.room_number);
@@ -529,10 +529,7 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
sudGameDoubleDialog = new SudGameDoubleDialog(this);//双人游戏
sudGameMultipleDialog = new SudGameMultipleDialog(this);//多人游戏
sudLoadDialog = new SudLoadDialog(this);//加载弹窗
if (isActivityGame) {
sudGameDoubleDialog.setActivityGame();
sudLoadDialog.setActivityGame();
}
//游戏结算结束
gameViewModel.listMutableLiveData.observe(this, sudSettleBeans -> {
//观察结算排名数据,点击跳过和再来一局不需要显示结算界面
@@ -556,10 +553,30 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
}
});
//通知活动游戏
if (isActivityGame) {
RandomSudGameManager.getManager().onInitGame(mCreateSudRoomModel);
}
LiveNetManager.get(mContext)
.checkGameForActivity(gameViewModel.getGameRoomId(), new HttpCallback<>() {
@Override
public void onSuccess(SudGameActivityInfoRoomBean data) {
isActivityGame = data.getIsActivity() == 1;
if (isActivityGame) {
sudGameDoubleDialog.setActivityGame();
sudLoadDialog.setActivityGame();
}
if (isActivityGame) {
RandomSudGameManager.getManager().setGameViewModel(gameViewModel);
}
//通知活动游戏
if (isActivityGame) {
RandomSudGameManager.getManager().onInitGame(mCreateSudRoomModel);
}
}
@Override
public void onError(String error) {
}
});
}
@Subscribe(threadMode = ThreadMode.MAIN)
@@ -612,21 +629,51 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
LiveNetManager.get(mContext).getSudGameInfo(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<List<SudGameInfoBean>>() {
@Override
public void onSuccess(List<SudGameInfoBean> infoBean) {
if (!infoBean.isEmpty()) {
System.out.println("结算,是否为游戏活动:" + isActivityGame);
if (isActivityGame) {
loadScore(infoBean, 3);
} else {
gameViewModel.setSudGameInfoBeanList(infoBean);
gameViewModel.sudGameRank(event.getMgCommonGameSettle(null));//结算游戏
LiveNetManager.get(mContext).checkGameForActivity(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<SudGameActivityInfoRoomBean>() {
@Override
public void onSuccess(SudGameActivityInfoRoomBean data) {
isActivityGame=data.getIsActivity()==1;
if(isActivityGame) {
sudLoadDialog.setActivityGame();
sudGameDoubleDialog.setActivityGame();
}
if (!infoBean.isEmpty()) {
System.out.println("结算,是否为游戏活动:" + isActivityGame);
if (isActivityGame) {
loadScore(infoBean, 3);
} else {
gameViewModel.setSudGameInfoBeanList(infoBean);
gameViewModel.sudGameRank(event.getMgCommonGameSettle(null));//结算游戏
}
} else {
if (isActivityGame) {
showDialog();
} else {
ToastUtil.show(getString(R.string.net_error));
}
}
}
} else {
if (isActivityGame) {
showDialog();
} else {
ToastUtil.show(getString(R.string.net_error));
@Override
public void onError(String error) {
if (!infoBean.isEmpty()) {
System.out.println("结算,是否为游戏活动:" + isActivityGame);
if (isActivityGame) {
loadScore(infoBean, 3);
} else {
gameViewModel.setSudGameInfoBeanList(infoBean);
gameViewModel.sudGameRank(event.getMgCommonGameSettle(null));//结算游戏
}
} else {
if (isActivityGame) {
showDialog();
} else {
ToastUtil.show(getString(R.string.net_error));
}
}
}
}
});
}
private void showDialog() {
@@ -643,7 +690,8 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
}
private void loadScore(List<SudGameInfoBean> infoBean, int index) {
if (index == 0) {
LogUtils.e("活动判断", isActivityGame);
if (index == 0 && isActivityGame) {
showDialog();
return;
}
@@ -651,7 +699,7 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
.ballClearanceTableGetResultScore(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<>() {
@Override
public void onSuccess(List<SudActivityGameInfoBean> data) {
if (data.isEmpty()) {
if (data.isEmpty() && isActivityGame) {
new Handler(Looper.getMainLooper()).postDelayed(() -> {
loadScore(infoBean, index - 1);
}, 500);

View File

@@ -1373,7 +1373,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
if (createSudRoomModel != null) {
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(createSudRoomModel));
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(createSudRoomModel).setActivityGame(createSudRoomModel.isActivity()));
createSudRoomModel = null;
}
// String jsonCreateSudRoom = IMLoginManager.get(mContext).getSudGame();