Resolve #12197 - kick/skip turn in mutliplayer only active if the game contains the current player ID

This commit is contained in:
yairm210 2024-09-09 21:45:13 +03:00
parent 327d880b11
commit 6a52382956

View File

@ -399,11 +399,14 @@ class MultiplayerScreen : PickerScreen() {
} else { } else {
val durationInactive = Duration.between(Instant.ofEpochMilli(preview.currentTurnStartTime), Instant.now()) val durationInactive = Duration.between(Instant.ofEpochMilli(preview.currentTurnStartTime), Instant.now())
forceResignButton.isVisible = forceResignButton.isVisible =
preview.getPlayerCiv(game.settings.multiplayer.userId)?.civName == Constants.spectator game.settings.multiplayer.userId in preview.civilizations.map { it.playerId } &&
|| durationInactive > Duration.ofDays(2) preview.getPlayerCiv(game.settings.multiplayer.userId)?.civName == Constants.spectator
|| durationInactive > Duration.ofDays(2)
} }
skipTurnButton.isVisible = preview != null && preview.gameParameters.minutesUntilSkipTurn <= skipTurnButton.isVisible = preview != null
(Duration.between(Instant.ofEpochMilli(preview.currentTurnStartTime), Instant.now()).toMinutes()) && game.settings.multiplayer.userId in preview.civilizations.map { it.playerId }
&& preview.gameParameters.minutesUntilSkipTurn <=
Duration.between(Instant.ofEpochMilli(preview.currentTurnStartTime), Instant.now()).toMinutes()
rightSideButton.enable() rightSideButton.enable()