fix: 游戏显示异常问题 https://jira.shanqu.cc/browse/GHZSCY-7405
This commit is contained in:
@ -7,9 +7,6 @@ import com.gh.gamecenter.feature.provider.IRegionSettingHelperProvider
|
||||
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class RegionSettingHelperProviderImpl : IRegionSettingHelperProvider {
|
||||
override fun shouldThisGameDisplayMirrorInfo(gameId: String): Boolean {
|
||||
return RegionSettingHelper.shouldThisGameDisplayMirrorInfo(gameId)
|
||||
}
|
||||
|
||||
override fun getMirrorPosition(gameId: String): Int {
|
||||
return RegionSettingHelper.getMirrorPosition(gameId)
|
||||
|
||||
@ -357,6 +357,8 @@ data class GameEntity(
|
||||
|
||||
// 本地字段,使用镜像信息
|
||||
var useMirrorInfo: Boolean = false,
|
||||
// 本地字段,已使用的镜像实体,一旦存在便不再变更
|
||||
var cachedMirrorData: GameEntity? = null,
|
||||
|
||||
// 本地字段,最后打开时间
|
||||
var lastPlayedTime: Long = 0,
|
||||
@ -462,13 +464,17 @@ data class GameEntity(
|
||||
* 获取镜像数据
|
||||
*/
|
||||
fun obtainMirrorData(): GameEntity? {
|
||||
if (cachedMirrorData != null) {
|
||||
return cachedMirrorData
|
||||
}
|
||||
|
||||
val regionSettingProvider = TheRouter.get(IRegionSettingHelperProvider::class.java)
|
||||
|
||||
return when (regionSettingProvider?.getMirrorPosition(_id)) {
|
||||
1 -> mMirrorData
|
||||
2 -> mMirrorData2
|
||||
else -> null
|
||||
}
|
||||
}?.also { cachedMirrorData = it }
|
||||
}
|
||||
|
||||
@IgnoredOnParcel
|
||||
@ -853,7 +859,8 @@ data class GameEntity(
|
||||
} else {
|
||||
val provider = TheRouter.get(IRegionSettingHelperProvider::class.java)
|
||||
useMirrorInfo =
|
||||
(mirrorStatus == "on" || mirrorStatus2 == "on") && provider?.shouldThisGameDisplayMirrorInfo(_id) == true
|
||||
(mirrorStatus == "on" && mMirrorData != null) && provider?.getMirrorPosition(_id) == 1
|
||||
|| (mirrorStatus2 == "on" && mMirrorData2 != null) && provider?.getMirrorPosition(_id) == 2
|
||||
}
|
||||
|
||||
return useMirrorInfo
|
||||
|
||||
@ -6,8 +6,6 @@ import com.gh.gamecenter.feature.entity.IpInfo
|
||||
|
||||
interface IRegionSettingHelperProvider {
|
||||
|
||||
fun shouldThisGameDisplayMirrorInfo(gameId: String): Boolean
|
||||
|
||||
fun getMirrorPosition(gameId: String): Int
|
||||
|
||||
fun shouldThisGameShowSpecialDownload(gameId: String): Boolean
|
||||
|
||||
Reference in New Issue
Block a user