forked from External/mage
* UI: improved hand request dialog (users can ask your hand once per game, reset it by re-activate button);
This commit is contained in:
parent
a18c3e1d88
commit
9a9b304fd5
8 changed files with 82 additions and 59 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue