Permalink
Browse files

beta 1.2 patchnotes

 * Chat added - it may be a bit tricky to spot it, there is a little text field
 * in a bottom right corner. It is focused by default so you may just start
 * writing and confirm with enter.
 *
 * Tossing a coin and rolling a die has bee implemented. Random values are
 * returned by a server.
 *
 * Table can now be zoomed in and out with a mouse wheel. Cards on table
 * cannot be viewed in original sizes anymore. Zooming the entire table allows
 * you to view cards even larger!
 *
 * A little bit of graphics has been added to the table.
 *
 * No card drag event is longer sent to the server when clicking on a card
 * without moving it. This bug has been introduced in beta 1.1 with a removal
 * of minimum drag distance.
 *
 * A player can now restart a game. It is equivalent to putting all cards
 * a player owns from all zones into a library, shuffling it and drawing
 * seven cards. Tokens are destroyed.
 *
 * Game GUI was not disposed when server was closed unexpectedly.
 * It has been fixed.
 *
 * Deck sent by a player now has to be validated by a server and may be
 * rejected for some reasons, e.g. when there are more than four instances
 * of non-basic land card or there are less than 60 cards in a deck.
 *
 * Players can now create tokens, however no proper interface for destroying
 * them has been implemented - i.e. they will appear options like "take to hand",
 * "exile" or "put onto to of a library", but all of these will destroy a token.
 * Destroyed tokens will not appear in graveyard or exiled. Also tokens can not
 * be enlarged like cards in hand, the only way to do this is zoom a table.
 * This also means that there is no "show" button in the logger when player
 * destroyes a token.
 *
 * When two or more players are searching the same graveyard or exiled, their
 * display is updated correctly when any of them removes a card from this zone.
 *
 * Players can now choose a card at random from their hands.
 *
 * Help added.
 *
 * New decks: Dragon's Roar, Realm of Illusion, Strength of Stone,
 * Unquenchable Fire, Apex Predators
 *
 * Players can now easily untap all their cards on the table.
 *
 * KNOWN BUGS:
 *
 * Cards are shaking while dragging them with maximum zoom.
 *
 * Table is shaking while trying to move outside of it.
  • Loading branch information...
