fixed issue 228

This commit is contained in:
BetaSteward 2011-08-29 13:06:25 -04:00
parent 120468f8ca
commit 7926fc5004
8 changed files with 38 additions and 10 deletions

View file

@ -821,6 +821,14 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
GamePane gamePane = (GamePane) window;
gamePane.hideGame();
}
if (window instanceof DraftPane) {
DraftPane draftPane = (DraftPane) window;
draftPane.hideDraft();
}
if (window instanceof TournamentPane) {
TournamentPane tournamentPane = (TournamentPane) window;
tournamentPane.hideTournament();
}
}
}

View file

@ -24,7 +24,7 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="0" pref="582" max="32767" attributes="0"/>
<Component id="jScrollPane1" alignment="0" pref="586" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>

View file

@ -53,6 +53,10 @@ public class DraftPane extends MagePane {
this.draftPanel1.showDraft(draftId);
}
public void hideDraft() {
draftPanel1.hideDraft();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is

View file

@ -24,7 +24,7 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="tournamentPanel" alignment="0" pref="526" max="32767" attributes="0"/>
<Component id="tournamentPanel" alignment="0" pref="530" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>

View file

@ -54,6 +54,10 @@ public class TournamentPane extends MagePane {
this.repaint();
}
public void hideTournament() {
tournamentPanel.hideTournament();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is

View file

@ -113,6 +113,8 @@ public class TournamentPanel extends javax.swing.JPanel {
}
public void hideTournament() {
stopTasks();
this.chatPanel1.disconnect();
Component c = this.getParent();
while (c != null && !(c instanceof TournamentPane)) {
c = c.getParent();

View file

@ -169,6 +169,14 @@ public class User {
}
private void reconnect() {
for (Entry<UUID, Table> entry: tables.entrySet()) {
joinedTable(entry.getValue().getRoomId(), entry.getValue().getId(), entry.getValue().isTournament());
}
for (Entry<UUID, TournamentSession> entry: tournamentSessions.entrySet()) {
tournamentStarted(entry.getValue().getTournamentId(), entry.getKey());
entry.getValue().init();
entry.getValue().update();
}
for (Entry<UUID, GameSession> entry: gameSessions.entrySet()) {
gameStarted(entry.getValue().getGameId(), entry.getKey());
entry.getValue().init();
@ -179,14 +187,6 @@ public class User {
entry.getValue().init();
entry.getValue().update();
}
for (Entry<UUID, TournamentSession> entry: tournamentSessions.entrySet()) {
tournamentStarted(entry.getValue().getTournamentId(), entry.getKey());
entry.getValue().init();
entry.getValue().update();
}
for (Entry<UUID, Table> entry: tables.entrySet()) {
joinedTable(entry.getValue().getRoomId(), entry.getValue().getId(), entry.getValue().isTournament());
}
}
public void addGame(UUID playerId, GameSession gameSession) {

View file

@ -29,6 +29,7 @@
package mage.game.events;
import java.util.UUID;
import mage.Constants.Zone;
/**
*
@ -43,6 +44,7 @@ public class GameEvent {
protected int amount;
protected boolean flag;
protected String data;
protected Zone zone;
public enum EventType {
@ -182,4 +184,12 @@ public class GameEvent {
public void setData(String data) {
this.data = data;
}
public Zone getZone() {
return zone;
}
public void setZone(Zone zone) {
this.zone = zone;
}
}