Просмотр исходного кода

feat: 概率游戏 (#40)

* feat: 概率游戏入口梳理

* feat: 概率游戏入口梳理

* feat: 概率游戏入口

* feat: appName补充

* feat: cocos游戏版本控制

* feat: cocos游戏版本控制

* feat: 全服横幅跳转游戏
WilliumP 10 месяцев назад
Родитель
Сommit
f672252f2e
36 измененных файлов с 526 добавлено и 478 удалено
  1. 23 0
      app/src/main/java/com/adealink/weparty/config/Data.kt
  2. 59 0
      app/src/main/java/com/adealink/weparty/config/GlobalConfigManager.kt
  3. 2 0
      app/src/main/java/com/adealink/weparty/config/IGlobalConfigManager.kt
  4. 4 0
      app/src/main/java/com/adealink/weparty/module/game/viewmodel/IGameViewModel.kt
  5. 13 19
      app/src/main/java/com/adealink/weparty/module/profile/decorate/data/UserDecorateData.kt
  6. 1 0
      app/src/main/java/com/adealink/weparty/module/webview/data/WebData.kt
  7. 4 4
      app/src/main/java/com/adealink/weparty/url/UrlConfig.kt
  8. BIN
      app/src/main/res/drawable-xhdpi/common_friuit_ic.webp
  9. BIN
      app/src/main/res/drawable-xhdpi/common_fruit_ic.webp
  10. BIN
      app/src/main/res/drawable-xhdpi/common_greedy_box_ic.webp
  11. BIN
      app/src/main/res/drawable-xhdpi/common_greedy_ic.webp
  12. BIN
      app/src/main/res/drawable-xhdpi/common_greedy_pro_ic.webp
  13. BIN
      app/src/main/res/drawable-xhdpi/common_jackpot_ic.webp
  14. BIN
      app/src/main/res/drawable-xhdpi/common_lucky_fruit_ic.webp
  15. BIN
      app/src/main/res/drawable-xhdpi/common_lucky_pro_ic.webp
  16. BIN
      app/src/main/res/drawable-xhdpi/common_old_friuit_ic.webp
  17. BIN
      app/src/main/res/drawable-xhdpi/common_old_fruit_ic.webp
  18. BIN
      app/src/main/res/drawable-xhdpi/common_pyramid_slots_ic.webp
  19. 37 0
      module/game/src/main/java/com/adealink/weparty/game/viewmodel/GameViewModel.kt
  20. 64 68
      module/headline/src/main/java/com/adealink/weparty/headline/fragment/HeadlineFragment.kt
  21. 1 27
      module/profile/src/main/java/com/adealink/weparty/profile/decorate/manager/UserDecorManager.kt
  22. 14 18
      module/room/src/main/java/com/adealink/weparty/room/game/GameComp.kt
  23. 15 24
      module/room/src/main/java/com/adealink/weparty/room/game/RoomGameCenterPanelFragment.kt
  24. 4 4
      module/room/src/main/java/com/adealink/weparty/room/micseat/globalbroadcast/data/RoomGlobalBroadcastData.kt
  25. 8 8
      module/room/src/main/java/com/adealink/weparty/room/micseat/globalbroadcast/viewmodel/RoomGlobalBroadcastViewModel.kt
  26. 119 58
      module/room/src/main/java/com/adealink/weparty/room/playcenter/RoomPlayCenterPanelFragment.kt
  27. 2 2
      module/room/src/main/java/com/adealink/weparty/room/playcenter/adapter/RoomPlayCenterEntranceViewBinder.kt
  28. 7 4
      module/room/src/main/java/com/adealink/weparty/room/playcenter/data/RoomPlayCenterData.kt
  29. 112 217
      module/room/src/main/java/com/adealink/weparty/room/playcenter/manager/PlayCenterManager.kt
  30. 10 10
      module/room/src/main/java/com/adealink/weparty/room/playcenter/util/PlayCenterUtil.kt
  31. BIN
      module/room/src/main/res/drawable-xhdpi/room_play_center_greedy_box_ic.webp
  32. 4 3
      module/webview/src/main/java/com/adealink/weparty/webview/WebViewDialogFragment.kt
  33. 2 0
      module/webview/src/main/java/com/adealink/weparty/webview/cocosgame/data/CocosWindowViewData.kt
  34. 1 1
      module/webview/src/main/java/com/adealink/weparty/webview/cocosgame/viewmodel/BaseCocosWebGameViewModel.kt
  35. 2 2
      module/webview/src/main/java/com/adealink/weparty/webview/component/GameLoadingComp.kt
  36. 18 9
      module/webview/src/main/java/com/adealink/weparty/webview/game/OfflineH5ViewModel.kt

+ 23 - 0
app/src/main/java/com/adealink/weparty/config/Data.kt

@@ -5,6 +5,7 @@ import com.adealink.frame.util.ONE_MINUTE
 import com.adealink.frame.util.PackageUtil
 import com.adealink.weparty.channel.getChannel
 import com.adealink.weparty.constant.ProductFlavor
+import com.google.gson.annotations.GsonNullable
 import com.google.gson.annotations.JsonAdapter
 import com.google.gson.annotations.SerializedName
 import com.google.gson.internal.bind.ExtReflectiveTypeAdapterFactory
@@ -71,6 +72,11 @@ enum class GlobalConfigType(val value: Int) {
 
     GLOBAL_URL_CONFIG(76),
     GLOBAL_DELETA_ACCOUNT_TIPS(77),//url配置
+    GLOBAL_TEENPATTI_VERSION_INFO(80), //teen patti游戏版本信息
+    GLOBAL_RUSSIAN_TURNTABLE_VERSION_INFO(81), //russian turntable游戏版本信息
+    GLOBAL_GREEDYBOX_VERSION_INFO(82), //greedy_box游戏版本信息
+    GLOBAL_TEXAS_COWBOY_VERSION_INFO(83), //texas cowboy游戏版本信息
+    GLOBAL_JACKPOT_SLOT_VERSION_INFO(84), //jackpot slot游戏版本信息
     GLOBAL_APPROVING_VERSION(90),//提审版本信息
     GLOBAL_CALL_1V1(97), //1v1Call
     GLOBAL_MALE_DAILY_CHARGE_ACTIVITY_SWITCH(99); // 男性每日充值活动开关配置
@@ -83,6 +89,23 @@ enum class GlobalConfigType(val value: Int) {
     }
 }
 
+@JsonAdapter(ExtReflectiveTypeAdapterFactory::class)
+data class GameVersionConfig(
+    @SerializedName("version") val version: String,
+    @GsonNullable
+    @SerializedName("versionCode") val versionCode: Int,
+    @GsonNullable
+    @SerializedName("minClientVersion") val minClientVersion: Int,
+    @GsonNullable
+    @SerializedName("minLiteClientVersion") val minLiteClientVersion: Int,
+    @GsonNullable
+    @SerializedName("resourceUrl") val resourceUrl: String,
+    @GsonNullable
+    @SerializedName("changeList") val changeList: String?,
+
+    var needDownload: Boolean = true //包体需要下载
+)
+
 @JsonAdapter(ExtReflectiveTypeAdapterFactory::class)
 data class ApprovingVersionConfig(
     @SerializedName("android")

+ 59 - 0
app/src/main/java/com/adealink/weparty/config/GlobalConfigManager.kt

@@ -1,17 +1,30 @@
 package com.adealink.weparty.config
 
 import com.adealink.frame.base.Rlt
+import com.adealink.frame.coroutine.dispatcher.Dispatcher
 import com.adealink.frame.data.collections.ConcurrentList
 import com.adealink.frame.data.json.froJsonErrorNull
+import com.adealink.frame.data.json.gson
 import com.adealink.frame.data.json.toJsonErrorNull
 import com.adealink.frame.frame.BaseFrame
 import com.adealink.frame.frame.IListener
+import com.adealink.frame.game.TAG_GAME
 import com.adealink.frame.log.Log
 import com.adealink.frame.mvvm.livedata.OnceMutableLiveData
 import com.adealink.frame.network.data.Res
+import com.adealink.frame.util.PackageUtil
 import com.adealink.weparty.App
+import com.adealink.weparty.constant.ProductFlavor
+import com.adealink.weparty.module.game.data.GameAppVersionOldCanPlayGameError
+import com.adealink.weparty.module.game.data.GameAppVersionOldNeedUpgradeError
+import com.adealink.weparty.module.game.data.GameInfoLostError
+import com.adealink.weparty.module.game.data.GameVersion
+import com.adealink.weparty.module.profile.decorate.data.DecorType
+import com.adealink.weparty.storage.file.FilePath
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.withContext
+import java.io.File
+import java.io.FileReader
 import java.util.concurrent.ConcurrentHashMap
 
 val globalConfigManager: IGlobalConfigManager by lazy { GlobalConfigManager() }
@@ -192,4 +205,50 @@ class GlobalConfigManager : BaseFrame<IListener>(), IGlobalConfigManager {
             //listenerMap.clear()
         }
     }
+
+    override suspend fun checkGameValid(type: GlobalConfigType): Rlt<Any> {
+        val remoteVersionInfo = froJsonErrorNull(configMap[type.value]?.firstOrNull(), GameVersionConfig::class.java)
+        val localGameInfo = getGameInfo(type)
+        if(remoteVersionInfo == null) {
+            return Rlt.Failed(GameInfoLostError())
+        }
+        if(remoteVersionInfo.minClientVersion > PackageUtil.getVersionCode()) {
+            return if(localGameInfo != null) {
+                Rlt.Failed(GameAppVersionOldCanPlayGameError())
+            } else {
+                Rlt.Failed(GameAppVersionOldNeedUpgradeError())
+            }
+        }
+        return Rlt.Success(Any())
+    }
+
+    private suspend fun getGameInfo(gameType: GlobalConfigType): GameVersion? {
+        val type = when(gameType) {
+            GlobalConfigType.GLOBAL_TEXAS_COWBOY_VERSION_INFO -> DecorType.TEXAS_GAME.value
+            GlobalConfigType.GLOBAL_TEENPATTI_VERSION_INFO -> DecorType.TEEN_PATTI_GAME.value
+            GlobalConfigType.GLOBAL_RUSSIAN_TURNTABLE_VERSION_INFO -> DecorType.RUSSIAN_TURNTABLE_GAME.value
+            GlobalConfigType.GLOBAL_GREEDYBOX_VERSION_INFO -> DecorType.GREEDY_BOX_GAME.value
+            GlobalConfigType.GLOBAL_JACKPOT_SLOT_VERSION_INFO -> DecorType.JACKPOT_SLOT_GAME.value
+            else -> 0
+        }
+        val path = "${FilePath.offlineH5}game-${type}"
+        val rootPath = File(path)
+        if (!rootPath.exists() || !rootPath.isDirectory) {
+            return null
+        }
+        val gameVersion: GameVersion? = withContext(Dispatcher.WENEXT_THREAD_POOL) {
+            val versionFile = File("${path}${File.separator}version.txt")
+            if (versionFile.exists() && versionFile.isFile) {
+                try {
+                    gson.fromJson(FileReader(versionFile), GameVersion::class.java)
+                } catch (e: Exception) {
+                    Log.e(TAG_GAME, "getLocalGameInfo version fail, for ${e.message}")
+                    null
+                }
+            } else {
+                null
+            }
+        }
+        return gameVersion
+    }
 }

+ 2 - 0
app/src/main/java/com/adealink/weparty/config/IGlobalConfigManager.kt

@@ -1,5 +1,6 @@
 package com.adealink.weparty.config
 
+import com.adealink.frame.base.Rlt
 import com.adealink.frame.mvvm.livedata.OnceMutableLiveData
 
 interface IGlobalConfigManager {
@@ -12,4 +13,5 @@ interface IGlobalConfigManager {
     fun addListener(configType: GlobalConfigType, l: IGlobalConfigListener)
     fun removeListener(configType: GlobalConfigType, l: IGlobalConfigListener)
     fun logout()
+    suspend fun checkGameValid(type: GlobalConfigType): Rlt<Any>
 }

+ 4 - 0
app/src/main/java/com/adealink/weparty/module/game/viewmodel/IGameViewModel.kt

@@ -3,6 +3,8 @@ package com.adealink.weparty.module.game.viewmodel
 import androidx.lifecycle.LiveData
 import com.adealink.frame.base.Rlt
 import com.adealink.frame.network.data.Res
+import com.adealink.weparty.config.GameVersionConfig
+import com.adealink.weparty.config.GlobalConfigType
 import com.adealink.weparty.module.game.data.GameShowConfig
 import com.adealink.weparty.module.game.data.GameType
 import com.adealink.weparty.module.game.data.LuckyFruitShowRes
@@ -23,4 +25,6 @@ interface IGameViewModel {
     fun isShowSlot(): LiveData<Rlt<Res<SlotConfigInfoRes>>>
 
     fun isGameShow(configTypes: List<Int>): LiveData<Map<Int, GameShowConfig>>
+
+    fun checkGameValid(type: GlobalConfigType): LiveData<Pair<Boolean, GameVersionConfig?>>
 }

+ 13 - 19
app/src/main/java/com/adealink/weparty/module/profile/decorate/data/UserDecorateData.kt

@@ -27,22 +27,24 @@ enum class DecorType(val value: Int) {
     IM_LEVEL_LIMIT(27),//私信等级限制
     LUDO_QUICK_PLAY(28),//LUDO快速游戏
     ROOM_PK_CONFIG(34),// 房间PK
-    FISHING_GAME(35), //捕鱼游戏
-    TEEN_PATTI(37), // 是否开启Teen Patti
     DELETE_ACCOUNT(38), //删除账号
-    GREEDY_PRO(39), //greedy pro
-    PYRAMID_SLOTS(40), //new slots游戏
     SVIP_USER_SWITCH(41), // SVIP特权开关
     GAME_TAB_SWITCH(42), // 排行榜GameTab
-    LUCKY_FRUIT_GAME(21),//水果机
-    LUCKY_FRUIT_GAME_NEW(39),//新水果机
-    LUCKY_JACKPOT_GAME(22),//老虎机
     USER_CONFIG_FAMILY_GROUP_CHAT(45), //用户家族群聊设置
-    LUCKY_PRO(46), //旧水果机
-    SLOT_PRO(47), //新老虎机
-    GREEDY_BOX(48),
     USER_UPLOAD_COVER(62), //用户上传封面
 
+    //游戏相关
+    LUCKY_FRUIT_GAME(21),//水果机
+    JACKPOT_GAME(22),//老虎机
+    JACKPOT_SLOT_GAME(47), //新老虎机
+    GREEDY_BOX_GAME(80), //Greedy Box游戏
+    TEEN_PATTI_GAME(85), // 是否开启Teen Patti
+    DRAGON_TIGER_FIGHT_GAME(86), //龙虎斗游戏
+    RUSSIAN_TURNTABLE_GAME(87), //Russian Turntable游戏
+    TEXAS_GAME(88), //texas cowboy游戏
+    LUCKY_PRO_GAME(104), //旧水果机
+    GREEDY_PRO_GAME(108), //新水果机
+
     MOMENT_BG(120), // moment背景卡
     CHAT_BUBBLE(121), //聊天气泡
     ENTRY_EFFECTS(122), //进场特效
@@ -219,14 +221,6 @@ data class FishingGameConfig(
     @SerializedName("url") val url: String,
 )
 
-data class FishingGameDecor(val open: Boolean, val url: String) :
-    DecorInfo(DecorType.FISHING_GAME) {
-    override fun areContentsTheSame(newItem: DecorInfo): Boolean {
-        val newDecorInfo = newItem as? FishingGameDecor ?: return false
-        return open == newDecorInfo.open && url == newItem.url
-    }
-}
-
 @JsonAdapter(ExtReflectiveTypeAdapterFactory::class)
 data class ChatBubbleConfig(
     @GsonNullable
@@ -288,7 +282,7 @@ data class UserRippledDecor(val url: String?, val scaleRatio: Float?) :
 }
 
 data class TeenPattiDecor(val open: Boolean) :
-    DecorInfo(DecorType.TEEN_PATTI) {
+    DecorInfo(DecorType.TEEN_PATTI_GAME) {
     override fun areContentsTheSame(newItem: DecorInfo): Boolean {
         val newDecorInfo = newItem as? TeenPattiDecor ?: return false
         return open == newDecorInfo.open

+ 1 - 0
app/src/main/java/com/adealink/weparty/module/webview/data/WebData.kt

@@ -21,4 +21,5 @@ data class WebConfig(
 data class OfflineH5GameInfo(
     val downloadUrl: String?,
     val gameType: Int,
+    val needDownload: Boolean = true
 ): Parcelable

+ 4 - 4
app/src/main/java/com/adealink/weparty/url/UrlConfig.kt

@@ -24,7 +24,7 @@ object UrlConfig {
         else -> "https://web-test.yoki.chat/coin-faq?projectname=yoki-room-game-help"
     }
     internal val luckyFruit = when {
-        isProdEnv -> "http://web-test.yoki.chat/index/?projectname=yoki-lucky-fruit&aspect_ratio=1.604"
+        isProdEnv -> "http://web.yoki.chat/index/?projectname=yoki-lucky-fruit&aspect_ratio=1.604"
         else -> "http://web-test.yoki.chat/index/?projectname=yoki-lucky-fruit&aspect_ratio=1.604"
     }
 
@@ -109,11 +109,11 @@ object UrlConfig {
     }
 
     internal val greedyPro = when {
-        isProdEnv -> "http://web-test.yoki.chat/index/?projectname=yoki-greedy-pro&aspect_ratio=1.571"
+        isProdEnv -> "http://web.yoki.chat/index/?projectname=yoki-greedy-pro&aspect_ratio=1.571"
         else -> "http://web-test.yoki.chat/index/?projectname=yoki-greedy-pro&aspect_ratio=1.571"
     }
     internal val jackpot = when {
-        isProdEnv -> "http://web-test.yoki.chat/index/?projectname=yoki-jackpot"
+        isProdEnv -> "http://web.yoki.chat/index/?projectname=yoki-jackpot"
         else -> "http://web-test.yoki.chat/index/?projectname=yoki-jackpot"
     }
     internal val adminActivity = when {
@@ -147,7 +147,7 @@ object UrlConfig {
     }
 
     internal val luckyPro = when {
-        isProdEnv -> "http://web-test.yoki.chat/index/?projectname=yoki-lucky-pro&aspect_ratio=1.604"
+        isProdEnv -> "http://web.yoki.chat/index/?projectname=yoki-lucky-pro&aspect_ratio=1.604"
         else -> "http://web-test.yoki.chat/index/?projectname=yoki-lucky-pro&aspect_ratio=1.604"
     }
     internal val unoRule = when (AppBaseInfo.isProdEnv) {

BIN
app/src/main/res/drawable-xhdpi/common_friuit_ic.webp


BIN
app/src/main/res/drawable-xhdpi/common_fruit_ic.webp


BIN
app/src/main/res/drawable-xhdpi/common_greedy_box_ic.webp


BIN
app/src/main/res/drawable-xhdpi/common_greedy_ic.webp


BIN
app/src/main/res/drawable-xhdpi/common_greedy_pro_ic.webp


BIN
app/src/main/res/drawable-xhdpi/common_jackpot_ic.webp


BIN
app/src/main/res/drawable-xhdpi/common_lucky_fruit_ic.webp


BIN
app/src/main/res/drawable-xhdpi/common_lucky_pro_ic.webp


BIN
app/src/main/res/drawable-xhdpi/common_old_friuit_ic.webp


BIN
app/src/main/res/drawable-xhdpi/common_old_fruit_ic.webp


BIN
app/src/main/res/drawable-xhdpi/common_pyramid_slots_ic.webp


+ 37 - 0
module/game/src/main/java/com/adealink/weparty/game/viewmodel/GameViewModel.kt

@@ -1,19 +1,29 @@
 package com.adealink.weparty.game.viewmodel
 
+import android.util.Log
 import androidx.lifecycle.LiveData
+import androidx.lifecycle.MutableLiveData
 import com.adealink.frame.aab.util.getCompatString
 import com.adealink.frame.base.Rlt
+import com.adealink.frame.data.json.froJsonErrorNull
+import com.adealink.frame.game.TAG_GAME
 import com.adealink.frame.mvvm.livedata.OnceMutableLiveData
 import com.adealink.frame.mvvm.viewmodel.BaseViewModel
 import com.adealink.frame.network.data.Res
 import com.adealink.frame.util.PackageUtil.getVersionCode
 import com.adealink.weparty.App
+import com.adealink.weparty.commonui.toast.util.showToast
+import com.adealink.weparty.config.GameVersionConfig
+import com.adealink.weparty.config.GlobalConfigType
+import com.adealink.weparty.config.globalConfigManager
 import com.adealink.weparty.game.datasource.remote.GameHttpService
 import com.adealink.weparty.game.miccharmpk.manager.micCharmPKManager
 import com.adealink.weparty.module.game.GameModule
+import com.adealink.weparty.module.game.data.GameAppVersionOldCanPlayGameError
 import com.adealink.weparty.module.game.data.GamePlayConflictError
 import com.adealink.weparty.module.game.data.GameShowConfig
 import com.adealink.weparty.module.game.data.GameType
+import com.adealink.weparty.module.game.data.GameVersionNotMatchError
 import com.adealink.weparty.module.game.data.LuckyFruitShowRes
 import com.adealink.weparty.module.game.data.SlotConfigInfoRes
 import com.adealink.weparty.module.game.viewmodel.IGameViewModel
@@ -75,6 +85,33 @@ class GameViewModel : BaseViewModel(), IGameViewModel {
         return liveData
     }
 
+    override fun checkGameValid(type: GlobalConfigType): LiveData<Pair<Boolean, GameVersionConfig?>> {
+        val liveData = MutableLiveData<Pair<Boolean, GameVersionConfig?>>()
+        viewModelScope.launch {
+            val newVersion = froJsonErrorNull(globalConfigManager.suspendGetConfig(type)?.firstOrNull(), GameVersionConfig::class.java)
+            when(val rlt = globalConfigManager.checkGameValid(type)) {
+                is Rlt.Success -> {
+                    liveData.send(Pair(true, newVersion))
+                }
+                is Rlt.Failed -> {
+                    Log.e(TAG_GAME, "offline game check, rlt: ${rlt.error.msg}")
+                    when(rlt.error) {
+                        is GameAppVersionOldCanPlayGameError -> {
+                            // 这种情况不应该更新游戏版本,只允许玩本地的版本
+                            newVersion?.needDownload = false
+                            liveData.send(Pair(true, newVersion))
+                        }
+                        else -> {
+                            liveData.send(Pair(false, newVersion))
+                        }
+                    }
+                    showToast(rlt.error.msg)
+                }
+            }
+        }
+        return liveData
+    }
+
     private fun getPlayingGame(): GameType? {
         return when {
             micCharmPKManager.isMicCharmPKing() -> {

+ 64 - 68
module/headline/src/main/java/com/adealink/weparty/headline/fragment/HeadlineFragment.kt

@@ -25,6 +25,7 @@ import com.adealink.weparty.commonui.toast.util.showToast
 import com.adealink.weparty.commonui.widget.floatview.view.HideMode
 import com.adealink.weparty.commonui.widget.floatview.view.ITouchDispatchEventListener
 import com.adealink.weparty.commonui.widget.floatview.view.SwipeToTopConstraintLayout
+import com.adealink.weparty.config.GlobalConfigType
 import com.adealink.weparty.headline.R
 import com.adealink.weparty.headline.data.TAG_HEADLINE
 import com.adealink.weparty.headline.databinding.FragmentHealineBinding
@@ -290,10 +291,10 @@ class HeadlineFragment : BaseFragment(R.layout.fragment_healine), IHeadlineOpLis
                 }
             }
         }
-        gameViewModel?.isGameShow(listOf(DecorType.TEEN_PATTI.value, DecorType.GREEDY_PRO.value))
+        gameViewModel?.isGameShow(listOf(DecorType.TEEN_PATTI_GAME.value, DecorType.GREEDY_PRO_GAME.value))
             ?.observe(viewLifecycleOwner) { configMap ->
-                teenPattiShowConfig = configMap[DecorType.TEEN_PATTI.value]
-                greedyProShowConfig = configMap[DecorType.GREEDY_PRO.value]
+                teenPattiShowConfig = configMap[DecorType.TEEN_PATTI_GAME.value]
+                greedyProShowConfig = configMap[DecorType.GREEDY_PRO_GAME.value]
             }
 
         headlineViewModel.getHeadlineQueueRandomConfig().observe(viewLifecycleOwner) {
@@ -344,51 +345,51 @@ class HeadlineFragment : BaseFragment(R.layout.fragment_healine), IHeadlineOpLis
 
     private fun checkAndShowTeenPattiEntry() {
         if (teenPattiShowConfig == null) {
-            gameViewModel?.isGameShow(listOf(DecorType.TEEN_PATTI.value))
+            gameViewModel?.isGameShow(listOf(DecorType.TEEN_PATTI_GAME.value))
                 ?.observe(viewLifecycleOwner) { configMap ->
-                    teenPattiShowConfig = configMap[DecorType.TEEN_PATTI.value]
+                    teenPattiShowConfig = configMap[DecorType.TEEN_PATTI_GAME.value]
                     if (teenPattiShowConfig?.show == true) {
-                        showTeenPattiEntry(teenPattiShowConfig?.loadingUrl, teenPattiShowConfig?.offlineUrl)
+                        showTeenPattiEntry(teenPattiShowConfig?.loadingUrl)
                     }
                 }
         } else if (teenPattiShowConfig?.show == true) {
-            showTeenPattiEntry(teenPattiShowConfig?.loadingUrl, teenPattiShowConfig?.offlineUrl)
+            showTeenPattiEntry(teenPattiShowConfig?.loadingUrl)
         }
     }
 
     private fun checkAndShowSlotProEntry() {
         if (slotProShowConfig == null) {
-            gameViewModel?.isGameShow(listOf(DecorType.SLOT_PRO.value))
+            gameViewModel?.isGameShow(listOf(DecorType.JACKPOT_SLOT_GAME.value))
                 ?.observe(viewLifecycleOwner) { configMap ->
-                    slotProShowConfig = configMap[DecorType.SLOT_PRO.value]
+                    slotProShowConfig = configMap[DecorType.JACKPOT_SLOT_GAME.value]
                     if (slotProShowConfig?.show == true) {
-                        showSlotProEntry(slotProShowConfig?.loadingUrl, slotProShowConfig?.url)
+                        showSlotProEntry(slotProShowConfig?.loadingUrl)
                     }
                 }
         } else if (slotProShowConfig?.show == true) {
-            showSlotProEntry(slotProShowConfig?.loadingUrl, slotProShowConfig?.url)
+            showSlotProEntry(slotProShowConfig?.loadingUrl)
         }
     }
 
     private fun checkAndShowGreedyBoxEntry() {
         if (greedyBoxShowConfig == null) {
-            gameViewModel?.isGameShow(listOf(DecorType.GREEDY_BOX.value))
+            gameViewModel?.isGameShow(listOf(DecorType.GREEDY_BOX_GAME.value))
                 ?.observe(viewLifecycleOwner) { configMap ->
-                    greedyBoxShowConfig = configMap[DecorType.GREEDY_BOX.value]
+                    greedyBoxShowConfig = configMap[DecorType.GREEDY_BOX_GAME.value]
                     if (greedyBoxShowConfig?.show == true) {
-                        showGreedyBoxEntry(greedyBoxShowConfig?.loadingUrl, greedyBoxShowConfig?.offlineUrl)
+                        showGreedyBoxEntry(greedyBoxShowConfig?.loadingUrl)
                     }
                 }
         } else if (greedyBoxShowConfig?.show == true) {
-            showGreedyBoxEntry(greedyBoxShowConfig?.loadingUrl, greedyBoxShowConfig?.offlineUrl)
+            showGreedyBoxEntry(greedyBoxShowConfig?.loadingUrl)
         }
     }
 
     private fun checkAndShowGreedyProEntry() {
         if (greedyProShowConfig == null) {
-            gameViewModel?.isGameShow(listOf(DecorType.GREEDY_PRO.value))
+            gameViewModel?.isGameShow(listOf(DecorType.GREEDY_PRO_GAME.value))
                 ?.observe(viewLifecycleOwner) { configMap ->
-                    greedyProShowConfig = configMap[DecorType.GREEDY_PRO.value]
+                    greedyProShowConfig = configMap[DecorType.GREEDY_PRO_GAME.value]
                     if (greedyProShowConfig?.show == true) {
                         showGreedyProEntry()
                     }
@@ -400,9 +401,9 @@ class HeadlineFragment : BaseFragment(R.layout.fragment_healine), IHeadlineOpLis
 
     private fun checkAndShowLuckyProEntry() {
         if (luckyProShowConfig == null) {
-            gameViewModel?.isGameShow(listOf(DecorType.LUCKY_PRO.value))
+            gameViewModel?.isGameShow(listOf(DecorType.LUCKY_PRO_GAME.value))
                 ?.observe(viewLifecycleOwner) { configMap ->
-                    luckyProShowConfig = configMap[DecorType.LUCKY_PRO.value]
+                    luckyProShowConfig = configMap[DecorType.LUCKY_PRO_GAME.value]
                     if (luckyProShowConfig?.show == true) {
                         showLuckyProEntry()
                     }
@@ -450,18 +451,6 @@ class HeadlineFragment : BaseFragment(R.layout.fragment_healine), IHeadlineOpLis
         }
     }
 
-    private fun checkAndGoNewSlot() {
-        if (isShowSlot == null) {
-            gameViewModel?.isShowSlot()?.observe(viewLifecycleOwner) {
-                if (it is Rlt.Success && it.data.data!!.show) {
-                    goNewSlotWeb()
-                }
-            }
-        } else if (isShowSlot == true) {
-            goNewSlotWeb()
-        }
-    }
-
     private fun goSlotWeb() {
         val activity = activity ?: return
         Router.build(activity, Web.FullScreen.PATH)
@@ -469,45 +458,52 @@ class HeadlineFragment : BaseFragment(R.layout.fragment_healine), IHeadlineOpLis
             .start()
     }
 
-    private fun showSlotProEntry(loadingUrl: String?, offlineUrl: String?) {
-        val activity = activity ?: return
-        WebViewDialogFragmentBuilder()
-            .height(1340 * DisplayUtil.getScreenWidth() / 750)
-            .loadingUrl(loadingUrl)
-            .offlineGameInfo(OfflineH5GameInfo(offlineUrl, DecorType.SLOT_PRO.value))
-            .build()
-            ?.showUrl(activity.supportFragmentManager, "")
-    }
-
-    private fun showGreedyBoxEntry(loadingUrl: String?, offlineUrl: String?) {
-        val activity = activity ?: return
-        WebViewDialogFragmentBuilder()
-            .height(761 * DisplayUtil.getScreenWidth() / 750)
-            .loadingUrl(loadingUrl)
-            .offlineGameInfo(OfflineH5GameInfo(offlineUrl, DecorType.GREEDY_BOX.value))
-            .build()
-            ?.showUrl(activity.supportFragmentManager, "")
+    private fun showSlotProEntry(loadingUrl: String?) {
+        gameViewModel?.checkGameValid(GlobalConfigType.GLOBAL_JACKPOT_SLOT_VERSION_INFO)
+            ?.observe(viewLifecycleOwner) {
+                if(it.first.not()) return@observe
+                val resourceUrl = it.second?.resourceUrl
+                val needDownload = it.second?.needDownload ?: true
+                val activity = activity ?: return@observe
+                WebViewDialogFragmentBuilder()
+                    .height(1340 * DisplayUtil.getScreenWidth() / 750)
+                    .loadingUrl(loadingUrl)
+                    .offlineGameInfo(OfflineH5GameInfo(resourceUrl, DecorType.JACKPOT_SLOT_GAME.value, needDownload))
+                    .build()
+                    ?.showUrl(activity.supportFragmentManager, "")
+            }
     }
 
-    private fun goNewSlotWeb() {
-        val activity = activity ?: return
-        gameViewModel?.isGameShow(listOf(DecorType.PYRAMID_SLOTS.value))?.observe(viewLifecycleOwner) { it ->
-            it[DecorType.PYRAMID_SLOTS.value]?.let {
-                Router.build(activity, Web.FullScreen.PATH)
-                    .putExtra(Web.Common.EXTRA_URL, it.url)
-                    .start()
+    private fun showGreedyBoxEntry(loadingUrl: String?) {
+        gameViewModel?.checkGameValid(GlobalConfigType.GLOBAL_GREEDYBOX_VERSION_INFO)
+            ?.observe(viewLifecycleOwner) {
+                if(it.first.not()) return@observe
+                val resourceUrl = it.second?.resourceUrl
+                val needDownload = it.second?.needDownload ?: true
+                val activity = activity ?: return@observe
+                WebViewDialogFragmentBuilder()
+                    .height(761 * DisplayUtil.getScreenWidth() / 750)
+                    .loadingUrl(loadingUrl)
+                    .offlineGameInfo(OfflineH5GameInfo(resourceUrl, DecorType.GREEDY_BOX_GAME.value, needDownload))
+                    .build()
+                    ?.showUrl(activity.supportFragmentManager, "")
             }
-        }
     }
 
-    private fun showTeenPattiEntry(loadingUrl: String?, offlineUrl: String?) {
-        val activity = activity ?: return
-        WebViewDialogFragmentBuilder()
-            .height(1340 * DisplayUtil.getScreenWidth() / 750)
-            .loadingUrl(loadingUrl)
-            .offlineGameInfo(OfflineH5GameInfo(offlineUrl, DecorType.TEEN_PATTI.value))
-            .build()
-            ?.showUrl(activity.supportFragmentManager, urlConfigService.getH5Url(H5Page.TEEN_PATTI))
+    private fun showTeenPattiEntry(loadingUrl: String?) {
+        gameViewModel?.checkGameValid(GlobalConfigType.GLOBAL_TEENPATTI_VERSION_INFO)
+            ?.observe(viewLifecycleOwner) {
+                if(it.first.not()) return@observe
+                val resourceUrl = it.second?.resourceUrl
+                val needDownload = it.second?.needDownload ?: true
+                val activity = activity ?: return@observe
+                WebViewDialogFragmentBuilder()
+                    .height(1340 * DisplayUtil.getScreenWidth() / 750)
+                    .loadingUrl(loadingUrl)
+                    .offlineGameInfo(OfflineH5GameInfo(resourceUrl, DecorType.TEEN_PATTI_GAME.value, needDownload))
+                    .build()
+                    ?.showUrl(activity.supportFragmentManager, "")
+            }
     }
 
     private fun showGreedyProEntry() {
@@ -567,9 +563,9 @@ class HeadlineFragment : BaseFragment(R.layout.fragment_healine), IHeadlineOpLis
                 checkAndShowGreedyBoxEntry()
             }
 
-            RoomNotifyType.NEW_SLOT_REWARD_NOTIFY -> {
-                checkAndGoNewSlot()
-            }
+//            RoomNotifyType.NEW_SLOT_REWARD_NOTIFY -> {
+//                checkAndGoNewSlot()
+//            }
 
 //            RoomNotifyType.WORLD_CUP_POINTS_REACH_THRESHOLD -> {
 //                goWorldCupWeb()

+ 1 - 27
module/profile/src/main/java/com/adealink/weparty/profile/decorate/manager/UserDecorManager.kt

@@ -18,8 +18,6 @@ import com.adealink.weparty.module.profile.decorate.data.DecorInfo
 import com.adealink.weparty.module.profile.decorate.data.DecorType
 import com.adealink.weparty.module.profile.decorate.data.EmptyDecor
 import com.adealink.weparty.module.profile.decorate.data.FamilyGroupChatDecor
-import com.adealink.weparty.module.profile.decorate.data.FishingGameConfig
-import com.adealink.weparty.module.profile.decorate.data.FishingGameDecor
 import com.adealink.weparty.module.profile.decorate.data.HighPotentialVibrationPromptDecor
 import com.adealink.weparty.module.profile.decorate.data.HomeDynamicConfig
 import com.adealink.weparty.module.profile.decorate.data.HomeDynamicDecor
@@ -310,31 +308,7 @@ internal class UserDecorManager : BaseFrame<IUserDecorListener>(), IUserDecorMan
                     QuickLudoUserDecor(config.toIntOrNull() ?: 0)
                 }
 
-                DecorType.FISHING_GAME -> {
-                    val fishingGameConfig = froJsonErrorNull<FishingGameConfig>(config)
-                    if (fishingGameConfig == null) {
-                        EmptyDecor
-                    } else {
-                        FishingGameDecor(
-                            fishingGameConfig.configValue.safeToInt() == 1,
-                            fishingGameConfig.url
-                        )
-                    }
-                }
-
-                DecorType.PYRAMID_SLOTS -> {
-                    val fishingGameConfig = froJsonErrorNull<FishingGameConfig>(config)
-                    if (fishingGameConfig == null) {
-                        EmptyDecor
-                    } else {
-                        FishingGameDecor(
-                            fishingGameConfig.configValue.safeToInt() == 1,
-                            fishingGameConfig.url
-                        )
-                    }
-                }
-
-                DecorType.TEEN_PATTI -> {
+                DecorType.TEEN_PATTI_GAME -> {
                     TeenPattiDecor(config.safeToInt() == 1)
                 }
 

+ 14 - 18
module/room/src/main/java/com/adealink/weparty/room/game/GameComp.kt

@@ -4,8 +4,6 @@ import android.content.Intent
 import android.os.Bundle
 import android.view.View
 import androidx.lifecycle.LifecycleOwner
-import com.adealink.frame.aab.util.getCompatString
-import com.adealink.frame.base.Rlt
 import com.adealink.frame.base.fastLazy
 import com.adealink.frame.guide.GuideCenter
 import com.adealink.frame.guide.core.GuideLabel
@@ -47,8 +45,6 @@ import com.adealink.weparty.room.guide.data.RoomGuideType
 import com.adealink.weparty.url.H5Page
 import com.adealink.weparty.url.urlConfigService
 import com.adealink.weparty.util.goLocalLinkPage
-import com.facebook.common.util.UriUtil
-import com.adealink.weparty.R as APP_R
 
 class GameComp(
     lifecycleOwner: LifecycleOwner,
@@ -169,7 +165,7 @@ class GameComp(
         WebViewDialogFragmentBuilder()
             .height(1340 * DisplayUtil.getScreenWidth() / 750)
             .loadingUrl(slotProShowConfig?.loadingUrl)
-            .offlineGameInfo(OfflineH5GameInfo(slotProShowConfig?.url, DecorType.SLOT_PRO.value))
+            .offlineGameInfo(OfflineH5GameInfo(slotProShowConfig?.url, DecorType.JACKPOT_SLOT_GAME.value))
             .build()
             ?.showUrl(activity.supportFragmentManager, "")
     }
@@ -179,7 +175,7 @@ class GameComp(
         WebViewDialogFragmentBuilder()
             .height(761 * DisplayUtil.getScreenWidth() / 750)
             .loadingUrl(greedyBoxShowConfig?.loadingUrl)
-            .offlineGameInfo(OfflineH5GameInfo(greedyBoxShowConfig?.offlineUrl, DecorType.GREEDY_BOX.value))
+            .offlineGameInfo(OfflineH5GameInfo(greedyBoxShowConfig?.offlineUrl, DecorType.GREEDY_BOX_GAME.value))
             .build()
             ?.showUrl(activity.supportFragmentManager, "")
     }
@@ -257,18 +253,18 @@ class GameComp(
 //        }
 //        gameViewModel?.isGameShow(
 //            listOf(
-//                DecorType.GREEDY_PRO.value,
-//                DecorType.GREEDY_BOX.value,
+//                DecorType.GREEDY_PRO_GAME.value,
+//                DecorType.GREEDY_BOX_GAME.value,
 //                DecorType.GAME_TAB_SWITCH.value,
-//                DecorType.LUCKY_PRO.value,
-//                DecorType.SLOT_PRO.value,
+//                DecorType.LUCKY_PRO_GAME.value,
+//                DecorType.JACKPOT_SLOT.value,
 //            )
 //        )?.observe(viewLifecycleOwner) {
-//            val greedyProShow = it[DecorType.GREEDY_PRO.value]?.show == true
+//            val greedyProShow = it[DecorType.GREEDY_PRO_GAME.value]?.show == true
 //            val luckyGameLevelShow = it[DecorType.GAME_TAB_SWITCH.value]?.show == true
-//            val showLuckyProGame = it[DecorType.LUCKY_PRO.value]?.show == true
-//            greedyBoxShowConfig = it[DecorType.GREEDY_BOX.value]
-//            slotProShowConfig = it[DecorType.SLOT_PRO.value]
+//            val showLuckyProGame = it[DecorType.LUCKY_PRO_GAME.value]?.show == true
+//            greedyBoxShowConfig = it[DecorType.GREEDY_BOX_GAME.value]
+//            slotProShowConfig = it[DecorType.JACKPOT_SLOT.value]
 //
 //            if (greedyProShow) {
 //                addEntrance(
@@ -278,7 +274,7 @@ class GameComp(
 //                    )
 //                )
 //            } else {
-//                removeEntrance(GameEntranceType.GREEDY_PRO)
+//                removeEntrance(GameEntranceType.GREEDY_PRO_GAME)
 //            }
 //
 //            if (greedyBoxShowConfig?.show == true) {
@@ -289,7 +285,7 @@ class GameComp(
 //                    )
 //                )
 //            } else {
-//                removeEntrance(GameEntranceType.GREEDY_BOX)
+//                removeEntrance(GameEntranceType.GREEDY_BOX_GAME)
 //            }
 //
 //            if (slotProShowConfig?.show == true) {
@@ -300,7 +296,7 @@ class GameComp(
 //                    )
 //                )
 //            } else {
-//                removeEntrance(GameEntranceType.SLOT_PRO)
+//                removeEntrance(GameEntranceType.JACKPOT_SLOT)
 //            }
 //
 ////            if (luckyGameLevelShow) {
@@ -321,7 +317,7 @@ class GameComp(
 //                    )
 //                )
 //            } else {
-//                removeEntrance(GameEntranceType.LUCKY_PRO)
+//                removeEntrance(GameEntranceType.LUCKY_PRO_GAME)
 //            }
 //        }
     }

+ 15 - 24
module/room/src/main/java/com/adealink/weparty/room/game/RoomGameCenterPanelFragment.kt

@@ -226,42 +226,33 @@ class RoomGameCenterPanelFragment : BottomDialogFragment(R.layout.fragment_room_
 
     override fun onEntranceClick(data: RoomPlayCenterEntrance) {
         when (data.type) {
-            RoomPlayCenterType.FISHING -> {
-                val jumpUrl = data.url ?: return
-                goBSWebView(jumpUrl)
-            }
-
             RoomPlayCenterType.TEEN_PATTI -> {
                 goTeenPatti(data.loadingUrl, data.offlineUrl)
             }
 
-            RoomPlayCenterType.PYRAMID_SLOTS -> {
-                goPyramidSlots(data)
-            }
-
-            RoomPlayCenterType.FRUIT_MACHINE -> {
-                goFruitMachine()
+            RoomPlayCenterType.LUCKY_FRUIT -> {
+                goLuckyFruit()
             }
 
-            RoomPlayCenterType.FRUIT_MACHINE_NEW -> {
-                goFruitMachineNew()
+            RoomPlayCenterType.GREEDY_PRO -> {
+                goGreedyPro()
             }
 
-            RoomPlayCenterType.TIGER_MACHINE -> {
+            RoomPlayCenterType.JACKPOT -> {
                 goTigerMachine()
             }
 
             //旧版水果机
             RoomPlayCenterType.LUCKY_PRO -> {
-                goOldFruitMachine()
+                goLuckyPro()
             }
 
             RoomPlayCenterType.GREEDY_BOX -> {
                 goGreedyBox(data.loadingUrl, data.offlineUrl)
             }
 
-            RoomPlayCenterType.SLOT_PRO -> {
-                goSlotPro(data.loadingUrl, data.url)
+            RoomPlayCenterType.JACKPOT_SLOT -> {
+                goJackpotSlot(data.loadingUrl, data.url)
             }
             else -> {}
         }
@@ -321,18 +312,18 @@ class RoomGameCenterPanelFragment : BottomDialogFragment(R.layout.fragment_room_
         WebViewDialogFragmentBuilder()
             .height(761 * DisplayUtil.getScreenWidth() / 750)
             .loadingUrl(loadingUrl)
-            .offlineGameInfo(OfflineH5GameInfo(url, DecorType.GREEDY_BOX.value))
+            .offlineGameInfo(OfflineH5GameInfo(url, DecorType.GREEDY_BOX_GAME.value))
             .build()
             ?.showUrl(parentFragmentManager, "")
 
         dismiss()
     }
 
-    private fun goSlotPro(loadingUrl: String?, url: String?) {
+    private fun goJackpotSlot(loadingUrl: String?, url: String?) {
         WebViewDialogFragmentBuilder()
             .height(1340 * DisplayUtil.getScreenWidth() / 750)
             .loadingUrl(loadingUrl)
-            .offlineGameInfo(OfflineH5GameInfo(url, DecorType.SLOT_PRO.value))
+            .offlineGameInfo(OfflineH5GameInfo(url, DecorType.JACKPOT_SLOT_GAME.value))
             .build()
             ?.showUrl(parentFragmentManager, "")
 
@@ -343,12 +334,12 @@ class RoomGameCenterPanelFragment : BottomDialogFragment(R.layout.fragment_room_
         WebViewDialogFragmentBuilder()
             .height(1340 * DisplayUtil.getScreenWidth() / 750)
             .loadingUrl(loadingUrl)
-            .offlineGameInfo(OfflineH5GameInfo(offlineUrl, DecorType.TEEN_PATTI.value))
+            .offlineGameInfo(OfflineH5GameInfo(offlineUrl, DecorType.TEEN_PATTI_GAME.value))
             .build()
             ?.showUrl(parentFragmentManager, urlConfigService.getH5Url(H5Page.TEEN_PATTI))
     }
 
-    private fun goFruitMachine() {
+    private fun goLuckyFruit() {
         WebViewDialogFragmentBuilder()
             .height(1203 * DisplayUtil.getScreenWidth() / 750)
             .build()
@@ -356,7 +347,7 @@ class RoomGameCenterPanelFragment : BottomDialogFragment(R.layout.fragment_room_
         dismiss()
     }
 
-    private fun goOldFruitMachine() {
+    private fun goLuckyPro() {
         WebViewDialogFragmentBuilder()
             .height(1203 * DisplayUtil.getScreenWidth() / 750)
             .build()
@@ -364,7 +355,7 @@ class RoomGameCenterPanelFragment : BottomDialogFragment(R.layout.fragment_room_
         dismiss()
     }
 
-    private fun goFruitMachineNew() {
+    private fun goGreedyPro() {
         WebViewDialogFragmentBuilder()
             .height(1178 * DisplayUtil.getScreenWidth() / 750)
             .build()

+ 4 - 4
module/room/src/main/java/com/adealink/weparty/room/micseat/globalbroadcast/data/RoomGlobalBroadcastData.kt

@@ -45,13 +45,13 @@ enum class RoomGlobalBroadcastEnum(val id: Int, val textRes: Int) {
 //    LEVEL2_ROCKET(5, R.string.room_level2_global_broadcast),
 //    LEVEL1_TREASURE(6, R.string.room_level1_treasure_global_broadcast),
 //    LEVEL2_TREASURE(7, R.string.room_level2_treasure_global_broadcast),
-//    TEEN_PATTI(8, R.string.room_teen_patti_global_broadcast),
+//    TEEN_PATTI_GAME(8, R.string.room_teen_patti_global_broadcast),
     VEHICLE_EFFECT(9, R.string.room_vehicle_effect_broadcast);
 //    GreedyPro(10, R.string.room_greedy_pro_global_broadcast),
 //    NEW_SLOT(11, R.string.room_slot_new_global_broadcast),
-//    LUCKY_PRO(12, R.string.room_lucky_pro_global_broadcast),
-    //SLOT_PRO(14, R.string.room_slot_pro_global_broadcast),
-//    GREEDY_BOX(13, R.string.room_greedy_box_global_broadcast);
+//    LUCKY_PRO_GAME(12, R.string.room_lucky_pro_global_broadcast),
+    //JACKPOT_SLOT(14, R.string.room_slot_pro_global_broadcast),
+//    GREEDY_BOX_GAME(13, R.string.room_greedy_box_global_broadcast);
 
     companion object {
         fun get(id: Int): RoomGlobalBroadcastEnum? {

+ 8 - 8
module/room/src/main/java/com/adealink/weparty/room/micseat/globalbroadcast/viewmodel/RoomGlobalBroadcastViewModel.kt

@@ -46,11 +46,11 @@ class RoomGlobalBroadcastViewModel : BaseViewModel() {
 //            RoomGlobalBroadcastEnum.LEVEL1_TREASURE -> roomGlobalBroadcastData.level1Treasure
 //            RoomGlobalBroadcastEnum.LEVEL2_TREASURE -> roomGlobalBroadcastData.level2Treasure
             RoomGlobalBroadcastEnum.VEHICLE_EFFECT -> roomGlobalBroadcastData.vehicleEffect
-//            RoomGlobalBroadcastEnum.TEEN_PATTI -> roomGlobalBroadcastData.teenPattiBroadcast
+//            RoomGlobalBroadcastEnum.TEEN_PATTI_GAME -> roomGlobalBroadcastData.teenPattiBroadcast
 //            RoomGlobalBroadcastEnum.GreedyPro -> roomGlobalBroadcastData.greedyProBroadcast
-//            RoomGlobalBroadcastEnum.LUCKY_PRO -> roomGlobalBroadcastData.luckyProBroadcast
-            //RoomGlobalBroadcastEnum.SLOT_PRO -> roomGlobalBroadcastData.slotProBroadcast
-//            RoomGlobalBroadcastEnum.GREEDY_BOX -> roomGlobalBroadcastData.greedyBoxBroadcast
+//            RoomGlobalBroadcastEnum.LUCKY_PRO_GAME -> roomGlobalBroadcastData.luckyProBroadcast
+            //RoomGlobalBroadcastEnum.JACKPOT_SLOT -> roomGlobalBroadcastData.slotProBroadcast
+//            RoomGlobalBroadcastEnum.GREEDY_BOX_GAME -> roomGlobalBroadcastData.greedyBoxBroadcast
         }
     }
 
@@ -66,11 +66,11 @@ class RoomGlobalBroadcastViewModel : BaseViewModel() {
 //            RoomGlobalBroadcastEnum.LEVEL1_TREASURE -> roomGlobalBroadcastData.level1Treasure = enabled
 //            RoomGlobalBroadcastEnum.LEVEL2_TREASURE -> roomGlobalBroadcastData.level2Treasure = enabled
             RoomGlobalBroadcastEnum.VEHICLE_EFFECT -> roomGlobalBroadcastData.vehicleEffect = enabled
-//            RoomGlobalBroadcastEnum.TEEN_PATTI -> roomGlobalBroadcastData.teenPattiBroadcast = enabled
+//            RoomGlobalBroadcastEnum.TEEN_PATTI_GAME -> roomGlobalBroadcastData.teenPattiBroadcast = enabled
 //            RoomGlobalBroadcastEnum.GreedyPro -> roomGlobalBroadcastData.greedyProBroadcast = enabled
-//            RoomGlobalBroadcastEnum.LUCKY_PRO -> roomGlobalBroadcastData.luckyProBroadcast = enabled
-            //RoomGlobalBroadcastEnum.SLOT_PRO -> roomGlobalBroadcastData.slotProBroadcast = enabled
-//            RoomGlobalBroadcastEnum.GREEDY_BOX -> roomGlobalBroadcastData.greedyBoxBroadcast = enabled
+//            RoomGlobalBroadcastEnum.LUCKY_PRO_GAME -> roomGlobalBroadcastData.luckyProBroadcast = enabled
+            //RoomGlobalBroadcastEnum.JACKPOT_SLOT -> roomGlobalBroadcastData.slotProBroadcast = enabled
+//            RoomGlobalBroadcastEnum.GREEDY_BOX_GAME -> roomGlobalBroadcastData.greedyBoxBroadcast = enabled
         }
         roomGlobalBroadcastManager.saveRoomGlobalBroadcastData()
 

+ 119 - 58
module/room/src/main/java/com/adealink/weparty/room/playcenter/RoomPlayCenterPanelFragment.kt

@@ -5,6 +5,7 @@ import android.view.LayoutInflater
 import android.widget.LinearLayout
 import androidx.fragment.app.activityViewModels
 import androidx.fragment.app.viewModels
+import androidx.lifecycle.lifecycleScope
 import androidx.recyclerview.widget.GridLayoutManager
 import androidx.recyclerview.widget.RecyclerView
 import com.adealink.frame.aab.util.getCompatDimension
@@ -12,6 +13,9 @@ import com.adealink.frame.aab.util.getCompatString
 import com.adealink.frame.base.CommonSwitchStateSameError
 import com.adealink.frame.base.Rlt
 import com.adealink.frame.base.fastLazy
+import com.adealink.frame.data.json.froJsonErrorNull
+import com.adealink.frame.game.TAG_GAME
+import com.adealink.frame.log.Log
 import com.adealink.frame.mvvm.view.viewBinding
 import com.adealink.frame.room.data.RoomMicSeatMuteError
 import com.adealink.frame.router.Router
@@ -23,9 +27,14 @@ import com.adealink.weparty.commonui.recycleview.adapter.MultiTypeListAdapter
 import com.adealink.weparty.commonui.recycleview.diffutil.BaseListDiffUtil
 import com.adealink.weparty.commonui.toast.util.showToast
 import com.adealink.weparty.commonui.widget.BottomDialogFragment
+import com.adealink.weparty.config.GameVersionConfig
+import com.adealink.weparty.config.GlobalConfigType
+import com.adealink.weparty.config.globalConfigManager
 import com.adealink.weparty.module.backpack.Backpack
 import com.adealink.weparty.module.game.Game
 import com.adealink.weparty.module.game.data.GameActivityRewardInfo.Companion.STATUS_RECEIVED
+import com.adealink.weparty.module.game.data.GameAppVersionOldCanPlayGameError
+import com.adealink.weparty.module.game.data.GameVersionNotMatchError
 import com.adealink.weparty.module.music.Music
 import com.adealink.weparty.module.music.MusicModule
 import com.adealink.weparty.module.operation.OperationModule
@@ -82,6 +91,7 @@ import com.adealink.weparty.room.viewmodel.RoomViewModelFactory
 import com.adealink.weparty.url.H5Page
 import com.adealink.weparty.url.urlConfigService
 import com.adealink.weparty.util.goLocalLinkPage
+import kotlinx.coroutines.launch
 
 class RoomPlayCenterPanelFragment : BottomDialogFragment(R.layout.fragment_room_play_center_panel),
     IPlayCenterEntranceListener, IRoomActivityToolEntranceListener, IOperatorClickListener {
@@ -215,23 +225,6 @@ class RoomPlayCenterPanelFragment : BottomDialogFragment(R.layout.fragment_room_
             val roomId = roomService.joinController.getJoinedRoomId() ?: return@observe
             playCenterViewModel.getPlayCenterData(roomId)
         }
-//        deviceViewModel.userMicMuteChangedLD.observe(viewLifecycleOwner) { mute ->
-//            updateMicIcon(mute = mute)
-//            deviceViewModel.reportRoomMicStatus()
-//        }
-//        deviceViewModel.audioPlayerMuteChangedLD.observe(viewLifecycleOwner) { mute ->
-//            updateSpeakerIcon(mute)
-//        }
-//        seatViewModel.selfMicSeatChangedLD.observe(viewLifecycleOwner) {
-//            updateMicIcon(show = it != null)
-//        }
-//        playCenterViewModel.showGlobalBroadcast.observe(viewLifecycleOwner) {
-//            if (it) {
-//                binding.clGlobalBroadCast.show()
-//            } else {
-//                binding.clGlobalBroadCast.gone()
-//            }
-//        }
     }
 
     override fun onEntranceClick(data: RoomPlayCenterEntrance) {
@@ -241,10 +234,6 @@ class RoomPlayCenterPanelFragment : BottomDialogFragment(R.layout.fragment_room_
                 gotoStore()
             }
 
-//            RoomPlayCenterType.LOVE_STORE -> {
-//                gotoLoveStore()
-//            }
-
             RoomPlayCenterType.BACKPACK -> {
                 gotoBackpack()
             }
@@ -265,49 +254,50 @@ class RoomPlayCenterPanelFragment : BottomDialogFragment(R.layout.fragment_room_
                 showMicCharmPKFragment()
             }
 
-//            RoomPlayCenterType.SUPER_GIFT -> {
-//                goSuperGiftPage()
-//            }
-
             RoomPlayCenterType.MUSIC -> {
                 showMusicSettingDialog()
             }
 
-//            RoomPlayCenterType.WEDDING_PRIVILEGE -> {
-//                showWeddingPrivilegeWeb()
-//            }
-
-            RoomPlayCenterType.FISHING -> {
-                val jumpUrl = data.url ?: return
-                goBSWebView(jumpUrl)
-            }
-
             RoomPlayCenterType.TEEN_PATTI -> {
-                goTeenPatti(data.loadingUrl, data.offlineUrl)
+                goGamePage(GlobalConfigType.GLOBAL_TEENPATTI_VERSION_INFO) {
+                    dismiss()
+                }
             }
 
-            RoomPlayCenterType.SLOT_PRO -> {
-                goSlotPro(data.loadingUrl, data.url)
+            RoomPlayCenterType.JACKPOT_SLOT -> {
+                goGamePage(GlobalConfigType.GLOBAL_JACKPOT_SLOT_VERSION_INFO) {
+                    dismiss()
+                }
             }
 
             RoomPlayCenterType.GREEDY_BOX -> {
-                goGreedyBox(data.loadingUrl, data.offlineUrl)
+                goGamePage(GlobalConfigType.GLOBAL_GREEDYBOX_VERSION_INFO) {
+                    dismiss()
+                }
             }
 
-            RoomPlayCenterType.PYRAMID_SLOTS -> {
-                goPyramidSlots(data)
-            }
+//            RoomPlayCenterType.TEXAS_COWBOY-> {
+//                val first = globalConfigManager.getConfig(GlobalConfigType.GLOBAL_TEXAS_COWBOY_VERSION_INFO)?.firstOrNull()?:return
+//                val config = froJsonErrorNull<GameVersionConfig>(first)
+//                goTexasCowboy(data.loadingUrl, config?.resourceUrl)
+//            }
+
+//            RoomPlayCenterType.RUSSIAN_TURNTABLE -> {
+//                val first = globalConfigManager.getConfig(GlobalConfigType.GLOBAL_RUSSIAN_TURNTABLE_VERSION_INFO)?.firstOrNull()?:return
+//                val config = froJsonErrorNull<GameVersionConfig>(first)
+//                goRussianRoulette(data.loadingUrl, config?.resourceUrl)
+//            }
 
-            RoomPlayCenterType.FRUIT_MACHINE -> {
-                goFruitMachine()
+            RoomPlayCenterType.LUCKY_FRUIT -> {
+                goLuckyFruit()
             }
 
-            RoomPlayCenterType.FRUIT_MACHINE_NEW -> {
-                goFruitMachineNew()
+            RoomPlayCenterType.GREEDY_PRO -> {
+                goGreedyPro()
             }
 
-            RoomPlayCenterType.TIGER_MACHINE -> {
-                goTigerMachine()
+            RoomPlayCenterType.JACKPOT -> {
+                goJackpot()
             }
 
             //活动工具
@@ -322,7 +312,7 @@ class RoomPlayCenterPanelFragment : BottomDialogFragment(R.layout.fragment_room_
 
             //旧版水果机
             RoomPlayCenterType.LUCKY_PRO -> {
-                goOldFruitMachine()
+                goLuckyPro()
             }
 
             else -> {}
@@ -521,51 +511,72 @@ class RoomPlayCenterPanelFragment : BottomDialogFragment(R.layout.fragment_room_
         }
     }
 
-    private fun goTeenPatti(loadingUrl: String?, offlineUrl: String?) {
+    private fun goTeenPatti(offlineUrl: String?, needDownload: Boolean, loadingUrl: String? = "") {
         WebViewDialogFragmentBuilder()
             .height(1340 * DisplayUtil.getScreenWidth() / 750)
             .loadingUrl(loadingUrl)
-            .offlineGameInfo(OfflineH5GameInfo(offlineUrl, DecorType.TEEN_PATTI.value))
+            .offlineGameInfo(OfflineH5GameInfo(offlineUrl, DecorType.TEEN_PATTI_GAME.value, needDownload))
             .build()
             ?.showUrl(parentFragmentManager, urlConfigService.getH5Url(H5Page.TEEN_PATTI))
     }
 
-    private fun goSlotPro(loadingUrl: String?, url: String?) {
+    private fun goJackpotSlot(offlineUrl: String?, needDownload: Boolean, loadingUrl: String? = "") {
         WebViewDialogFragmentBuilder()
             .height(1340 * DisplayUtil.getScreenWidth() / 750)
             .loadingUrl(loadingUrl)
-            .offlineGameInfo(OfflineH5GameInfo(url, DecorType.SLOT_PRO.value))
+            .offlineGameInfo(OfflineH5GameInfo(offlineUrl, DecorType.JACKPOT_SLOT_GAME.value, needDownload))
             .build()
             ?.showUrl(parentFragmentManager, "")
     }
 
-    private fun goGreedyBox(loadingUrl: String?, url: String?) {
+    private fun goTexasCowboy(offlineUrl: String?, needDownload: Boolean, loadingUrl: String? = "") {
+        WebViewDialogFragmentBuilder()
+            .height(1326 * DisplayUtil.getScreenWidth() / 750)
+            .loadingUrl(loadingUrl)
+            .offlineGameInfo(OfflineH5GameInfo(offlineUrl, DecorType.TEXAS_GAME.value, needDownload))
+            .build()
+            ?.showUrl(parentFragmentManager, "")
+
+        dismiss()
+    }
+
+    private fun goRussianRoulette(offlineUrl: String?, needDownload: Boolean, loadingUrl: String? = "") {
+        WebViewDialogFragmentBuilder()
+            .height(1123 * DisplayUtil.getScreenWidth() / 750)
+            .loadingUrl(loadingUrl)
+            .offlineGameInfo(OfflineH5GameInfo(offlineUrl, DecorType.RUSSIAN_TURNTABLE_GAME.value, needDownload))
+            .build()
+            ?.showUrl(parentFragmentManager, "")
+        dismiss()
+    }
+
+    private fun goGreedyBox(offlineUrl: String?, needDownload: Boolean, loadingUrl: String? = "") {
         WebViewDialogFragmentBuilder()
             .height(761 * DisplayUtil.getScreenWidth() / 750)
             .loadingUrl(loadingUrl)
-            .offlineGameInfo(OfflineH5GameInfo(url, DecorType.GREEDY_BOX.value))
+            .offlineGameInfo(OfflineH5GameInfo(offlineUrl, DecorType.GREEDY_BOX_GAME.value, needDownload))
             .build()
             ?.showUrl(parentFragmentManager, "")
 
         dismiss()
     }
 
-    private fun goFruitMachine() {
+    private fun goLuckyFruit() {
         goLocalLinkPage(activity, urlConfigService.getH5Url(H5Page.LUCKY_FRUIT))
         dismiss()
     }
 
-    private fun goOldFruitMachine() {
+    private fun goLuckyPro() {
         goLocalLinkPage(activity, urlConfigService.getH5Url(H5Page.LUCKY_PRO))
         dismiss()
     }
 
-    private fun goFruitMachineNew() {
+    private fun goGreedyPro() {
         goLocalLinkPage(activity, urlConfigService.getH5Url(H5Page.GREEDY_PRO))
         dismiss()
     }
 
-    private fun goTigerMachine() {
+    private fun goJackpot() {
         context?.let {
             Router.build(it, Web.FullScreen.PATH)
                 .putExtra(Web.Common.EXTRA_URL, urlConfigService.getH5Url(H5Page.SLOT))
@@ -715,4 +726,54 @@ class RoomPlayCenterPanelFragment : BottomDialogFragment(R.layout.fragment_room_
         }
     }
 
+    private fun goGamePage(type: GlobalConfigType, callback: (() -> Unit)? = null) {
+        lifecycleScope.launch {
+            when(val rlt = globalConfigManager.checkGameValid(type)) {
+                is Rlt.Success -> {
+                    realGoGamePage(type, true)
+                    callback?.invoke()
+                }
+
+                is Rlt.Failed -> {
+                    Log.e(TAG_GAME, "offline game check, rlt: ${rlt.error.msg}")
+                    when (rlt.error) {
+                        is GameAppVersionOldCanPlayGameError,
+                        is GameVersionNotMatchError -> {
+                            realGoGamePage(type, false)
+                        }
+                    }
+                    callback?.invoke()
+                    showToast(rlt.error.msg)
+                }
+            }
+        }
+    }
+
+    private fun realGoGamePage(type: GlobalConfigType, needDownload: Boolean) {
+        val first = globalConfigManager.getConfig(type)?.firstOrNull()?: return
+        val config = froJsonErrorNull<GameVersionConfig>(first)
+        when(type) {
+            GlobalConfigType.GLOBAL_TEENPATTI_VERSION_INFO -> {
+                goTeenPatti(config?.resourceUrl, needDownload)
+            }
+
+            GlobalConfigType.GLOBAL_GREEDYBOX_VERSION_INFO -> {
+                goGreedyBox(config?.resourceUrl, needDownload)
+            }
+
+            GlobalConfigType.GLOBAL_RUSSIAN_TURNTABLE_VERSION_INFO -> {
+                goRussianRoulette(config?.resourceUrl, needDownload)
+            }
+
+            GlobalConfigType.GLOBAL_TEXAS_COWBOY_VERSION_INFO -> {
+                goTexasCowboy(config?.resourceUrl, needDownload)
+            }
+            GlobalConfigType.GLOBAL_JACKPOT_SLOT_VERSION_INFO -> {
+                goJackpotSlot(config?.resourceUrl, needDownload)
+            }
+            else -> {
+                //ntd.
+            }
+        }
+    }
 }

+ 2 - 2
module/room/src/main/java/com/adealink/weparty/room/playcenter/adapter/RoomPlayCenterEntranceViewBinder.kt

@@ -21,7 +21,7 @@ class RoomPlayCenterEntranceViewBinder(val l: IPlayCenterEntranceListener) :
         holder.update(item)
         holder.binding.root.setOnClickListener {
             l.onEntranceClick(item)
-            if (item.type == RoomPlayCenterType.SLOT_PRO) {
+            if (item.type == RoomPlayCenterType.JACKPOT_SLOT) {
                 RoomLocalService.showSlotProNew = false
                 holder.binding.viewDot.gone()
             }
@@ -49,7 +49,7 @@ class RoomPlayCenterEntranceViewBinder(val l: IPlayCenterEntranceListener) :
 //                        binding.viewDot.show()
 //                    }
 //                }
-                RoomPlayCenterType.SLOT_PRO -> {
+                RoomPlayCenterType.JACKPOT_SLOT -> {
                     if (RoomLocalService.showSlotProNew) {
                         binding.viewDot.show()
                     }

+ 7 - 4
module/room/src/main/java/com/adealink/weparty/room/playcenter/data/RoomPlayCenterData.kt

@@ -29,15 +29,18 @@ enum class RoomPlayCenterType {
     ROOM_SETTINGS,//房间设置
 
     //新旧水果机、老虎机、捕鱼、slot金字塔、teenpatti
-    FRUIT_MACHINE,//水果机
-    FRUIT_MACHINE_NEW,//新水果机
-    TIGER_MACHINE,//老虎机
+    LUCKY_FRUIT,//水果机
+    GREEDY_PRO,//新水果机
+    JACKPOT,//老虎机
     FISHING,//捕鱼
     TEEN_PATTI,
     PYRAMID_SLOTS, //新slots游戏-金字塔
     LUCKY_PRO,//旧水果机
-    SLOT_PRO,//新老虎机
+    JACKPOT_SLOT,//新老虎机
     GREEDY_BOX,
+//    TEXAS_COWBOY,
+//    DRAGON_TIGER_FIGHT,
+//    RUSSIAN_TURNTABLE,
     LUDO,
     LUDO_TEAM,
     CARROM,

+ 112 - 217
module/room/src/main/java/com/adealink/weparty/room/playcenter/manager/PlayCenterManager.kt

@@ -4,7 +4,8 @@ import com.adealink.frame.aab.util.getCompatString
 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.GameShowConfig
+import com.adealink.weparty.module.game.data.ActivityType
+import com.adealink.weparty.module.game.data.CommonActivityRewardInfoReq
 import com.adealink.weparty.module.level.data.LuckyGameLevel
 import com.adealink.weparty.module.music.MusicModule
 import com.adealink.weparty.module.music.data.MusicEntrance
@@ -39,34 +40,27 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
     //房间玩法
     private var showRoulette = false
     private var showPK = false
-    private var showFishing = false
-    private var fishingGameUrl: String? = null
-    private var showPyramidSlots = false
-    private var teenPattiShowConfig: GameShowConfig? = null
-    private var slotProShowConfig: GameShowConfig? = null
-    private var greedyBoxShowConfig: GameShowConfig? = null
+    private var showLuckyGameRank = false
+
     private var showLuckyFruitGame = false
+    private var showLuckyProGame = false
     private var showGreedyPro = false
+    private var showJackpotSlot= false
+    private var showGreedyBox = false
+    private var showTeenPatti = false
+    private var showDragonTigerFight = false
+    private var showRussianTurnTable = false
+    private var showTexasCowboy = false
     private var showJackpotGame = false
-    private var showLuckyGameRank = false
-    private var showLuckyProGame = false
 
     private var playCenterRoomId: Long? = null
     private var lastPullTime = 0L
-    private var pyramidSlotsGameDecor: GameShowConfig? = null
 
     override fun getPlayCenterData(roomId: Long, forceNet: Boolean, firstLoad: Boolean) {
         launch {
             if (firstLoad) {
                 if (roomId != playCenterRoomId) {
-                    showRoulette = false
-                    showPK = false
-                    showFishing = false
-                    showPyramidSlots = false
-                    teenPattiShowConfig = null
-                    slotProShowConfig = null
-                    greedyBoxShowConfig = null
-                    pyramidSlotsGameDecor = null
+                    clear()
                 }
             }
 
@@ -83,16 +77,17 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
                 val reqList = listOf(
                     DecorType.SUPER_WINNER.value,
                     DecorType.ROOM_PK_CONFIG.value,
-                    DecorType.FISHING_GAME.value,
-                    DecorType.TEEN_PATTI.value,
-                    DecorType.PYRAMID_SLOTS.value,
-                    DecorType.LUCKY_FRUIT_GAME.value,
-                    DecorType.LUCKY_FRUIT_GAME_NEW.value,
-                    DecorType.LUCKY_JACKPOT_GAME.value,
                     DecorType.GAME_TAB_SWITCH.value,
-                    DecorType.LUCKY_PRO.value,
-                    DecorType.SLOT_PRO.value,
-                    DecorType.GREEDY_BOX.value,
+                    DecorType.LUCKY_FRUIT_GAME.value,
+                    DecorType.JACKPOT_GAME.value,
+                    DecorType.JACKPOT_SLOT_GAME.value,
+                    DecorType.GREEDY_BOX_GAME.value,
+                    DecorType.TEEN_PATTI_GAME.value,
+                    DecorType.DRAGON_TIGER_FIGHT_GAME.value,
+                    DecorType.RUSSIAN_TURNTABLE_GAME.value,
+                    DecorType.TEXAS_GAME.value,
+                    DecorType.LUCKY_PRO_GAME.value,
+                    DecorType.GREEDY_PRO_GAME.value,
                 )
                 GameModule.isGameShow(reqList)
             }
@@ -102,20 +97,18 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
 
             showRoulette = showGame[DecorType.SUPER_WINNER.value]?.show == true
             showPK = showGame[DecorType.ROOM_PK_CONFIG.value]?.show == true
-            showFishing = showGame[DecorType.FISHING_GAME.value]?.show == true
-            fishingGameUrl = showGame[DecorType.FISHING_GAME.value]?.url
-            showPyramidSlots = showGame[DecorType.PYRAMID_SLOTS.value]?.show == true
-            teenPattiShowConfig = showGame[DecorType.TEEN_PATTI.value]
-            slotProShowConfig = showGame[DecorType.SLOT_PRO.value]
-            greedyBoxShowConfig = showGame[DecorType.GREEDY_BOX.value]
-            if (showGame.isNotEmpty()) {
-                pyramidSlotsGameDecor = showGame[DecorType.PYRAMID_SLOTS.value]
-            }
-            showLuckyFruitGame = showGame[DecorType.LUCKY_FRUIT_GAME.value]?.show == true
-            showGreedyPro = showGame[DecorType.LUCKY_FRUIT_GAME_NEW.value]?.show == true
-            showJackpotGame = showGame[DecorType.LUCKY_JACKPOT_GAME.value]?.show == true
             showLuckyGameRank = showGame[DecorType.GAME_TAB_SWITCH.value]?.show == true
-            showLuckyProGame = showGame[DecorType.LUCKY_PRO.value]?.show == true
+
+            showTeenPatti = showGame[DecorType.TEEN_PATTI_GAME.value]?.show == true
+            showJackpotSlot = showGame[DecorType.JACKPOT_SLOT_GAME.value]?.show == true
+            showGreedyBox = showGame[DecorType.GREEDY_BOX_GAME.value]?.show == true
+            showLuckyFruitGame = showGame[DecorType.LUCKY_FRUIT_GAME.value]?.show == true
+            showGreedyPro = showGame[DecorType.GREEDY_PRO_GAME.value]?.show == true
+            showJackpotGame = showGame[DecorType.JACKPOT_GAME.value]?.show == true
+            showLuckyProGame = showGame[DecorType.LUCKY_PRO_GAME.value]?.show == true
+            showDragonTigerFight = showGame[DecorType.DRAGON_TIGER_FIGHT_GAME.value]?.show == true
+            showRussianTurnTable = showGame[DecorType.RUSSIAN_TURNTABLE_GAME.value]?.show == true
+            showTexasCowboy = showGame[DecorType.TEXAS_GAME.value]?.show == true
 
             playCenterRoomId = roomId
             lastPullTime = System.currentTimeMillis()
@@ -127,35 +120,35 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
         launch {
             val showGameDef = async {
                 val reqList = listOf(
-                    DecorType.FISHING_GAME.value,
-                    DecorType.TEEN_PATTI.value,
-                    DecorType.PYRAMID_SLOTS.value,
-                    DecorType.LUCKY_FRUIT_GAME.value,
-                    DecorType.LUCKY_FRUIT_GAME_NEW.value,
-                    DecorType.LUCKY_JACKPOT_GAME.value,
+                    DecorType.SUPER_WINNER.value,
+                    DecorType.ROOM_PK_CONFIG.value,
                     DecorType.GAME_TAB_SWITCH.value,
-                    DecorType.LUCKY_PRO.value,
-                    DecorType.SLOT_PRO.value,
-                    DecorType.GREEDY_BOX.value,
+                    DecorType.LUCKY_FRUIT_GAME.value,
+                    DecorType.JACKPOT_GAME.value,
+                    DecorType.JACKPOT_SLOT_GAME.value,
+                    DecorType.GREEDY_BOX_GAME.value,
+                    DecorType.TEEN_PATTI_GAME.value,
+                    DecorType.DRAGON_TIGER_FIGHT_GAME.value,
+                    DecorType.RUSSIAN_TURNTABLE_GAME.value,
+                    DecorType.TEXAS_GAME.value,
+                    DecorType.LUCKY_PRO_GAME.value,
+                    DecorType.GREEDY_PRO_GAME.value,
                 )
                 GameModule.isGameShow(reqList)
             }
             val showGame = showGameDef.await()
 
-            showFishing = showGame[DecorType.FISHING_GAME.value]?.show == true
-            fishingGameUrl = showGame[DecorType.FISHING_GAME.value]?.url
-            showPyramidSlots = showGame[DecorType.PYRAMID_SLOTS.value]?.show == true
-            teenPattiShowConfig = showGame[DecorType.TEEN_PATTI.value]
-            slotProShowConfig = showGame[DecorType.SLOT_PRO.value]
-            greedyBoxShowConfig = showGame[DecorType.GREEDY_BOX.value]
-            if (showGame.isNotEmpty()) {
-                pyramidSlotsGameDecor = showGame[DecorType.PYRAMID_SLOTS.value]
-            }
+            showTeenPatti = showGame[DecorType.TEEN_PATTI_GAME.value]?.show == true
+            showJackpotSlot = showGame[DecorType.JACKPOT_SLOT_GAME.value]?.show == true
+            showGreedyBox = showGame[DecorType.GREEDY_BOX_GAME.value]?.show == true
             showLuckyFruitGame = showGame[DecorType.LUCKY_FRUIT_GAME.value]?.show == true
-            showGreedyPro = showGame[DecorType.LUCKY_FRUIT_GAME_NEW.value]?.show == true
-            showJackpotGame = showGame[DecorType.LUCKY_JACKPOT_GAME.value]?.show == true
+            showGreedyPro = showGame[DecorType.GREEDY_PRO_GAME.value]?.show == true
+            showJackpotGame = showGame[DecorType.JACKPOT_GAME.value]?.show == true
             showLuckyGameRank = showGame[DecorType.GAME_TAB_SWITCH.value]?.show == true
-            showLuckyProGame = showGame[DecorType.LUCKY_PRO.value]?.show == true
+            showLuckyProGame = showGame[DecorType.LUCKY_PRO_GAME.value]?.show == true
+            showDragonTigerFight = showGame[DecorType.DRAGON_TIGER_FIGHT_GAME.value]?.show == true
+            showRussianTurnTable = showGame[DecorType.RUSSIAN_TURNTABLE_GAME.value]?.show == true
+            showTexasCowboy = showGame[DecorType.TEXAS_GAME.value]?.show == true
             notifyGameRoomDataList(copyRoomGameDataList())
         }
     }
@@ -164,15 +157,20 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
         playCenterRoomId = null
         showRoulette = false
         showPK = false
-        showFishing = false
-        showPyramidSlots = false
-        teenPattiShowConfig = null
-        slotProShowConfig = null
-        greedyBoxShowConfig = null
+        showLuckyGameRank = false
+
+        showLuckyFruitGame = false
+        showTeenPatti = false
+        showJackpotSlot = false
+        showGreedyBox = false
+        showGreedyPro = false
+        showJackpotGame = false
+        showLuckyProGame = false
+        showDragonTigerFight = false
+        showRussianTurnTable = false
+        showTexasCowboy = false
 
-        playCenterRoomId = null
         lastPullTime = 0L
-        pyramidSlotsGameDecor = null
     }
 
     override fun updateAdminPlayCenterList(roomData: RoomPlayerCenterData, isAdd: Boolean, addRoomDataBefore: RoomPlayerCenterData?) {
@@ -189,12 +187,11 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
             playCenterDataList.add(RoomGameCenterEntrance(RoomPlayCenterType.LUDO_TEAM, Game.LUDO))
             playCenterDataList.add(RoomGameCenterEntrance(RoomPlayCenterType.CARROM, Game.CARROM))
             playCenterDataList.add(RoomGameCenterEntrance(RoomPlayCenterType.UNO, Game.UNO))
-//            playCenterDataList.add(RoomGameCenterEntrance(RoomPlayCenterType.DOMINO, Game.DOMINO))
             val luckyGameList = mutableListOf<RoomPlayerCenterData>()
             val operatorList = mutableListOf<RoomPlayCenterTitleOperator>()
             if (showLuckyGameRank) {
                 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(CommonActivityRewardInfoReq(requestType = ActivityType.TYPE_GAME.type))
                 }
                 val gameLevelInfoAwait = async {
                     GameModule.getUserGameLevelInfo(listOf(ProfileModule.getMyUid()))
@@ -221,72 +218,7 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
                     )
                 )
             }
-
-            if (showLuckyFruitGame) {
-                luckyGameList.add(
-                    RoomPlayCenterEntrance(RoomPlayCenterType.FRUIT_MACHINE, url = urlConfigService.getH5Url(
-                        H5Page.LUCKY_FRUIT))
-                )
-            }
-
-            if (showLuckyProGame) {
-                luckyGameList.add(
-                    RoomPlayCenterEntrance(RoomPlayCenterType.LUCKY_PRO, url = urlConfigService.getH5Url(H5Page.LUCKY_PRO))
-                )
-            }
-
-            if (showGreedyPro) {
-                luckyGameList.add(
-                    RoomPlayCenterEntrance(RoomPlayCenterType.FRUIT_MACHINE_NEW, url = urlConfigService.getH5Url(H5Page.GREEDY_PRO))
-                )
-            }
-//            if (greedyBoxShowConfig?.show == true) {
-//                luckyGameList.add(
-//                    RoomPlayCenterEntrance(
-//                        type = RoomPlayCenterType.GREEDY_BOX,
-//                        loadingUrl = greedyBoxShowConfig?.loadingUrl,
-//                        offlineUrl = greedyBoxShowConfig?.offlineUrl
-//                    )
-//                )
-//            }
-            if (slotProShowConfig?.show == true) {
-                luckyGameList.add(
-                    RoomPlayCenterEntrance(
-                        type = RoomPlayCenterType.SLOT_PRO,
-                        loadingUrl = slotProShowConfig?.loadingUrl,
-                        url = slotProShowConfig?.url
-                    )
-                )
-            }
-            if (showJackpotGame) {
-                luckyGameList.add(
-                    RoomPlayCenterEntrance(RoomPlayCenterType.TIGER_MACHINE, url = urlConfigService.getH5Url(H5Page.JACKPOT))
-                )
-            }
-//            if (teenPattiShowConfig?.show == true) {
-//                luckyGameList.add(
-//                    RoomPlayCenterEntrance(
-//                        RoomPlayCenterType.TEEN_PATTI, loadingUrl = teenPattiShowConfig?.loadingUrl,
-//                        offlineUrl = teenPattiShowConfig?.offlineUrl
-//                    )
-//                )
-//            }
-            if (showPyramidSlots && pyramidSlotsGameDecor?.show == true) {
-                luckyGameList.add(
-                    RoomPlayCenterEntrance(
-                        RoomPlayCenterType.PYRAMID_SLOTS,
-                        url = pyramidSlotsGameDecor?.url
-                    )
-                )
-            }
-//            if (showFishing) {
-//                luckyGameList.add(
-//                    RoomPlayCenterEntrance(
-//                        RoomPlayCenterType.FISHING,
-//                        url = fishingGameUrl
-//                    )
-//                )
-//            }
+            addGameList(luckyGameList)
             if (luckyGameList.isNotEmpty()) {
                 luckyGameList.add(
                     0,
@@ -310,7 +242,6 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
             val storeList = mutableListOf<RoomPlayerCenterData>().also {
                 it.add(RoomPlayCenterTitle(getCompatString(R.string.room_market)))
                 it.add(RoomPlayCenterEntrance(RoomPlayCenterType.STORE))
-                //it.add(RoomPlayCenterEntrance(RoomPlayCenterType.LOVE_STORE))
                 it.add(RoomPlayCenterEntrance(RoomPlayCenterType.BACKPACK))
             }
             //房间玩法
@@ -339,14 +270,9 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
             }
 
             gameCenterList.add(RoomPlayCenterEntrance(RoomPlayCenterType.LUCK_NUMBER))
-//            // 婚礼福利
-//            gameCenterList.add(RoomPlayCenterEntrance(RoomPlayCenterType.WEDDING_PRIVILEGE))
             if (showRoulette) {
                 gameCenterList.add(RoomPlayCenterEntrance(RoomPlayCenterType.ROULETTE))
             }
-//            if (GameModule.isShowSuperGift()) {
-//                gameCenterList.add(RoomPlayCenterEntrance(RoomPlayCenterType.SUPER_GIFT))
-//            }
 
             if (roomType == RoomType.CHAT && MusicModule.showRoomMusicEntrance(MusicEntrance.CHAT_MORE_FUNCTION)) {
                 gameCenterList.add(RoomPlayCenterEntrance(RoomPlayCenterType.MUSIC))
@@ -385,78 +311,7 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
                 )
 
             }
-
-            if (showLuckyFruitGame) {
-                luckyGameList.add(
-                    RoomPlayCenterEntrance(RoomPlayCenterType.FRUIT_MACHINE, url = urlConfigService.getH5Url(H5Page.LUCKY_FRUIT))
-                )
-            }
-
-            if (showLuckyProGame) {
-                luckyGameList.add(
-                    RoomPlayCenterEntrance(RoomPlayCenterType.LUCKY_PRO, url = urlConfigService.getH5Url(H5Page.LUCKY_PRO))
-                )
-            }
-
-            if (showGreedyPro) {
-                luckyGameList.add(
-                    RoomPlayCenterEntrance(RoomPlayCenterType.FRUIT_MACHINE_NEW, url = urlConfigService.getH5Url(H5Page.GREEDY_PRO))
-                )
-            }
-
-//            if (greedyBoxShowConfig?.show == true) {
-//                luckyGameList.add(
-//                    RoomPlayCenterEntrance(
-//                        type = RoomPlayCenterType.GREEDY_BOX,
-//                        loadingUrl = greedyBoxShowConfig?.loadingUrl,
-//                        offlineUrl = greedyBoxShowConfig?.offlineUrl
-//                    )
-//                )
-//            }
-
-            if (slotProShowConfig?.show == true) {
-                luckyGameList.add(
-                    RoomPlayCenterEntrance(
-                        RoomPlayCenterType.SLOT_PRO,
-                        loadingUrl = slotProShowConfig?.loadingUrl,
-                        url = slotProShowConfig?.url
-                    )
-                )
-            }
-
-            if (showJackpotGame) {
-                luckyGameList.add(
-                    RoomPlayCenterEntrance(RoomPlayCenterType.TIGER_MACHINE, url = urlConfigService.getH5Url(H5Page.JACKPOT))
-                )
-            }
-
-//            if (teenPattiShowConfig?.show == true) {
-//                luckyGameList.add(
-//                    RoomPlayCenterEntrance(
-//                        RoomPlayCenterType.TEEN_PATTI, loadingUrl = teenPattiShowConfig?.loadingUrl,
-//                        offlineUrl = teenPattiShowConfig?.offlineUrl
-//                    )
-//                )
-//            }
-
-            if (showPyramidSlots && pyramidSlotsGameDecor?.show == true) {
-                luckyGameList.add(
-                    RoomPlayCenterEntrance(
-                        RoomPlayCenterType.PYRAMID_SLOTS,
-                        url = pyramidSlotsGameDecor?.url
-                    )
-                )
-            }
-
-//            if (showFishing) {
-//                luckyGameList.add(
-//                    RoomPlayCenterEntrance(
-//                        RoomPlayCenterType.FISHING,
-//                        url = fishingGameUrl
-//                    )
-//                )
-//            }
-
+            addGameList(luckyGameList)
             if (luckyGameList.isNotEmpty()) {
                 luckyGameList.add(
                     0,
@@ -467,9 +322,6 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
                 )
             }
 
-
-
-
             //活动工具
             val activityToolList = mutableListOf<RoomPlayerCenterData>().also {
                 it.add(RoomPlayCenterTitle(getCompatString(R.string.room_activity_tool)))
@@ -498,6 +350,49 @@ class PlayCenterManager : BaseFrame<IPlayCenterListener>(), IPlayCenterManager {
     }
 
 
+    private fun addGameList(luckyGameList: MutableList<RoomPlayerCenterData>) {
+        if (showLuckyFruitGame) {
+            luckyGameList.add(
+                RoomPlayCenterEntrance(RoomPlayCenterType.LUCKY_FRUIT, url = urlConfigService.getH5Url(H5Page.LUCKY_FRUIT))
+            )
+        }
+
+        if (showLuckyProGame) {
+            luckyGameList.add(
+                RoomPlayCenterEntrance(RoomPlayCenterType.LUCKY_PRO, url = urlConfigService.getH5Url(H5Page.LUCKY_PRO))
+            )
+        }
+
+        if (showGreedyPro) {
+            luckyGameList.add(
+                RoomPlayCenterEntrance(RoomPlayCenterType.GREEDY_PRO, url = urlConfigService.getH5Url(H5Page.GREEDY_PRO))
+            )
+        }
+
+        if (showGreedyBox) {
+            luckyGameList.add(
+                RoomPlayCenterEntrance(type = RoomPlayCenterType.GREEDY_BOX)
+            )
+        }
+        if (showJackpotSlot) {
+            luckyGameList.add(
+                RoomPlayCenterEntrance(type = RoomPlayCenterType.JACKPOT_SLOT)
+            )
+        }
+
+        if (showJackpotGame) {
+            luckyGameList.add(
+                RoomPlayCenterEntrance(RoomPlayCenterType.JACKPOT, url = urlConfigService.getH5Url(H5Page.JACKPOT))
+            )
+        }
+
+        if (showTeenPatti) {
+            luckyGameList.add(
+                RoomPlayCenterEntrance(RoomPlayCenterType.TEEN_PATTI)
+            )
+        }
+    }
+
     private fun notifyPlayCenterDataList(dataList: List<RoomPlayerCenterData>) {
         dispatch {
             it.onGetPlayCenterData(dataList)

+ 10 - 10
module/room/src/main/java/com/adealink/weparty/room/playcenter/util/PlayCenterUtil.kt

@@ -26,10 +26,10 @@ fun getPlayCenterEntranceNameResId(type: RoomPlayCenterType): Int {
         //房间设置
         RoomPlayCenterType.ROOM_SETTINGS -> R.string.room_setting
         //Lucky Game
-        RoomPlayCenterType.FRUIT_MACHINE -> APP_R.string.common_lucky_fruit
-        RoomPlayCenterType.FRUIT_MACHINE_NEW -> APP_R.string.common_greedy_pro
-        RoomPlayCenterType.TIGER_MACHINE -> APP_R.string.common_jackpot
-        RoomPlayCenterType.SLOT_PRO -> APP_R.string.common_jackpot_slot
+        RoomPlayCenterType.LUCKY_FRUIT -> APP_R.string.common_lucky_fruit
+        RoomPlayCenterType.GREEDY_PRO -> APP_R.string.common_greedy_pro
+        RoomPlayCenterType.JACKPOT -> APP_R.string.common_jackpot
+        RoomPlayCenterType.JACKPOT_SLOT -> APP_R.string.common_jackpot_slot
         RoomPlayCenterType.GREEDY_BOX -> APP_R.string.common_greedy_box
         RoomPlayCenterType.FISHING -> APP_R.string.common_fishing
         RoomPlayCenterType.TEEN_PATTI -> APP_R.string.common_teen_patti
@@ -69,15 +69,15 @@ fun getPlayCenterEntranceImageResId(type: RoomPlayCenterType): Int {
         RoomPlayCenterType.HELP_LIST -> R.drawable.room_play_center_help_list_ic
         RoomPlayCenterType.ROOM_SETTINGS -> R.drawable.room_settings_ic
         //Lucky Game
-        RoomPlayCenterType.FRUIT_MACHINE -> APP_R.drawable.common_fruit_ic
-        RoomPlayCenterType.FRUIT_MACHINE_NEW -> APP_R.drawable.common_greedy_ic
-        RoomPlayCenterType.TIGER_MACHINE -> APP_R.drawable.common_jackpot_ic
-        RoomPlayCenterType.SLOT_PRO -> R.drawable.room_play_center_slot_pro_ic
+        RoomPlayCenterType.LUCKY_FRUIT -> APP_R.drawable.common_lucky_fruit_ic
+        RoomPlayCenterType.GREEDY_PRO -> APP_R.drawable.common_greedy_pro_ic
+        RoomPlayCenterType.JACKPOT -> APP_R.drawable.common_jackpot_ic
+        RoomPlayCenterType.JACKPOT_SLOT -> R.drawable.room_play_center_slot_pro_ic
         RoomPlayCenterType.FISHING -> APP_R.drawable.common_fishing_ic
         RoomPlayCenterType.TEEN_PATTI -> APP_R.drawable.common_teen_patti_ic
         RoomPlayCenterType.PYRAMID_SLOTS -> APP_R.drawable.common_pyramid_slots_ic
-        RoomPlayCenterType.GREEDY_BOX -> R.drawable.room_play_center_greedy_box_ic
-        RoomPlayCenterType.LUCKY_PRO -> APP_R.drawable.common_old_fruit_ic
+        RoomPlayCenterType.GREEDY_BOX -> APP_R.drawable.common_greedy_box_ic
+        RoomPlayCenterType.LUCKY_PRO -> APP_R.drawable.common_lucky_pro_ic
         //房间内游戏
         RoomPlayCenterType.LUDO -> APP_R.drawable.common_ludo_ic
         RoomPlayCenterType.LUDO_TEAM -> APP_R.drawable.common_ludo_team_ic

BIN
module/room/src/main/res/drawable-xhdpi/room_play_center_greedy_box_ic.webp


+ 4 - 3
module/webview/src/main/java/com/adealink/weparty/webview/WebViewDialogFragment.kt

@@ -152,8 +152,8 @@ class WebViewDialogFragment : BottomDialogFragment(R.layout.fragment_webview),
                 binding.root,
                 offlineH5GameInfo.gameType
             )
-            if (offlineH5GameInfo.gameType == DecorType.SLOT_PRO.value
-                || offlineH5GameInfo.gameType == DecorType.GREEDY_BOX.value) {
+            if (offlineH5GameInfo.gameType == DecorType.JACKPOT_SLOT_GAME.value
+                || offlineH5GameInfo.gameType == DecorType.GREEDY_BOX_GAME.value) {
                 binding.webView.changeJSBridge(
                     CocosJSBridgeImpl(
                         binding.webView,
@@ -253,7 +253,8 @@ class WebViewDialogFragment : BottomDialogFragment(R.layout.fragment_webview),
         offlineH5ViewModel.getOfflineH5Url(
             downloadUrl,
             "game-${gameType}",
-            TaskPriority.HIGH
+            TaskPriority.HIGH,
+            offlineH5GameInfo.needDownload
         )
             .observe(viewLifecycleOwner) { pair ->
                 isOfflineH5NeedDownload = pair.second

+ 2 - 0
module/webview/src/main/java/com/adealink/weparty/webview/cocosgame/data/CocosWindowViewData.kt

@@ -1,5 +1,6 @@
 package com.adealink.weparty.webview.cocosgame.data
 
+import com.adealink.frame.base.AppBaseInfo
 import com.adealink.frame.router.Router
 import com.google.gson.annotations.JsonAdapter
 import com.google.gson.annotations.SerializedName
@@ -16,6 +17,7 @@ data class CocosWindowViewData(
     @SerializedName("uid") val uid: Long = 0,
     @SerializedName("room_id") val roomId: Long = 0,
     @SerializedName("scheme_host") val schemeHost: String = Router.getDeepLink(""),
+    @SerializedName("app_name") val appName: String = AppBaseInfo.appName
 )
 
 @JsonAdapter(ExtReflectiveTypeAdapterFactory::class)

+ 1 - 1
module/webview/src/main/java/com/adealink/weparty/webview/cocosgame/viewmodel/BaseCocosWebGameViewModel.kt

@@ -58,7 +58,7 @@ abstract class BaseCocosWebGameViewModel : BaseViewModel(), IBaseCocosWebGameVie
 
     override fun onGetGameView(callback: ICallback<CocosWindowViewData>) {
         Log.d(TAG_COCOS_GAME_WEB_FLOW, "onGetGameView()")
-        if (this.gameType == DecorType.TEEN_PATTI.value) {
+        if (this.gameType == DecorType.TEEN_PATTI_GAME.value) {
             showGameLoading.send(false, postCover = false)
         }
         runOnUiThread {

+ 2 - 2
module/webview/src/main/java/com/adealink/weparty/webview/component/GameLoadingComp.kt

@@ -50,7 +50,7 @@ class GameLoadingComp(
     override fun onCreate() {
         super.onCreate()
         when (gameType) {
-            DecorType.SLOT_PRO.value -> {
+            DecorType.JACKPOT_SLOT_GAME.value -> {
                 binding.bgIv.setImageResource(R.drawable.web_loading_game_bg_slot_pro)
                 binding.gameIv.updateLayoutParams<ConstraintLayout.LayoutParams> {
                     topMargin = 80.dp()
@@ -70,7 +70,7 @@ class GameLoadingComp(
                 binding.progressTv.setTextColor(getCompatColor(R.color.color_D30101))
             }
 
-            DecorType.GREEDY_BOX.value -> {
+            DecorType.GREEDY_BOX_GAME.value -> {
                 binding.bgIv.setImageResource(R.drawable.web_loading_game_bg_greedy_box)
                 binding.gameIv.gone()
                 binding.svgaLoading.show()

+ 18 - 9
module/webview/src/main/java/com/adealink/weparty/webview/game/OfflineH5ViewModel.kt

@@ -17,9 +17,11 @@ import com.adealink.frame.util.createOrExistsDir
 import com.adealink.frame.util.createOrExistsFile
 import com.adealink.frame.util.deleteFiles
 import com.adealink.frame.util.getUrlPath
+import com.adealink.frame.util.isFileExists
 import com.adealink.frame.util.md5
 import com.adealink.frame.util.unzip
 import com.adealink.weparty.App
+import com.adealink.weparty.webview.constant.TAG_WEB_VIEW
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.suspendCancellableCoroutine
 import kotlinx.coroutines.withContext
@@ -38,29 +40,36 @@ class OfflineH5ViewModel : BaseViewModel() {
     fun getOfflineH5Url(
         zipUrl: String,
         targetDirName: String,
-        priority: TaskPriority
+        priority: TaskPriority,
+        needDownload: Boolean
     ): LiveData<Pair<String?, Boolean>> {
         val liveData = OnceMutableLiveData<Pair<String?, Boolean>>()
-        var needDownload = true
+        var mNeedDownload = needDownload
         viewModelScope.launch {
             withContext(Dispatcher.WENEXT_THREAD_POOL) {
                 val targetSaveDir = "${getSaveDir()}$targetDirName${File.separator}"
+                val indexFile = File("$targetSaveDir$INDEX_FILE_NAME")
                 val originUrlPathMd5File = File("$targetSaveDir$URL_PATH_MD5_FILE_NAME")
-                if (originUrlPathMd5File.exists()) {
-                    //旧的版本存在,对比Url path的Md5看是否需要下载
-                    needDownload = needToDownloadZipPkg(originUrlPathMd5File, zipUrl)
-                    if (!needDownload) {
-                        liveData.send(Pair(File("$targetSaveDir$INDEX_FILE_NAME").path, needDownload))
+                Log.i(TAG_WEB_VIEW, "indexFile:${indexFile.path}, exist:${isFileExists(indexFile)}")
+                if (indexFile.exists() && !mNeedDownload) {
+                    //本地存在,直接返回
+                    liveData.send(Pair(File("$targetSaveDir$INDEX_FILE_NAME").path, false))
+                    return@withContext
+                } else if(originUrlPathMd5File.exists()) {
+                    //旧的版本存在,对比Url path的Md5以及旧版本index.html文件是否存在看是否需要下载
+                    mNeedDownload = needToDownloadZipPkg(originUrlPathMd5File, zipUrl) || !indexFile.exists()
+                    if (!mNeedDownload) {
+                        liveData.send(Pair(File("$targetSaveDir$INDEX_FILE_NAME").path, false))
                         return@withContext
                     }
                 }
                 val downloadZipPath = downloadZip(zipUrl, priority)
                 if (!downloadZipPath.isNullOrEmpty()) {
                     val indexFilePath = unzipOfflineH5(zipUrl, downloadZipPath, targetDirName)
-                    liveData.send(Pair(indexFilePath, needDownload))
+                    liveData.send(Pair(indexFilePath, mNeedDownload))
                     return@withContext
                 }
-                liveData.send(Pair(downloadZipPath, needDownload))
+                liveData.send(Pair(downloadZipPath, mNeedDownload))
             }
         }
         return liveData