Jarcionek committed Oct 9, 2011
1 parent ee00995 commit 7bf3f4c61138bc033fb9b6922c691388175aade0
Showing with 2,005 additions and 489 deletions.
  1. +2 −2 src/deckCreator/DeckCreator.java
  2. +1 −1 src/deckCreator/ViewableCard.java
  3. +7 −0 src/game/CardViewer.java
  4. +100 −26 src/game/Client.java
  5. +4 −6 src/game/CurrentPlayerLibrary.java
  6. +167 −47 src/game/Game.java
  7. +17 −15 src/game/Logger.java
  8. +18 −22 src/game/OnTableMouseAdapter.java
  9. +8 −12 src/game/PlayerInfo.java
  10. +177 −0 src/game/TCard.java
  11. +260 −80 src/game/Table.java
  12. +6 −4 src/game/TableDragListener.java
  13. +246 −0 src/game/Token.java
  14. +143 −0 src/game/TokenCreator.java
  15. +13 −91 src/mtg/Card.java
  16. +35 −21 src/mtg/Deck.java
  17. +165 −0 src/mtg/Help.java
  18. +10 −0 src/mtg/InvalidDeckException.java
  19. +26 −18 src/mtg/JoinGameFrame.java
  20. +50 −35 src/mtg/Main.java
  21. +166 −8 src/mtg/Resources.java
  22. +19 −8 src/mtg/ServerFrame.java
  23. +2 −38 src/mtg/Settings.java
  24. +40 −0 src/mtg/Utilities.java
  25. BIN src/resources/Table.jpg
  26. BIN src/resources/TableShadow.png
  27. BIN src/resources/cards/Act of Treason.jpg
  28. BIN src/resources/cards/Air Elemental.jpg
  29. BIN src/resources/cards/Assassinate.jpg
  30. BIN src/resources/cards/Assault Strobe.jpg
  31. BIN src/resources/cards/Banefire.jpg
  32. BIN src/resources/cards/Beast Hunt.jpg
  33. BIN src/resources/cards/Blaze.jpg
  34. BIN src/resources/cards/Blind Phantasm.jpg
  35. BIN src/resources/cards/Bloodfire Colossus.jpg
  36. BIN src/resources/cards/Borderland Ranger.jpg
  37. BIN src/resources/cards/Burst Lightning.jpg
  38. BIN src/resources/cards/Cancel.jpg
  39. BIN src/resources/cards/Centaur Courser.jpg
  40. BIN src/resources/cards/Cerebral Eruption.jpg
  41. BIN src/resources/cards/Chandra's Outrage.jpg
  42. BIN src/resources/cards/Chandra's Phoenix.jpg
  43. BIN src/resources/cards/Cinder Wall.jpg
  44. BIN src/resources/cards/Claws of Valakut.jpg
  45. BIN src/resources/cards/Concentrate.jpg
  46. BIN src/resources/cards/Conquering Manticore.jpg
  47. BIN src/resources/cards/Counterspell.jpg
  48. BIN src/resources/cards/Craw Wurm.jpg
  49. BIN src/resources/cards/Crucible of Fire.jpg
  50. BIN src/resources/cards/Cudgel Troll.jpg
  51. BIN src/resources/cards/Darksteel Axe.jpg
  52. BIN src/resources/cards/Disfigure.jpg
  53. BIN src/resources/cards/Disorient.jpg
  54. BIN src/resources/cards/Divination.jpg
  55. BIN src/resources/cards/Dragon Fodder.jpg
  56. BIN src/resources/cards/Dragon's Claw.jpg
  57. BIN src/resources/cards/Dragonmaster Outcast.jpg
  58. BIN src/resources/cards/Dragonspeaker Shaman.jpg
  59. BIN src/resources/cards/Drake Umbra.jpg
  60. BIN src/resources/cards/Dungrove Elder.jpg
  61. BIN src/resources/cards/Earth Elemental.jpg
  62. BIN src/resources/cards/Earth Servant.jpg
  63. BIN src/resources/cards/Elephant Guide.jpg
  64. BIN src/resources/cards/Ember Shot.jpg
  65. BIN src/resources/cards/Engulfing Slagwurm.jpg
  66. BIN src/resources/cards/Evacuation.jpg
  67. BIN src/resources/cards/Fault Line.jpg
  68. BIN src/resources/cards/Festering Goblin.jpg
  69. BIN src/resources/cards/Fiery Hellhound.jpg
  70. BIN src/resources/cards/Fire Elemental.jpg
  71. BIN src/resources/cards/Fire Servant.jpg
  72. BIN src/resources/cards/Flame Slash.jpg
  73. BIN src/resources/cards/Flame Wave.jpg
  74. BIN src/resources/cards/Flameblast Dragon.jpg
  75. BIN src/resources/cards/Flameborn Hellion.jpg
  76. BIN src/resources/cards/Flamekin Brawler.jpg
  77. BIN src/resources/cards/Flametongue Kavu.jpg
  78. BIN src/resources/cards/Fleeting Distraction.jpg
  79. BIN src/resources/cards/Flowstone Overseer.jpg
  80. BIN src/resources/cards/Furnace Whelp.jpg
  81. BIN src/resources/cards/Furyborn Hellkite.jpg
  82. BIN src/resources/cards/Gaea's Revenge.jpg
  83. BIN src/resources/cards/Garruk's Companion.jpg
  84. BIN src/resources/cards/Garruk's Packleader.jpg
  85. BIN src/resources/cards/Giant Growth.jpg
  86. BIN src/resources/cards/Giant Scorpion.jpg
  87. BIN src/resources/cards/Giant Spider.jpg
  88. BIN src/resources/cards/Goblin Arsonist.jpg
  89. BIN src/resources/cards/Goblin Mountaineer.jpg
  90. BIN src/resources/cards/Goblin Offensive.jpg
  91. BIN src/resources/cards/Goblin Piker.jpg
  92. BIN src/resources/cards/Goblin War Paint.jpg
  93. BIN src/resources/cards/Goblin Wardrive.jpg
  94. BIN src/resources/cards/Golden Urn.jpg
  95. BIN src/resources/cards/Gravedigger.jpg
  96. BIN src/resources/cards/Grazing Gladehart.jpg
  97. BIN src/resources/cards/Grim Lavamancer.jpg
  98. BIN src/resources/cards/Hellkite Charger.jpg
  99. BIN src/resources/cards/Hero of Oxid Ridge.jpg
  100. BIN src/resources/cards/Hunted Wumpus.jpg
  101. BIN src/resources/cards/Hunters' Feast.jpg
  102. BIN src/resources/cards/Incinerate.jpg
  103. BIN src/resources/cards/Inferno Titan.jpg
  104. BIN src/resources/cards/Jace's Ingenuity.jpg
  105. BIN src/resources/cards/Kiln Fiend.jpg
  106. BIN src/resources/cards/Koth's Courier.jpg
  107. BIN src/resources/cards/Kraken's Eye.jpg
  108. BIN src/resources/cards/Krovikan Mist.jpg
  109. BIN src/resources/cards/Lava Axe.jpg
  110. BIN src/resources/cards/Lavaborn Muse.jpg
  111. BIN src/resources/cards/Lead the Stampede.jpg
  112. BIN src/resources/cards/Leatherback Baloth.jpg
  113. BIN src/resources/cards/Lord of the Unreal.jpg
  114. BIN src/resources/cards/Magma Phoenix.jpg
  115. BIN src/resources/cards/Mahamoti Djinn.jpg
  116. BIN src/resources/cards/Manic Vandal.jpg
  117. BIN src/resources/cards/Mind Spring.jpg
  118. BIN src/resources/cards/Molten Ravager.jpg
  119. BIN src/resources/cards/Multani, Maro-Sorcerer.jpg
  120. BIN src/resources/cards/Nature's Lore.jpg
  121. BIN src/resources/cards/Overrun.jpg
  122. BIN src/resources/cards/Oxidda Scrapmelter.jpg
  123. BIN src/resources/cards/Phantasmal Bear.jpg
  124. BIN src/resources/cards/Phantasmal Dragon.jpg
  125. BIN src/resources/cards/Phantom Beast.jpg
  126. BIN src/resources/cards/Phantom Warrior.jpg
  127. BIN src/resources/cards/Prodigal Pyromancer.jpg
  128. BIN src/resources/cards/Prosperity.jpg
  129. BIN src/resources/cards/Punishing Fire.jpg
  130. BIN src/resources/cards/Pyroclasm.jpg
  131. BIN src/resources/cards/Quicksilver Geyser.jpg
  132. BIN src/resources/cards/Raging Goblin.jpg
  133. BIN src/resources/cards/Rally the Forces.jpg
  134. BIN src/resources/cards/Relentless Assault.jpg
  135. BIN src/resources/cards/Repulse.jpg
  136. BIN src/resources/cards/Rites of Flourishing.jpg
  137. BIN src/resources/cards/Rockslide Elemental.jpg
  138. BIN src/resources/cards/Rorix Bladewing.jpg
  139. BIN src/resources/cards/Ruby Medallion.jpg
  140. BIN src/resources/cards/Runeclaw Bear.jpg
  141. BIN src/resources/cards/Serrated Arrows.jpg
  142. BIN src/resources/cards/Sizzle.jpg
  143. BIN src/resources/cards/Slavering Nulls.jpg
  144. BIN src/resources/cards/Sower of Temptation.jpg
  145. BIN src/resources/cards/Spikeshot Elder.jpg
  146. BIN src/resources/cards/Spire Barrage.jpg
  147. BIN src/resources/cards/Spitting Earth.jpg
  148. BIN src/resources/cards/Stomper Cub.jpg
  149. BIN src/resources/cards/Summoner's Bane.jpg
  150. BIN src/resources/cards/Tephraderm.jpg
  151. BIN src/resources/cards/Terra Stomper.jpg
  152. BIN src/resources/cards/Thrun, the last Troll.jpg
  153. BIN src/resources/cards/Time Warp.jpg
  154. BIN src/resources/cards/Volcanic Dragon.jpg
  155. BIN src/resources/cards/Volcanic Hammer.jpg
  156. BIN src/resources/cards/Volcanic Strength.jpg
  157. BIN src/resources/cards/Voracious Dragon.jpg
  158. BIN src/resources/cards/Vulshok Berserker.jpg
  159. BIN src/resources/cards/Vulshok Heartstoker.jpg
  160. BIN src/resources/cards/Wall of Air.jpg
  161. BIN src/resources/cards/Wall of Vines.jpg
  162. BIN src/resources/cards/Wheel of Fortune.jpg
  163. BIN src/resources/cards/Wolfbriar Elemental.jpg
  164. BIN src/resources/cards/tokens/Blue.jpg
  165. BIN src/resources/cards/tokens/White.jpg
  166. BIN src/resources/cards/Æther Adept.jpg
  167. BIN src/resources/cards/Æther Figment.jpg
  168. BIN src/resources/decks/Apex Predators.txt
  169. BIN src/resources/decks/Dragon's Roar.txt
  170. BIN src/resources/decks/Realm of Illusion.txt
  171. BIN src/resources/decks/Strength of Stone.txt
  172. BIN src/resources/decks/Unquenchable Fire.txt
  173. +12 −8 src/server/Collection.java
  174. +35 −0 src/server/Game.java
  175. +39 −6 src/server/Server.java
  176. +60 −29 src/server/ServerListeningThread.java
  177. +0 −4 src/server/flags/CheckDeck.java
  178. +49 −0 src/server/flags/CreateToken.java
  179. +4 −0 src/server/flags/Disconnect.java
  180. +2 −2 src/server/flags/DragCard.java
  181. +21 −0 src/server/flags/Message.java
  182. +2 −2 src/server/flags/Player.java
  183. +20 −0 src/server/flags/RandomCard.java
  184. +25 −0 src/server/flags/RandomValue.java
  185. +31 −0 src/server/flags/Restart.java
  186. +2 −2 src/server/flags/Reveal.java
  187. +4 −2 src/server/flags/TapCard.java
  188. +17 −0 src/server/flags/UntapAll.java
