mirror of
https://github.com/correl/mage.git
synced 2024-11-28 19:19:55 +00:00
Some fixes to player handling.
This commit is contained in:
parent
526a93df7e
commit
6420666668
4 changed files with 14 additions and 14 deletions
|
@ -569,9 +569,13 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMenuStates(boolean manaPoolAutomatic, boolean manaPoolAutomaticRestricted) {
|
public void setMenuStates(boolean manaPoolAutomatic, boolean manaPoolAutomaticRestricted) {
|
||||||
|
if (manaPoolMenuItem1 != null) {
|
||||||
manaPoolMenuItem1.setSelected(manaPoolAutomatic);
|
manaPoolMenuItem1.setSelected(manaPoolAutomatic);
|
||||||
|
}
|
||||||
|
if (manaPoolMenuItem2 != null) {
|
||||||
manaPoolMenuItem2.setSelected(manaPoolAutomaticRestricted);
|
manaPoolMenuItem2.setSelected(manaPoolAutomaticRestricted);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private mage.client.game.BattlefieldPanel battlefieldPanel;
|
private mage.client.game.BattlefieldPanel battlefieldPanel;
|
||||||
private javax.swing.JButton btnCheat;
|
private javax.swing.JButton btnCheat;
|
||||||
|
|
|
@ -602,8 +602,8 @@ public class GameController implements GameCallback {
|
||||||
if (grantingPlayer.isHuman()) {
|
if (grantingPlayer.isHuman()) {
|
||||||
GameSessionPlayer gameSession = gameSessions.get(userIdGranter);
|
GameSessionPlayer gameSession = gameSessions.get(userIdGranter);
|
||||||
if (gameSession != null) {
|
if (gameSession != null) {
|
||||||
UUID requestingPlayer = getPlayerId(userIdRequester);
|
UUID requestingPlayerId = getPlayerId(userIdRequester);
|
||||||
if (requestingPlayer == null || !requestingPlayer.equals(grantingPlayer.getId())) { // don't allow request for your own cards
|
if (requestingPlayerId == null || !requestingPlayerId.equals(grantingPlayer.getId())) { // don't allow request for your own cards
|
||||||
if (grantingPlayer.isRequestToShowHandCardsAllowed()) {
|
if (grantingPlayer.isRequestToShowHandCardsAllowed()) {
|
||||||
gameSession.requestPermissionToSeeHandCards(userIdRequester);
|
gameSession.requestPermissionToSeeHandCards(userIdRequester);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -209,7 +209,6 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
protected Set<UUID> playersUnderYourControl = new HashSet<>();
|
protected Set<UUID> playersUnderYourControl = new HashSet<>();
|
||||||
|
|
||||||
protected Set<UUID> usersAllowedToSeeHandCards = new HashSet<>();
|
protected Set<UUID> usersAllowedToSeeHandCards = new HashSet<>();
|
||||||
protected boolean requestsAllowedToSeeHandCards = true;
|
|
||||||
|
|
||||||
protected List<UUID> attachments = new ArrayList<>();
|
protected List<UUID> attachments = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -3113,7 +3112,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isRequestToShowHandCardsAllowed() {
|
public boolean isRequestToShowHandCardsAllowed() {
|
||||||
return userData.allowRequestShowHandCards();
|
return userData.isAllowRequestShowHandCards();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -28,6 +28,7 @@ public class UserData implements Serializable {
|
||||||
this.userSkipPrioritySteps = userSkipPrioritySteps;
|
this.userSkipPrioritySteps = userSkipPrioritySteps;
|
||||||
this.confirmEmptyManaPool = confirmEmptyManaPool;
|
this.confirmEmptyManaPool = confirmEmptyManaPool;
|
||||||
this.flagName = flagName;
|
this.flagName = flagName;
|
||||||
|
this.askMoveToGraveOrder = askMoveToGraveOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGroupId(int groupId) {
|
public void setGroupId(int groupId) {
|
||||||
|
@ -50,20 +51,16 @@ public class UserData implements Serializable {
|
||||||
return showAbilityPickerForced;
|
return showAbilityPickerForced;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAllowRequestShowHandCards() {
|
|
||||||
return allowRequestShowHandCards;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShowAbilityPickerForced(boolean showAbilityPickerForced) {
|
public void setShowAbilityPickerForced(boolean showAbilityPickerForced) {
|
||||||
this.showAbilityPickerForced = showAbilityPickerForced;
|
this.showAbilityPickerForced = showAbilityPickerForced;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAllowRequestShowHandCards(boolean allowRequestShowHandCards) {
|
public boolean isAllowRequestShowHandCards() {
|
||||||
this.allowRequestShowHandCards = allowRequestShowHandCards;
|
return allowRequestShowHandCards;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean allowRequestShowHandCards() {
|
public void setAllowRequestShowHandCards(boolean allowRequestShowHandCards) {
|
||||||
return allowRequestShowHandCards;
|
this.allowRequestShowHandCards = allowRequestShowHandCards;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserSkipPrioritySteps getUserSkipPrioritySteps() {
|
public UserSkipPrioritySteps getUserSkipPrioritySteps() {
|
||||||
|
|
Loading…
Reference in a new issue