mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 05:09:16 -08:00
Fixed that to allow watchers of a game to see the hand cards of players did not work correctly.
This commit is contained in:
parent
c0db6dfdc8
commit
c65adebc57
14 changed files with 129 additions and 68 deletions
|
|
@ -565,7 +565,6 @@ public interface Player extends MageItem, Copyable<Player> {
|
|||
void addPermissionToShowHandCards(UUID watcherUserId);
|
||||
boolean hasUserPermissionToSeeHand(UUID userId);
|
||||
void revokePermissionToSeeHandCards();
|
||||
void setRequestToShowHandCardsAllowed(boolean requestAllowed);
|
||||
boolean isRequestToShowHandCardsAllowed();
|
||||
Set<UUID> getUsersAllowedToSeeHandCards();
|
||||
|
||||
|
|
|
|||
|
|
@ -306,7 +306,6 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
this.playersUnderYourControl.clear();
|
||||
this.playersUnderYourControl.addAll(player.playersUnderYourControl);
|
||||
this.usersAllowedToSeeHandCards.addAll(player.usersAllowedToSeeHandCards);
|
||||
this.requestsAllowedToSeeHandCards = player.requestsAllowedToSeeHandCards;
|
||||
|
||||
this.isTestMode = player.isTestMode;
|
||||
this.isGameUnderControl = player.isGameUnderControl;
|
||||
|
|
@ -386,7 +385,6 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
this.castSourceIdWithoutMana = player.getCastSourceIdWithoutMana();
|
||||
|
||||
this.usersAllowedToSeeHandCards.addAll(player.getUsersAllowedToSeeHandCards());
|
||||
this.requestsAllowedToSeeHandCards = player.isRequestToShowHandCardsAllowed();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -1864,10 +1862,10 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
passedUntilStackResolved = false;
|
||||
break;
|
||||
case PERMISSION_REQUESTS_ALLOWED_OFF:
|
||||
this.setRequestToShowHandCardsAllowed(false);
|
||||
userData.setAllowRequestShowHandCards(false);
|
||||
break;
|
||||
case PERMISSION_REQUESTS_ALLOWED_ON:
|
||||
this.setRequestToShowHandCardsAllowed(true);
|
||||
userData.setAllowRequestShowHandCards(true);
|
||||
break;
|
||||
}
|
||||
logger.trace("PASS Priority: " + playerAction.toString());
|
||||
|
|
@ -3007,14 +3005,10 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
usersAllowedToSeeHandCards.add(watcherUserId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRequestToShowHandCardsAllowed(boolean requestAllowed) {
|
||||
this.requestsAllowedToSeeHandCards = requestAllowed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRequestToShowHandCardsAllowed() {
|
||||
return requestsAllowedToSeeHandCards;
|
||||
return userData.allowRequestShowHandCards();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@ public class UserData implements Serializable {
|
|||
return showAbilityPickerForced;
|
||||
}
|
||||
|
||||
public boolean isAllowRequestShowHandCards() {
|
||||
return allowRequestShowHandCards;
|
||||
}
|
||||
|
||||
public void setShowAbilityPickerForced(boolean showAbilityPickerForced) {
|
||||
this.showAbilityPickerForced = showAbilityPickerForced;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue