mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
fixed issue 228
This commit is contained in:
parent
120468f8ca
commit
7926fc5004
8 changed files with 38 additions and 10 deletions
|
@ -821,6 +821,14 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
GamePane gamePane = (GamePane) window;
|
GamePane gamePane = (GamePane) window;
|
||||||
gamePane.hideGame();
|
gamePane.hideGame();
|
||||||
}
|
}
|
||||||
|
if (window instanceof DraftPane) {
|
||||||
|
DraftPane draftPane = (DraftPane) window;
|
||||||
|
draftPane.hideDraft();
|
||||||
|
}
|
||||||
|
if (window instanceof TournamentPane) {
|
||||||
|
TournamentPane tournamentPane = (TournamentPane) window;
|
||||||
|
tournamentPane.hideTournament();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<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>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
|
@ -53,6 +53,10 @@ public class DraftPane extends MagePane {
|
||||||
this.draftPanel1.showDraft(draftId);
|
this.draftPanel1.showDraft(draftId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void hideDraft() {
|
||||||
|
draftPanel1.hideDraft();
|
||||||
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/** This method is called from within the constructor to
|
||||||
* initialize the form.
|
* initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is
|
* WARNING: Do NOT modify this code. The content of this method is
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<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>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
|
@ -54,6 +54,10 @@ public class TournamentPane extends MagePane {
|
||||||
this.repaint();
|
this.repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void hideTournament() {
|
||||||
|
tournamentPanel.hideTournament();
|
||||||
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/** This method is called from within the constructor to
|
||||||
* initialize the form.
|
* initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is
|
* WARNING: Do NOT modify this code. The content of this method is
|
||||||
|
|
|
@ -113,6 +113,8 @@ public class TournamentPanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hideTournament() {
|
public void hideTournament() {
|
||||||
|
stopTasks();
|
||||||
|
this.chatPanel1.disconnect();
|
||||||
Component c = this.getParent();
|
Component c = this.getParent();
|
||||||
while (c != null && !(c instanceof TournamentPane)) {
|
while (c != null && !(c instanceof TournamentPane)) {
|
||||||
c = c.getParent();
|
c = c.getParent();
|
||||||
|
|
|
@ -169,6 +169,14 @@ public class User {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reconnect() {
|
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()) {
|
for (Entry<UUID, GameSession> entry: gameSessions.entrySet()) {
|
||||||
gameStarted(entry.getValue().getGameId(), entry.getKey());
|
gameStarted(entry.getValue().getGameId(), entry.getKey());
|
||||||
entry.getValue().init();
|
entry.getValue().init();
|
||||||
|
@ -179,14 +187,6 @@ public class User {
|
||||||
entry.getValue().init();
|
entry.getValue().init();
|
||||||
entry.getValue().update();
|
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) {
|
public void addGame(UUID playerId, GameSession gameSession) {
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
package mage.game.events;
|
package mage.game.events;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.Constants.Zone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -43,6 +44,7 @@ public class GameEvent {
|
||||||
protected int amount;
|
protected int amount;
|
||||||
protected boolean flag;
|
protected boolean flag;
|
||||||
protected String data;
|
protected String data;
|
||||||
|
protected Zone zone;
|
||||||
|
|
||||||
public enum EventType {
|
public enum EventType {
|
||||||
|
|
||||||
|
@ -182,4 +184,12 @@ public class GameEvent {
|
||||||
public void setData(String data) {
|
public void setData(String data) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Zone getZone() {
|
||||||
|
return zone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZone(Zone zone) {
|
||||||
|
this.zone = zone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue