* UI: improved hand request dialog (users can ask your hand once per game, reset it by re-activate button);

This commit is contained in:
Oleg Agafonov 2019-05-28 13:46:29 +04:00
parent a18c3e1d88
commit 9a9b304fd5
8 changed files with 82 additions and 59 deletions

View file

@ -596,7 +596,9 @@ public class GameController implements GameCallback {
if (gameSession != null) {
UUID requestingPlayerId = getPlayerId(userIdRequester);
if (requestingPlayerId == null || !requestingPlayerId.equals(grantingPlayer.getId())) { // don't allow request for your own cards
if (grantingPlayer.isRequestToShowHandCardsAllowed()) {
if (grantingPlayer.isPlayerAllowedToRequestHand(game.getId(), requestingPlayerId)) {
// one time request per user restrict, enable request will reset users list and allows again
grantingPlayer.addPlayerToRequestedHandList(game.getId(), requestingPlayerId);
gameSession.requestPermissionToSeeHandCards(userIdRequester);
} else {
// player does not allow the request