@@ -115,7 +115,7 @@ public void actionPerformed(ActionEvent e) {
Deck t = Deck.load(f);
if (t == null) {
JOptionPane.showMessageDialog(DeckCreator.this,
"Deck could not be loaded", "Error",
"Deck could not be loaded", Main.TITLE,
JOptionPane.ERROR_MESSAGE);
} else {
deck = t;
@@ -140,7 +140,7 @@ public void actionPerformed(ActionEvent e) {
+ Utilities.getName(f));
} else {
JOptionPane.showMessageDialog(DeckCreator.this,
"Deck could not be saved", "Error",
"Deck could not be saved", Main.TITLE,
JOptionPane.ERROR_MESSAGE);
}
}
@@ -38,7 +38,7 @@ public ViewableCard(final File image) {
} catch (IOException e) {
Debug.p("ViewableCard error: " + e, Debug.E);
}
this.setIcon(new ImageIcon(Card.resize(img)));
this.setIcon(new ImageIcon(Utilities.resize(img, Card.W, Card.H)));
this.setHorizontalAlignment(SwingConstants.CENTER);
this.addMouseListener(new MouseAdapter() {
@Override
@@ -88,6 +88,10 @@ public void addCard(Card card) {
public void removeCard(Card card) {
cards.remove(card);
}

public void removeAllCards() {
cards.clear();
}

/**
* Repaints the container with the chosen card fully visible.
@@ -183,6 +187,9 @@ public void run() {
}

public static void removeCardFromCurrentlyOpenCardViewer(String cardID) {
if (!mostRecentCardViewer.isShowing()) {
return;
}
Card previous;
for (Card e : mostRecentCardViewer.cards) {
previous = e;
@@ -1,18 +1,18 @@
package game;

//import java.util.logging.Level;
//import java.util.logging.Logger;
import java.awt.Color;
import server.flags.*;
import java.io.File;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.util.logging.Level;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import mtg.Debug;
import mtg.Deck;
import mtg.InvalidDeckException;
import mtg.Main;
import mtg.Utilities;
import mtg.Zone;
@@ -49,7 +49,9 @@ private Client() {}
* not send player's name and deck or could not receive file transfer port
*/
public Client(JFrame parent, String playerName, String ip, int port, Deck deck)
throws IOException {
throws IOException, ClassNotFoundException, InvalidDeckException {
super("Client");

this.s = new Socket(ip, port);
this.serverIP = ip;
this.parentFrame = parent;
@@ -61,10 +63,18 @@ public Client(JFrame parent, String playerName, String ip, int port, Deck deck)
oos.flush();

ois = new ObjectInputStream(s.getInputStream());

try {
this.playerName = (String) ois.readObject();
} catch (ClassNotFoundException ex) {
Debug.p("Client: Error while receiving name from server", Debug.E);
Object obj = ois.readObject();
if (obj.getClass().equals(InvalidDeckException.class)) {
throw (InvalidDeckException) obj;
}
this.playerName = (String) obj;
} catch (ClassNotFoundException | InvalidDeckException ex) {
try {
this.s.close();
} catch (Exception ex1) {}
throw ex;
}
fileTransferPort = ois.readInt();
int players = ois.readInt();
@@ -83,8 +93,14 @@ public void run() {
object = (Action) ois.readObject();
Debug.p("Client: Client received: " + object);

// MESSAGE
if (object.getClass().equals(Message.class)) {
Message m = (Message) object;
g.log(g.getPlayerName(m.requestor) + ":", m.msg,
Logger.C_MESSAGE);

// DRAG
if (object.getClass().equals(DragCard.class)) {
} else if (object.getClass().equals(DragCard.class)) {
DragCard dc = (DragCard) object;
g.log(dc.ID, true, g.getPlayerName(dc.requestor)
+ " drags " + Game.getCardName(dc.ID), game.Logger.C_DRAG);
@@ -126,6 +142,12 @@ public void run() {
+ " to " + p.newValue, game.Logger.C_CHANGE_HP);
}

// UNTAP ALL
} else if (object.getClass().equals(UntapAll.class)) {
g.log("", g.getPlayerName(object.requestor)
+ " untaps all cards he owns", Logger.C_TAP);
g.cardUntapAll(object.requestor);

// SEARCH
} else if (object.getClass().equals(Search.class)) {
Search se = (Search) object;
@@ -189,7 +211,53 @@ public void run() {
+ " reveals top card of his library: "
+ Game.getCardName(r.cardID), game.Logger.C_REVEAL);
}


// CREATE TOKEN
} else if (object.getClass().equals(CreateToken.class)) {
CreateToken ct = (CreateToken) object;
g.log(null, g.getPlayerName(ct.requestor) + " creates "
+ "a token " + ct.name, Logger.C_MOVE_PLAY);
g.createToken(ct);

// RAND
} else if (object.getClass().equals(RandomValue.class)) {
RandomValue rv = (RandomValue) object;
String text = g.getPlayerName(rv.requestor);
if (rv.max == RandomValue.COIN) {
text += " tosses a coin and gets: ";
if (rv.value == 0) {
text += "head";
} else if (rv.value == 1) {
text += "tail";
}
} else if (rv.max == RandomValue.DIE) {
text += " rolls a die and gets: ";
text += (rv.value + 1);
} else {
text += " rolls a " + rv.max + "-sided die and gets: ";
text += (rv.value + 1);
}
g.log(null, true, text, Logger.C_RANDOM);

// RESTART
} else if (object.getClass().equals(Restart.class)) {
Restart r = (Restart) object;
g.log(null, g.getPlayerName(r.requestor) + " starts a game "
+ "again", Logger.C_RESTART);
g.restart(r.requestor, r.deckSize);
if (r.IDs != null) {
g.cardDiscardEntireHand();
for (int i = 0; i < r.IDs.length; i++) {
g.cardAddToHand(r.IDs[i]);
}
}
// RANDOM CARD
} else if (object.getClass().equals(RandomCard.class)) {
RandomCard rc = (RandomCard) object;
g.log(rc.cardID, false, g.getPlayerName(rc.requestor)
+ " choses a card at random from his hand: "
+ Game.getCardName(rc.cardID), Logger.C_REVEAL);

// REQUEST CARD - server requests client to send card's image
} else if (object.getClass().equals(RequestCard.class)) {
RequestCard t = (RequestCard) object;
@@ -231,16 +299,16 @@ public void run() {
Disconnect d = (Disconnect) object;
if (d.requestor == -1) {
JOptionPane.showMessageDialog(parentFrame,
"Server has been closed", "MTG",
"Server has been closed", Main.TITLE,
JOptionPane.ERROR_MESSAGE);
s.close();
g.dispose();
parentFrame.setVisible(true);
return;
}
String text = d.intentional? "has left the game" :
"has lost connection";
g.log(null, false, g.getPlayerName(d.requestor) + " " + text,
String text = d.intentional? " has left the game" :
" has lost connection";
g.log(null, false, g.getPlayerName(d.requestor) + text,
game.Logger.C_DISCONNECT);
g.kill(d.requestor);

@@ -253,12 +321,16 @@ public void run() {
ex.getLocalizedMessage() : "") {
case "Connection reset":
Debug.p("Client: Server closed");
closeClient();
JOptionPane.showMessageDialog(parentFrame,
"Server has been closed unexpectedly", Main.TITLE,
JOptionPane.ERROR_MESSAGE);
g.dispose();
parentFrame.setVisible(true);
case "socket closed":
//it happens when client has been closed
return;
default:
//Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
Debug.p("Client: Error while dealing with " + object + ": " + ex,
Debug.E);
break;
@@ -332,14 +404,20 @@ private void handleMoveCard(MoveCard mc) {
}
break;
case TABLE:
if (mc.cardID.charAt(1) == 'X') { //token
g.log(null, g.getPlayerName(mc.requestor) + " destroyes "
+ owner + " token", Logger.C_MOVE_DESTROY);
g.cardRemoveFromTable(mc.cardID);
break;
}
switch (mc.destination) {
case HAND:
g.changeHandSize(mc.requestor, 1);
g.log(mc.cardID, false, g.getPlayerName(mc.requestor)
+ " returns " + Game.getCardName(mc.cardID)
+ " from table to " + owner + " hand",
game.Logger.C_MOVE_TO_HAND);
if (playerName.equals(g.getPlayerName(mc.requestor))) {
if (playerName.equals(g.getPlayerName(mc.cardID.charAt(0) - 'A'))) {
g.cardAddToHand(mc.cardID);
}
break;
@@ -376,7 +454,7 @@ private void handleMoveCard(MoveCard mc) {
+ " takes " + Game.getCardName(mc.cardID)
+ " from " + owner + " graveyard to his hand",
game.Logger.C_MOVE_PLAY);
if (playerName.equals(g.getPlayerName(mc.requestor))) {
if (playerName.equals(g.getPlayerName(mc.cardID.charAt(0) - 'A'))) {
g.cardAddToHand(mc.cardID);
}
break;
@@ -404,9 +482,7 @@ private void handleMoveCard(MoveCard mc) {
game.Logger.C_MOVE_TO_LIBRARY);
break;
}
if (playerName.equals(g.getPlayerName(mc.requestor))) {
CardViewer.removeCardFromCurrentlyOpenCardViewer(mc.cardID);
}
CardViewer.removeCardFromCurrentlyOpenCardViewer(mc.cardID);
break;
case EXILED:
switch (mc.destination) {
@@ -416,7 +492,7 @@ private void handleMoveCard(MoveCard mc) {
+ " takes " + Game.getCardName(mc.cardID)
+ " from " + owner + " exiled zone to his hand",
game.Logger.C_MOVE_TO_HAND);
if (playerName.equals(g.getPlayerName(mc.requestor))) {
if (playerName.equals(g.getPlayerName(mc.cardID.charAt(0) - 'A'))) {
g.cardAddToHand(mc.cardID);
}
break;
@@ -445,9 +521,7 @@ private void handleMoveCard(MoveCard mc) {
game.Logger.C_MOVE_TO_LIBRARY);
break;
}
if (playerName.equals(g.getPlayerName(mc.requestor))) {
CardViewer.removeCardFromCurrentlyOpenCardViewer(mc.cardID);
}
CardViewer.removeCardFromCurrentlyOpenCardViewer(mc.cardID);
break;
case LIBRARY:
switch (mc.destination) {
@@ -469,7 +543,7 @@ private void handleMoveCard(MoveCard mc) {
+ " from your library to hand",
game.Logger.C_MOVE_TO_HAND);
}
if (playerName.equals(g.getPlayerName(mc.requestor))) {
if (playerName.equals(g.getPlayerName(mc.cardID.charAt(0) - 'A'))) {
g.cardAddToHand(mc.cardID);
}
break;
@@ -513,7 +587,7 @@ private void handleMoveCard(MoveCard mc) {
}
break;
}
if (playerName.equals(g.getPlayerName(mc.requestor))
if (playerName.equals(g.getPlayerName(mc.cardID.charAt(0) - 'A'))
&& mc.destination != Zone.TOP_LIBRARY) {
CardViewer.removeCardFromCurrentlyOpenCardViewer(mc.cardID);
}
@@ -572,7 +646,7 @@ public void send(Action object) {
void closeClient() {
this.interrupt();
try {
send(new Disconnect(-1, true));
send(new Disconnect(true));
s.close();
} catch (IOException ex1) {}
parentFrame.setVisible(true);
@@ -11,6 +11,7 @@
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.border.EtchedBorder;
import mtg.Main;
import mtg.Zone;
import server.flags.MoveCard;
import server.flags.Reveal;
@@ -54,11 +55,8 @@ public void actionPerformed(ActionEvent e) {
Object x = JOptionPane.showInputDialog(
null,
"How many cards from the top\n" +
"of your library you would like to see?",
"Search your library",
JOptionPane.PLAIN_MESSAGE,
null,
null, "all");
"of your library you would like to see?", Main.TITLE,
JOptionPane.PLAIN_MESSAGE, null, null, "all");

if (x == null) {
return;
@@ -83,7 +81,7 @@ public void actionPerformed(ActionEvent e) {
revealTopButton = new JButton("Reveal top");
revealTopButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Game.client.send(new Reveal(Zone.TOP_LIBRARY, -1, null));
Game.client.send(new Reveal(Zone.TOP_LIBRARY, null));
}
});
revealTopButton.setFocusable(false);
Oops, something went wrong.

0 comments on commit 7bf3f4c

Please sign in to comment.