1.处理游戏中退出游戏和最小化房间的情况 2.处理房主踢游戏中用户的情况
This commit is contained in:
@@ -313,11 +313,7 @@ public class ButtonItemFactory {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick() {
|
public void onClick() {
|
||||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.data_card_kickout_room_click, "资料卡片-踢出房间");
|
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.data_card_kickout_room_click, "资料卡片-踢出房间");
|
||||||
if (AvRoomDataManager.get().isGamePlaying(AvRoomDataManager.get().getMicPosition(account))) {
|
new DialogManager(context).showOkCancelDialog((AvRoomDataManager.get().isGamePlaying(Long.parseLong(account)) ? "游戏模式下默认该玩家退出游戏" : "") + "是否要将此用户踢出房间?",
|
||||||
SingleToastUtil.showToast("不可以踢出在游戏中的用户!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
new DialogManager(context).showOkCancelDialog((AvRoomDataManager.get().isOpenKTV() ? "KTV模式下将自动删除ta的歌曲," : "") + "是否要将此用户踢出房间?",
|
|
||||||
true, new DialogManager.AbsOkDialogListener() {
|
true, new DialogManager.AbsOkDialogListener() {
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
@Override
|
@Override
|
||||||
@@ -424,13 +420,9 @@ public class ButtonItemFactory {
|
|||||||
String nick) {
|
String nick) {
|
||||||
return new ViewItem("拉入黑名单", R.drawable.icon_dialog_mark_black_list, () -> {
|
return new ViewItem("拉入黑名单", R.drawable.icon_dialog_mark_black_list, () -> {
|
||||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.data_dard_join_blacklist_click, "资料卡片-加入黑名单");
|
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.data_dard_join_blacklist_click, "资料卡片-加入黑名单");
|
||||||
if (AvRoomDataManager.get().isGamePlaying(AvRoomDataManager.get().getMicPosition(account))) {
|
|
||||||
SingleToastUtil.showToast("不可以拉黑在游戏中的用户!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
new DialogManager(context).showOkCancelDialog(
|
new DialogManager(context).showOkCancelDialog(
|
||||||
"是否将" + nick + "加入黑名单?加入后他将无法进入此房间" +
|
"是否将" + nick + "加入黑名单?加入后他将无法进入此房间" +
|
||||||
(AvRoomDataManager.get().mCurrentRoomInfo != null && AvRoomDataManager.get().isOpenKTV() ? "KTV模式下将自动删除ta的歌曲" : ""), true,
|
(AvRoomDataManager.get().mCurrentRoomInfo != null && AvRoomDataManager.get().isGamePlaying(Long.parseLong(account)) ? "游戏模式下默认该玩家退出游戏" : ""), true,
|
||||||
() -> {
|
() -> {
|
||||||
|
|
||||||
Single<String> single;
|
Single<String> single;
|
||||||
|
@@ -102,6 +102,7 @@ import com.yizhuan.xchat_android_core.redpackage.RedPackageNotifyInfo;
|
|||||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||||
import com.yizhuan.xchat_android_core.room.bean.SimplePartyRoomInfo;
|
import com.yizhuan.xchat_android_core.room.bean.SimplePartyRoomInfo;
|
||||||
import com.yizhuan.xchat_android_core.room.dragonball.DragonBallModel;
|
import com.yizhuan.xchat_android_core.room.dragonball.DragonBallModel;
|
||||||
|
import com.yizhuan.xchat_android_core.room.event.FinishAvRoomEvent;
|
||||||
import com.yizhuan.xchat_android_core.room.event.RoomClearScreenEvent;
|
import com.yizhuan.xchat_android_core.room.event.RoomClearScreenEvent;
|
||||||
import com.yizhuan.xchat_android_core.room.pk.event.PKStateEvent;
|
import com.yizhuan.xchat_android_core.room.pk.event.PKStateEvent;
|
||||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||||
@@ -851,6 +852,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
|||||||
* 把退出聊天室交给Main执行
|
* 把退出聊天室交给Main执行
|
||||||
*/
|
*/
|
||||||
public void toBack(boolean justClosePage) {
|
public void toBack(boolean justClosePage) {
|
||||||
|
EventBus.getDefault().post(new FinishAvRoomEvent());
|
||||||
//陪伴房的弹框提示去掉,直接关闭即可
|
//陪伴房的弹框提示去掉,直接关闭即可
|
||||||
if (!justClosePage) {
|
if (!justClosePage) {
|
||||||
getMvpPresenter().exitRoom();
|
getMvpPresenter().exitRoom();
|
||||||
@@ -965,6 +967,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
|||||||
* 最小化房间的代码,放在一处
|
* 最小化房间的代码,放在一处
|
||||||
*/
|
*/
|
||||||
private void minRoomCode() {
|
private void minRoomCode() {
|
||||||
|
EventBus.getDefault().post(new FinishAvRoomEvent());
|
||||||
AvRoomDataManager.get().roomNoDestory = false;
|
AvRoomDataManager.get().roomNoDestory = false;
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
}
|
}
|
||||||
|
@@ -94,8 +94,10 @@ import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent
|
|||||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowGiftDialogEvent
|
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowGiftDialogEvent
|
||||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowUserInfoDialogEvent
|
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowUserInfoDialogEvent
|
||||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||||
|
import com.yizhuan.xchat_android_core.room.event.FinishAvRoomEvent
|
||||||
import com.yizhuan.xchat_android_core.room.event.RoomClearScreenEvent
|
import com.yizhuan.xchat_android_core.room.event.RoomClearScreenEvent
|
||||||
import com.yizhuan.xchat_android_core.room.face.FaceInfo
|
import com.yizhuan.xchat_android_core.room.face.FaceInfo
|
||||||
|
import com.yizhuan.xchat_android_core.room.game.GameStatus
|
||||||
import com.yizhuan.xchat_android_core.room.giftvalue.helper.GiftValueMrg
|
import com.yizhuan.xchat_android_core.room.giftvalue.helper.GiftValueMrg
|
||||||
import com.yizhuan.xchat_android_core.room.model.MicQueueModel
|
import com.yizhuan.xchat_android_core.room.model.MicQueueModel
|
||||||
import com.yizhuan.xchat_android_core.room.queue.bean.MicMemberInfo
|
import com.yizhuan.xchat_android_core.room.queue.bean.MicMemberInfo
|
||||||
@@ -129,7 +131,7 @@ import kotlin.collections.ArrayList
|
|||||||
* @date 2017/7/26
|
* @date 2017/7/26
|
||||||
*/
|
*/
|
||||||
@CreatePresenter(GameRoomPresenter::class)
|
@CreatePresenter(GameRoomPresenter::class)
|
||||||
class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>(),
|
class GameRoomFragment : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||||
View.OnClickListener, OnGiftDialogBtnClickListener, IGameRoomView, OnMicroItemClickListener,
|
View.OnClickListener, OnGiftDialogBtnClickListener, IGameRoomView, OnMicroItemClickListener,
|
||||||
OnGameStatusChangeListener {
|
OnGameStatusChangeListener {
|
||||||
private var myUid: Long = 0
|
private var myUid: Long = 0
|
||||||
@@ -210,8 +212,8 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
|||||||
|
|
||||||
inputLayout.setOnTouchListener { _: View?, _: MotionEvent? ->
|
inputLayout.setOnTouchListener { _: View?, _: MotionEvent? ->
|
||||||
inputEdit.clearFocus()
|
inputEdit.clearFocus()
|
||||||
inputLayout.setVisibility(View.GONE)
|
inputLayout.visibility = View.GONE
|
||||||
KeyBoardUtils.hideKeyBoard(getActivity(), inputEdit)
|
KeyBoardUtils.hideKeyBoard(activity, inputEdit)
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
softKeyboardListener()
|
softKeyboardListener()
|
||||||
@@ -268,7 +270,7 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
|||||||
RxBus.get().toFlowable(ShowUserInfoDialogEvent::class.java)
|
RxBus.get().toFlowable(ShowUserInfoDialogEvent::class.java)
|
||||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe { showUserCardDialog(it.getUid()) }
|
.subscribe { showUserCardDialog(it.uid) }
|
||||||
|
|
||||||
// 刷新礼物列表,获取房间专属礼物列表
|
// 刷新礼物列表,获取房间专属礼物列表
|
||||||
GiftModel.get().refreshGiftList(AvRoomDataManager.get().roomUid.toString()).subscribe()
|
GiftModel.get().refreshGiftList(AvRoomDataManager.get().roomUid.toString()).subscribe()
|
||||||
@@ -377,7 +379,7 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
|||||||
RoomEvent.DOWN_MIC -> {
|
RoomEvent.DOWN_MIC -> {
|
||||||
if (AvRoomDataManager.get().isOwner(roomEvent.account)) {
|
if (AvRoomDataManager.get().isOwner(roomEvent.account)) {
|
||||||
//自己的消息
|
//自己的消息
|
||||||
gameDelegate.exitGame()
|
gameDelegate.exitGame()
|
||||||
}
|
}
|
||||||
onDownMicro(roomEvent.micPosition)
|
onDownMicro(roomEvent.micPosition)
|
||||||
}
|
}
|
||||||
@@ -527,7 +529,7 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
val bannerAdapter = RoomActAdapter(mContext, dialogInfo)
|
val bannerAdapter = RoomActAdapter(mContext, dialogInfo)
|
||||||
rollPagerView.setAdapter(bannerAdapter)
|
rollPagerView.adapter = bannerAdapter
|
||||||
rollPagerView.setPlayDelay(3000)
|
rollPagerView.setPlayDelay(3000)
|
||||||
//设置透明度
|
//设置透明度
|
||||||
rollPagerView.setAnimationDurtion(500)
|
rollPagerView.setAnimationDurtion(500)
|
||||||
@@ -665,11 +667,10 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
|||||||
|
|
||||||
override fun onStop() {
|
override fun onStop() {
|
||||||
super.onStop()
|
super.onStop()
|
||||||
gameDelegate.onPause()
|
gameDelegate.onStop()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
gameDelegate.onDestroy()
|
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
releaseView()
|
releaseView()
|
||||||
}
|
}
|
||||||
@@ -678,6 +679,7 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
|||||||
mDisposable?.dispose()
|
mDisposable?.dispose()
|
||||||
mDisposable = null
|
mDisposable = null
|
||||||
EventBus.getDefault().unregister(this)
|
EventBus.getDefault().unregister(this)
|
||||||
|
gameDelegate.onDestroy()
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -866,7 +868,7 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
|||||||
val buttonItem3 = ButtonItem(
|
val buttonItem3 = ButtonItem(
|
||||||
if (roomMicInfo.isMicLock) unlockStr else lockStr,
|
if (roomMicInfo.isMicLock) unlockStr else lockStr,
|
||||||
ButtonItem.OnClickListener {
|
ButtonItem.OnClickListener {
|
||||||
if (roomMicInfo.isMicLock()) {
|
if (roomMicInfo.isMicLock) {
|
||||||
if (SuperAdminUtil.isSuperAdmin()) {
|
if (SuperAdminUtil.isSuperAdmin()) {
|
||||||
SingleToastUtil.showToast(SaConstant.TOAST_ERROR_TIPS)
|
SingleToastUtil.showToast(SaConstant.TOAST_ERROR_TIPS)
|
||||||
return@OnClickListener
|
return@OnClickListener
|
||||||
@@ -878,7 +880,7 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
val buttonItem4 =
|
val buttonItem4 =
|
||||||
ButtonItem("上麦", { toUpMicroPhone(micPosition, currentUid.toString() + "", false) })
|
ButtonItem("上麦") { toUpMicroPhone(micPosition, currentUid.toString() + "", false) }
|
||||||
//别问为什么,ui调整了顺序
|
//别问为什么,ui调整了顺序
|
||||||
//禁用超管的上麦和抱TA上麦
|
//禁用超管的上麦和抱TA上麦
|
||||||
if (!SuperAdminUtil.isSuperAdmin()) {
|
if (!SuperAdminUtil.isSuperAdmin()) {
|
||||||
@@ -1064,6 +1066,11 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
|||||||
|
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
override fun toUpMicroPhone(micPosition: Int, currentUid: String, b: Boolean) {
|
override fun toUpMicroPhone(micPosition: Int, currentUid: String, b: Boolean) {
|
||||||
|
if (AvRoomDataManager.get().isSelfGamePlaying) {
|
||||||
|
SingleToastUtil.showToast("游戏中不可以换麦!")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
UserModel.get().cacheLoginUserInfo?.gameStatus = GameStatus.STATUS_NOT_JOIN
|
||||||
checkPermission(Manifest.permission.RECORD_AUDIO)
|
checkPermission(Manifest.permission.RECORD_AUDIO)
|
||||||
.subscribe({ result: Boolean ->
|
.subscribe({ result: Boolean ->
|
||||||
if (result) {
|
if (result) {
|
||||||
@@ -1169,6 +1176,11 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
|||||||
).openDialog()
|
).openDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
fun onFinishAvRoomEvent(event: FinishAvRoomEvent) {
|
||||||
|
gameDelegate.exitGame()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 底部按钮点击处理
|
* 底部按钮点击处理
|
||||||
*/
|
*/
|
||||||
@@ -1331,4 +1343,5 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
|||||||
override fun onGameEnd() {
|
override fun onGameEnd() {
|
||||||
gameBinding.ivShowMic.callOnClick()
|
gameBinding.ivShowMic.callOnClick()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -30,19 +30,10 @@ import java.util.*
|
|||||||
|
|
||||||
class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId: Long?) {
|
class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId: Long?) {
|
||||||
|
|
||||||
companion object {
|
|
||||||
const val STATUS_NOT_JOIN = 0
|
|
||||||
const val STATUS_NOT_READY = 1
|
|
||||||
const val STATUS_READY = 2
|
|
||||||
const val STATUS_PLAYING = 3
|
|
||||||
}
|
|
||||||
|
|
||||||
private val TAG = "GameDelegate"
|
private val TAG = "GameDelegate"
|
||||||
private var APP_CODE = ""
|
private var APP_CODE = ""
|
||||||
|
|
||||||
|
|
||||||
private val mRoomID = AvRoomDataManager.get().roomUid.toString()
|
private val mRoomID = AvRoomDataManager.get().roomUid.toString()
|
||||||
|
|
||||||
private val mLanguage = "zh-CN" //语言
|
private val mLanguage = "zh-CN" //语言
|
||||||
|
|
||||||
//调用游戏SDK的接口,成功加载游戏后可用:
|
//调用游戏SDK的接口,成功加载游戏后可用:
|
||||||
@@ -91,7 +82,6 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
|||||||
login(loginCallback)
|
login(loginCallback)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun updateGame(mgId: Long?) {
|
fun updateGame(mgId: Long?) {
|
||||||
if (mgId == null || mgId == 0L || mgId == mMGID || iSudFSTAPP == null) return
|
if (mgId == null || mgId == 0L || mgId == mMGID || iSudFSTAPP == null) return
|
||||||
mMGID = mgId
|
mMGID = mgId
|
||||||
@@ -100,6 +90,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun exitGame() {
|
fun exitGame() {
|
||||||
|
UserModel.get().cacheLoginUserInfo?.gameStatus = GameStatus.STATUS_NOT_JOIN
|
||||||
notifySelfPlayingState(false)
|
notifySelfPlayingState(false)
|
||||||
notifySelfInState(false)
|
notifySelfInState(false)
|
||||||
}
|
}
|
||||||
@@ -371,7 +362,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
|||||||
try {
|
try {
|
||||||
val jsonObject = JSONObject(dataJson)
|
val jsonObject = JSONObject(dataJson)
|
||||||
val seatIndex = jsonObject.optInt("seatIndex", -1)
|
val seatIndex = jsonObject.optInt("seatIndex", -1)
|
||||||
updateMyMicQueue(STATUS_NOT_READY, true, seatIndex)
|
updateMyMicQueue(GameStatus.STATUS_NOT_READY, true, seatIndex)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
@@ -429,9 +420,9 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
|||||||
reason = jsonObject.getInt("reason")
|
reason = jsonObject.getInt("reason")
|
||||||
}
|
}
|
||||||
if (reason == 0) {
|
if (reason == 0) {
|
||||||
updateMyMicQueue(STATUS_NOT_JOIN)
|
updateMyMicQueue(GameStatus.STATUS_NOT_JOIN)
|
||||||
} else if (reason == 1) {
|
} else if (reason == 1) {
|
||||||
updateMyMicQueue(STATUS_NOT_JOIN)
|
updateMyMicQueue(GameStatus.STATUS_NOT_JOIN)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
@@ -481,7 +472,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
|||||||
if (retCode != 0) {
|
if (retCode != 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
updateMyMicQueue(if (isReady) STATUS_READY else STATUS_NOT_READY)
|
updateMyMicQueue(if (isReady) GameStatus.STATUS_READY else GameStatus.STATUS_NOT_READY)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
@@ -512,10 +503,10 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
|||||||
val isPlaying = jsonObject.getBoolean("isPlaying")
|
val isPlaying = jsonObject.getBoolean("isPlaying")
|
||||||
if (isPlaying) {
|
if (isPlaying) {
|
||||||
onGameStatusChangeListener?.onGameStart()
|
onGameStatusChangeListener?.onGameStart()
|
||||||
updateMyMicQueue(STATUS_PLAYING)
|
updateMyMicQueue(GameStatus.STATUS_PLAYING)
|
||||||
} else {
|
} else {
|
||||||
onGameStatusChangeListener?.onGameEnd()
|
onGameStatusChangeListener?.onGameEnd()
|
||||||
updateMyMicQueue(STATUS_NOT_READY)
|
updateMyMicQueue(GameStatus.STATUS_NOT_READY)
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
|
@@ -531,21 +531,6 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void upAiMicroPhone(int micPosition, String uId) {
|
|
||||||
if (AvRoomDataManager.get().mCurrentRoomInfo == null) return;
|
|
||||||
mAvRoomModel.upAiMicroPhone(micPosition, uId, String.valueOf(AvRoomDataManager.get().mCurrentRoomInfo.getRoomId()),
|
|
||||||
new CallBack<String>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(String data) {
|
|
||||||
Logger.i("用户%1$s上麦成功:%2$s", uId, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFail(int code, String error) {
|
|
||||||
Logger.i("用户%1$s上麦失败:%2$s----", uId, error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyPresenter() {
|
public void onDestroyPresenter() {
|
||||||
|
@@ -39,6 +39,7 @@ import com.yizhuan.xchat_android_core.praise.PraiseModel;
|
|||||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||||
import com.yizhuan.xchat_android_core.room.exception.AntiSpamHitException;
|
import com.yizhuan.xchat_android_core.room.exception.AntiSpamHitException;
|
||||||
import com.yizhuan.xchat_android_core.room.face.FaceReceiveInfo;
|
import com.yizhuan.xchat_android_core.room.face.FaceReceiveInfo;
|
||||||
|
import com.yizhuan.xchat_android_core.room.game.GameStatus;
|
||||||
import com.yizhuan.xchat_android_core.room.giftvalue.helper.GiftValueMrg;
|
import com.yizhuan.xchat_android_core.room.giftvalue.helper.GiftValueMrg;
|
||||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
||||||
import com.yizhuan.xchat_android_core.room.model.HomePartyModel;
|
import com.yizhuan.xchat_android_core.room.model.HomePartyModel;
|
||||||
@@ -113,6 +114,13 @@ public class GameRoomPresenter extends BaseMvpPresenter<IGameRoomView> {
|
|||||||
if (currentRoom == null) {
|
if (currentRoom == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (AvRoomDataManager.get().isSelfGamePlaying()){
|
||||||
|
SingleToastUtil.showToast("游戏中不可以换麦!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (UserModel.get().getCacheLoginUserInfo() != null) {
|
||||||
|
UserModel.get().getCacheLoginUserInfo().setGameStatus(GameStatus.STATUS_NOT_JOIN);
|
||||||
|
}
|
||||||
final String currentUid = String.valueOf(AuthModel.get().getCurrentUid());
|
final String currentUid = String.valueOf(AuthModel.get().getCurrentUid());
|
||||||
if (AvRoomDataManager.get().isRoomOwner(currentUid) || AvRoomDataManager.get().isRoomAdmin(currentUid)
|
if (AvRoomDataManager.get().isRoomOwner(currentUid) || AvRoomDataManager.get().isRoomAdmin(currentUid)
|
||||||
|| SuperAdminUtil.isSuperAdmin()) {
|
|| SuperAdminUtil.isSuperAdmin()) {
|
||||||
|
@@ -1043,6 +1043,11 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (AvRoomDataManager.get().isSelfGamePlaying()){
|
||||||
|
SingleToastUtil.showToast("游戏中不可以主动下麦!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (AvRoomDataManager.get().mCurrentRoomInfo.isOpenKTV()) {
|
if (AvRoomDataManager.get().mCurrentRoomInfo.isOpenKTV()) {
|
||||||
new DialogManager(context).showOkCancelDialog("KTV模式下下麦会移除您已点的所有歌曲,确定进行此操作?", false,
|
new DialogManager(context).showOkCancelDialog("KTV模式下下麦会移除您已点的所有歌曲,确定进行此操作?", false,
|
||||||
() -> {
|
() -> {
|
||||||
@@ -1307,8 +1312,12 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (AvRoomDataManager.get().isGamePlaying(AvRoomDataManager.get().getMicPosition(uid))){
|
if (AvRoomDataManager.get().isGamePlaying(uid)){
|
||||||
SingleToastUtil.showToast("不可以抱正在游戏中的用户下麦!");
|
new DialogManager(context).showOkCancelWithTitleDialog("抱Ta下麦后默认该玩家退出游戏,是否继续?",
|
||||||
|
(DialogManager.LambdaOkDialogListener) () -> {
|
||||||
|
kickDownMicCode();
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//ktv模式下麦
|
//ktv模式下麦
|
||||||
|
@@ -34,6 +34,7 @@ import com.yizhuan.xchat_android_core.room.ktv.event.KtvEvent;
|
|||||||
import com.yizhuan.xchat_android_core.room.bean.RoomModeType;
|
import com.yizhuan.xchat_android_core.room.bean.RoomModeType;
|
||||||
import com.yizhuan.xchat_android_core.super_admin.SuperAdminDataMrg;
|
import com.yizhuan.xchat_android_core.super_admin.SuperAdminDataMrg;
|
||||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
||||||
|
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||||
import com.yizhuan.xchat_android_core.utils.LogUtils;
|
import com.yizhuan.xchat_android_core.utils.LogUtils;
|
||||||
import com.yizhuan.xchat_android_core.utils.StringUtils;
|
import com.yizhuan.xchat_android_core.utils.StringUtils;
|
||||||
import com.yizhuan.xchat_android_library.rxbus.RxBus;
|
import com.yizhuan.xchat_android_library.rxbus.RxBus;
|
||||||
@@ -165,6 +166,8 @@ public final class AvRoomDataManager {
|
|||||||
* 表示自己是否在队列中
|
* 表示自己是否在队列中
|
||||||
*/
|
*/
|
||||||
public boolean myIsInQueue = false;
|
public boolean myIsInQueue = false;
|
||||||
|
//TRTC SIG
|
||||||
|
public String trtcSig;
|
||||||
private Disposable subscribe;
|
private Disposable subscribe;
|
||||||
/**
|
/**
|
||||||
* 一起玩 按钮开关
|
* 一起玩 按钮开关
|
||||||
@@ -183,10 +186,6 @@ public final class AvRoomDataManager {
|
|||||||
*/
|
*/
|
||||||
private boolean isParty;
|
private boolean isParty;
|
||||||
private boolean redEnvelopeOpen;
|
private boolean redEnvelopeOpen;
|
||||||
|
|
||||||
//TRTC SIG
|
|
||||||
public String trtcSig;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 缓存师父的 UID
|
* 缓存师父的 UID
|
||||||
*/
|
*/
|
||||||
@@ -221,6 +220,9 @@ public final class AvRoomDataManager {
|
|||||||
chatRoomDataRelease();
|
chatRoomDataRelease();
|
||||||
//清空缓存
|
//清空缓存
|
||||||
IMNetEaseManager.get().mCacheRoomQueueInfo = null;
|
IMNetEaseManager.get().mCacheRoomQueueInfo = null;
|
||||||
|
if (UserModel.get().getCacheLoginUserInfo() != null) {
|
||||||
|
UserModel.get().getCacheLoginUserInfo().setGameStatus(GameStatus.STATUS_NOT_JOIN);
|
||||||
|
}
|
||||||
LogUtils.d("---------清除AvRoomDataManager数据完成---------");
|
LogUtils.d("---------清除AvRoomDataManager数据完成---------");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -0,0 +1,4 @@
|
|||||||
|
package com.yizhuan.xchat_android_core.room.event;
|
||||||
|
|
||||||
|
public class FinishAvRoomEvent {
|
||||||
|
}
|
Reference in New Issue
Block a user