Some fixes to player handling.

This commit is contained in:
LevelX2 2015-06-14 02:42:56 +02:00
parent 526a93df7e
commit 6420666668
4 changed files with 14 additions and 14 deletions

View file

@ -569,9 +569,13 @@ public class PlayAreaPanel extends javax.swing.JPanel {
}
public void setMenuStates(boolean manaPoolAutomatic, boolean manaPoolAutomaticRestricted) {
if (manaPoolMenuItem1 != null) {
manaPoolMenuItem1.setSelected(manaPoolAutomatic);
}
if (manaPoolMenuItem2 != null) {
manaPoolMenuItem2.setSelected(manaPoolAutomaticRestricted);
}
}
private mage.client.game.BattlefieldPanel battlefieldPanel;
private javax.swing.JButton btnCheat;

View file

@ -602,8 +602,8 @@ public class GameController implements GameCallback {
if (grantingPlayer.isHuman()) {
GameSessionPlayer gameSession = gameSessions.get(userIdGranter);
if (gameSession != null) {
UUID requestingPlayer = getPlayerId(userIdRequester);
if (requestingPlayer == null || !requestingPlayer.equals(grantingPlayer.getId())) { // don't allow request for your own cards
UUID requestingPlayerId = getPlayerId(userIdRequester);
if (requestingPlayerId == null || !requestingPlayerId.equals(grantingPlayer.getId())) { // don't allow request for your own cards
if (grantingPlayer.isRequestToShowHandCardsAllowed()) {
gameSession.requestPermissionToSeeHandCards(userIdRequester);
} else {

View file

@ -209,7 +209,6 @@ public abstract class PlayerImpl implements Player, Serializable {
protected Set<UUID> playersUnderYourControl = new HashSet<>();
protected Set<UUID> usersAllowedToSeeHandCards = new HashSet<>();
protected boolean requestsAllowedToSeeHandCards = true;
protected List<UUID> attachments = new ArrayList<>();
@ -3113,7 +3112,7 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public boolean isRequestToShowHandCardsAllowed() {
return userData.allowRequestShowHandCards();
return userData.isAllowRequestShowHandCards();
}
@Override

View file

@ -28,6 +28,7 @@ public class UserData implements Serializable {
this.userSkipPrioritySteps = userSkipPrioritySteps;
this.confirmEmptyManaPool = confirmEmptyManaPool;
this.flagName = flagName;
this.askMoveToGraveOrder = askMoveToGraveOrder;
}
public void setGroupId(int groupId) {
@ -50,20 +51,16 @@ public class UserData implements Serializable {
return showAbilityPickerForced;
}
public boolean isAllowRequestShowHandCards() {
return allowRequestShowHandCards;
}
public void setShowAbilityPickerForced(boolean showAbilityPickerForced) {
this.showAbilityPickerForced = showAbilityPickerForced;
}
public void setAllowRequestShowHandCards(boolean allowRequestShowHandCards) {
this.allowRequestShowHandCards = allowRequestShowHandCards;
public boolean isAllowRequestShowHandCards() {
return allowRequestShowHandCards;
}
public boolean allowRequestShowHandCards() {
return allowRequestShowHandCards;
public void setAllowRequestShowHandCards(boolean allowRequestShowHandCards) {
this.allowRequestShowHandCards = allowRequestShowHandCards;
}
public UserSkipPrioritySteps getUserSkipPrioritySteps() {