|
|
@@ -1,12 +1,14 @@
|
|
|
package com.adealink.weparty.room.playcenter.manager
|
|
|
|
|
|
import com.adealink.frame.aab.util.getCompatString
|
|
|
+import com.adealink.frame.base.Rlt
|
|
|
import com.adealink.frame.frame.BaseFrame
|
|
|
import com.adealink.weparty.cocosgame.data.Game
|
|
|
import com.adealink.weparty.module.game.GameModule
|
|
|
import com.adealink.weparty.module.game.data.ActivityType
|
|
|
import com.adealink.weparty.module.game.data.CommonActivityRewardInfoReq
|
|
|
import com.adealink.weparty.module.game.data.GameShowConfig
|
|
|
+import com.adealink.weparty.module.game.data.MiniSlotNeedData
|
|
|
import com.adealink.weparty.module.level.data.LuckyGameLevel
|
|
|
import com.adealink.weparty.module.music.MusicModule
|
|
|
import com.adealink.weparty.module.music.data.MusicEntrance
|
|
|
@@ -21,6 +23,7 @@ import com.adealink.weparty.room.datasource.local.RoomAdminPermissionSetting
|
|
|
import com.adealink.weparty.room.micseat.globalbroadcast.manager.roomGlobalBroadcastManager
|
|
|
import com.adealink.weparty.room.playcenter.data.RoomGameCenterEntrance
|
|
|
import com.adealink.weparty.room.playcenter.data.RoomPlayCenterEntrance
|
|
|
+import com.adealink.weparty.room.playcenter.data.RoomPlayCenterMiniSlotData
|
|
|
import com.adealink.weparty.room.playcenter.data.RoomPlayCenterTitle
|
|
|
import com.adealink.weparty.room.playcenter.data.RoomPlayCenterTitleOperator
|
|
|
import com.adealink.weparty.room.playcenter.data.RoomPlayCenterType
|
|
|
@@ -76,6 +79,7 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
|
|
|
DecorType.LUCKY_PRO_GAME,
|
|
|
DecorType.GREEDY_PRO_GAME,
|
|
|
DecorType.GREEDY_PERSONAL_GAME,
|
|
|
+ DecorType.SHOW_MINI_SLOT
|
|
|
)
|
|
|
GameModule.isGameShow(reqList)
|
|
|
}
|
|
|
@@ -100,7 +104,11 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
|
|
|
lastPullTime = 0L
|
|
|
}
|
|
|
|
|
|
- override fun updateAdminPlayCenterList(roomData: RoomPlayerCenterData, isAdd: Boolean, addRoomDataBefore: RoomPlayerCenterData?) {
|
|
|
+ override fun updateAdminPlayCenterList(
|
|
|
+ roomData: RoomPlayerCenterData,
|
|
|
+ isAdd: Boolean,
|
|
|
+ addRoomDataBefore: RoomPlayerCenterData?
|
|
|
+ ) {
|
|
|
launch {
|
|
|
notifyPlayCenterDataList(copyDataList())
|
|
|
}
|
|
|
@@ -147,13 +155,29 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
|
|
|
}
|
|
|
addGameList(luckyGameList)
|
|
|
if (luckyGameList.isNotEmpty()) {
|
|
|
- luckyGameList.add(
|
|
|
- 0,
|
|
|
- RoomPlayCenterTitle(
|
|
|
- getCompatString(R.string.room_play_lucky_game),
|
|
|
- operatorList
|
|
|
+ // 老虎机游戏入口(和Title合并)
|
|
|
+ if (gameConfigMap[DecorType.SHOW_MINI_SLOT]?.show == true) {
|
|
|
+ // 获取游戏数据(1->全部数据)
|
|
|
+ val miniSlotConfigInfoDef = async { GameModule.getMiniSlotConfigInfo(MiniSlotNeedData.MIN_DATA) }
|
|
|
+ val miniSlotConfigInfoRlt = miniSlotConfigInfoDef.await()
|
|
|
+ val miniSlotConfigInfo = if (miniSlotConfigInfoRlt is Rlt.Success) miniSlotConfigInfoRlt.data.data else null
|
|
|
+ luckyGameList.add(
|
|
|
+ 0,
|
|
|
+ RoomPlayCenterMiniSlotData(
|
|
|
+ title = getCompatString(R.string.room_play_lucky_game),
|
|
|
+ showMiniSlot = true,
|
|
|
+ miniSlotConfigInfoRsp = miniSlotConfigInfo
|
|
|
+ )
|
|
|
)
|
|
|
- )
|
|
|
+ } else {
|
|
|
+ luckyGameList.add(
|
|
|
+ 0,
|
|
|
+ RoomPlayCenterMiniSlotData(
|
|
|
+ title = getCompatString(R.string.room_play_lucky_game),
|
|
|
+ showMiniSlot = false
|
|
|
+ )
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|
|
|
if (luckyGameList.isNotEmpty()) {
|
|
|
playCenterDataList.addAll(luckyGameList)
|
|
|
@@ -178,7 +202,8 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
|
|
|
gameCenterList.add(RoomPlayCenterEntrance(RoomPlayCenterType.RED_PACKET))
|
|
|
val isRoomOwner =
|
|
|
roomService.memberController.isJoinedRoomOwner(ProfileModule.getMyUid())
|
|
|
- val isRoomAdmin = roomService.memberController.isJoinedRoomAdmin(ProfileModule.getMyUid())
|
|
|
+ val isRoomAdmin =
|
|
|
+ roomService.memberController.isJoinedRoomAdmin(ProfileModule.getMyUid())
|
|
|
val roomType = roomService.attrController.getRoomType()
|
|
|
if (isRoomOwner) {
|
|
|
gameCenterList.add(RoomPlayCenterEntrance(RoomPlayCenterType.MIC_PK))
|
|
|
@@ -209,7 +234,11 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
|
|
|
val operatorList = mutableListOf<RoomPlayCenterTitleOperator>()
|
|
|
if (gameConfigMap[DecorType.GAME_TAB_SWITCH]?.show == true) {
|
|
|
val gameRewardInfoAwait = async {
|
|
|
- GameModule.getActivityGameRewardInfo(com.adealink.weparty.module.game.data.CommonActivityRewardInfoReq(requestType = com.adealink.weparty.module.game.data.ActivityType.TYPE_GAME.type))
|
|
|
+ GameModule.getActivityGameRewardInfo(
|
|
|
+ com.adealink.weparty.module.game.data.CommonActivityRewardInfoReq(
|
|
|
+ requestType = com.adealink.weparty.module.game.data.ActivityType.TYPE_GAME.type
|
|
|
+ )
|
|
|
+ )
|
|
|
}
|
|
|
val gameLevelInfoAwait = async {
|
|
|
GameModule.getUserGameLevelInfo(listOf(ProfileModule.getMyUid()))
|
|
|
@@ -240,13 +269,29 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
|
|
|
}
|
|
|
addGameList(luckyGameList)
|
|
|
if (luckyGameList.isNotEmpty()) {
|
|
|
- luckyGameList.add(
|
|
|
- 0,
|
|
|
- RoomPlayCenterTitle(
|
|
|
- getCompatString(R.string.room_play_lucky_game),
|
|
|
- operatorList
|
|
|
+ // 老虎机游戏入口(和Title合并)
|
|
|
+ if (gameConfigMap[DecorType.SHOW_MINI_SLOT]?.show == true) {
|
|
|
+ // 获取游戏数据(1->全部数据)
|
|
|
+ val miniSlotConfigInfoDef = async { GameModule.getMiniSlotConfigInfo(MiniSlotNeedData.MIN_DATA) }
|
|
|
+ val miniSlotConfigInfoRlt = miniSlotConfigInfoDef.await()
|
|
|
+ val miniSlotConfigInfo = if (miniSlotConfigInfoRlt is Rlt.Success) miniSlotConfigInfoRlt.data.data else null
|
|
|
+ luckyGameList.add(
|
|
|
+ 0,
|
|
|
+ RoomPlayCenterMiniSlotData(
|
|
|
+ title = getCompatString(R.string.room_play_lucky_game),
|
|
|
+ showMiniSlot = true,
|
|
|
+ miniSlotConfigInfoRsp = miniSlotConfigInfo
|
|
|
+ )
|
|
|
)
|
|
|
- )
|
|
|
+ } else {
|
|
|
+ luckyGameList.add(
|
|
|
+ 0,
|
|
|
+ RoomPlayCenterMiniSlotData(
|
|
|
+ title = getCompatString(R.string.room_play_lucky_game),
|
|
|
+ showMiniSlot = false
|
|
|
+ )
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//活动工具
|
|
|
@@ -280,19 +325,28 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
|
|
|
private fun addGameList(luckyGameList: MutableList<RoomPlayerCenterData>) {
|
|
|
if (gameConfigMap[DecorType.LUCKY_FRUIT_GAME]?.show == true) {
|
|
|
luckyGameList.add(
|
|
|
- RoomPlayCenterEntrance(RoomPlayCenterType.LUCKY_FRUIT, url = urlConfigService.getH5Url(H5Page.LUCKY_FRUIT))
|
|
|
+ RoomPlayCenterEntrance(
|
|
|
+ RoomPlayCenterType.LUCKY_FRUIT,
|
|
|
+ url = urlConfigService.getH5Url(H5Page.LUCKY_FRUIT)
|
|
|
+ )
|
|
|
)
|
|
|
}
|
|
|
|
|
|
if (gameConfigMap[DecorType.LUCKY_PRO_GAME]?.show == true) {
|
|
|
luckyGameList.add(
|
|
|
- RoomPlayCenterEntrance(RoomPlayCenterType.LUCKY_PRO, url = urlConfigService.getH5Url(H5Page.LUCKY_PRO))
|
|
|
+ RoomPlayCenterEntrance(
|
|
|
+ RoomPlayCenterType.LUCKY_PRO,
|
|
|
+ url = urlConfigService.getH5Url(H5Page.LUCKY_PRO)
|
|
|
+ )
|
|
|
)
|
|
|
}
|
|
|
|
|
|
if (gameConfigMap[DecorType.GREEDY_PRO_GAME]?.show == true) {
|
|
|
luckyGameList.add(
|
|
|
- RoomPlayCenterEntrance(RoomPlayCenterType.GREEDY_PRO, url = urlConfigService.getH5Url(H5Page.GREEDY_PRO))
|
|
|
+ RoomPlayCenterEntrance(
|
|
|
+ RoomPlayCenterType.GREEDY_PRO,
|
|
|
+ url = urlConfigService.getH5Url(H5Page.GREEDY_PRO)
|
|
|
+ )
|
|
|
)
|
|
|
}
|
|
|
|
|
|
@@ -309,7 +363,10 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
|
|
|
|
|
|
if (gameConfigMap[DecorType.JACKPOT_GAME]?.show == true) {
|
|
|
luckyGameList.add(
|
|
|
- RoomPlayCenterEntrance(RoomPlayCenterType.JACKPOT, url = urlConfigService.getH5Url(H5Page.JACKPOT))
|
|
|
+ RoomPlayCenterEntrance(
|
|
|
+ RoomPlayCenterType.JACKPOT,
|
|
|
+ url = urlConfigService.getH5Url(H5Page.JACKPOT)
|
|
|
+ )
|
|
|
)
|
|
|
}
|
|
|
|
|
|
@@ -338,7 +395,10 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
|
|
|
}
|
|
|
if (gameConfigMap[DecorType.GREEDY_PERSONAL_GAME]?.show == true) {
|
|
|
luckyGameList.add(
|
|
|
- RoomPlayCenterEntrance(RoomPlayCenterType.GREEDY_PERSONAL, url = urlConfigService.getH5Url(H5Page.GREEDY_PERSONAL))
|
|
|
+ RoomPlayCenterEntrance(
|
|
|
+ RoomPlayCenterType.GREEDY_PERSONAL,
|
|
|
+ url = urlConfigService.getH5Url(H5Page.GREEDY_PERSONAL)
|
|
|
+ )
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
@@ -359,7 +419,7 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
|
|
|
val switchBroadcastLevel =
|
|
|
roomGlobalBroadcastManager.getCanSwitchBroadcastLevel() ?: return true
|
|
|
val userInfo = ProfileModule.getMyUserInfo()
|
|
|
- return userInfo != null && (userInfo.level?:0) >= switchBroadcastLevel
|
|
|
+ return userInfo != null && (userInfo.level ?: 0) >= switchBroadcastLevel
|
|
|
}
|
|
|
|
|
|
fun logout() {
|