forked from External/mage
Added user info text that user can set. Addd chat whisper command. Some minor changes to chat. Impoved display of user list.
This commit is contained in:
parent
e9dd478848
commit
c0323c168c
19 changed files with 522 additions and 356 deletions
|
|
@ -1,34 +1,32 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.client.remote;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.swing.JOptionPane;
|
||||
|
|
@ -49,6 +47,7 @@ import mage.interfaces.callback.ClientCallback;
|
|||
import mage.utils.CompressUtil;
|
||||
import mage.view.AbilityPickerView;
|
||||
import mage.view.ChatMessage;
|
||||
import mage.view.ChatMessage.MessageType;
|
||||
import mage.view.DeckView;
|
||||
import mage.view.DraftClientMessage;
|
||||
import mage.view.DraftView;
|
||||
|
|
@ -58,7 +57,6 @@ import mage.view.GameView;
|
|||
import mage.view.TableClientMessage;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
@ -66,7 +64,6 @@ import org.apache.log4j.Logger;
|
|||
public class CallbackClientImpl implements CallbackClient {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(CallbackClientImpl.class);
|
||||
|
||||
private UUID clientId;
|
||||
private MageFrame frame;
|
||||
private int messageId = 0;
|
||||
|
|
@ -92,25 +89,19 @@ public class CallbackClientImpl implements CallbackClient {
|
|||
TableClientMessage message = (TableClientMessage) callback.getData();
|
||||
GameManager.getInstance().setCurrentPlayerUUID(message.getPlayerId());
|
||||
gameStarted(message.getGameId(), message.getPlayerId());
|
||||
}
|
||||
else if(callback.getMethod().equals("startTournament")) {
|
||||
} else if (callback.getMethod().equals("startTournament")) {
|
||||
TableClientMessage message = (TableClientMessage) callback.getData();
|
||||
tournamentStarted(message.getGameId(), message.getPlayerId());
|
||||
}
|
||||
else if(callback.getMethod().equals("startDraft")) {
|
||||
} else if (callback.getMethod().equals("startDraft")) {
|
||||
TableClientMessage message = (TableClientMessage) callback.getData();
|
||||
draftStarted(message.getGameId(), message.getPlayerId());
|
||||
}
|
||||
else if (callback.getMethod().equals("replayGame")) {
|
||||
} else if (callback.getMethod().equals("replayGame")) {
|
||||
replayGame(callback.getObjectId());
|
||||
}
|
||||
else if (callback.getMethod().equals("showTournament")) {
|
||||
} else if (callback.getMethod().equals("showTournament")) {
|
||||
showTournament((UUID) callback.getObjectId());
|
||||
}
|
||||
else if (callback.getMethod().equals("watchGame")) {
|
||||
} else if (callback.getMethod().equals("watchGame")) {
|
||||
watchGame((UUID) callback.getObjectId());
|
||||
}
|
||||
else if (callback.getMethod().equals("chatMessage")) {
|
||||
} else if (callback.getMethod().equals("chatMessage")) {
|
||||
ChatMessage message = (ChatMessage) callback.getData();
|
||||
ChatPanel panel = MageFrame.getChat(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
|
|
@ -120,22 +111,25 @@ public class CallbackClientImpl implements CallbackClient {
|
|||
case PlayerLeft:
|
||||
AudioManager.playPlayerLeft();
|
||||
break;
|
||||
case PlayerSubmittedDeck:
|
||||
case PlayerSubmittedDeck:
|
||||
AudioManager.playPlayerSubmittedDeck();
|
||||
break;
|
||||
case PlayerWhispered:
|
||||
AudioManager.playPlayerWhispered();
|
||||
break;
|
||||
}
|
||||
}
|
||||
// send start message to chat if needed
|
||||
// send start message to chat if not done yet
|
||||
if (!panel.isStartMessageDone()) {
|
||||
createChatStartMessage(panel);
|
||||
}
|
||||
// send the message itself
|
||||
if (message.isUserMessage() && panel.getConnectedChat() != null) {
|
||||
panel.getConnectedChat().receiveMessage(message.getUsername(), message.getMessage(), message.getTime(), ChatMessage.MessageColor.BLACK);
|
||||
// send the message to subchat if exists and it's not a game message
|
||||
if (!message.getMessageType().equals(MessageType.GAME) && panel.getConnectedChat() != null) {
|
||||
panel.getConnectedChat().receiveMessage(message.getUsername(), message.getMessage(), message.getTime(), message.getMessageType(), ChatMessage.MessageColor.BLACK);
|
||||
} else {
|
||||
panel.receiveMessage(message.getUsername(), message.getMessage(), message.getTime(), message.getColor());
|
||||
panel.receiveMessage(message.getUsername(), message.getMessage(), message.getTime(), message.getMessageType(), message.getColor());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} else if (callback.getMethod().equals("serverMessage")) {
|
||||
if (callback.getData() != null) {
|
||||
|
|
@ -149,119 +143,100 @@ public class CallbackClientImpl implements CallbackClient {
|
|||
} else if (callback.getMethod().equals("joinedTable")) {
|
||||
TableClientMessage message = (TableClientMessage) callback.getData();
|
||||
joinedTable(message.getRoomId(), message.getTableId(), message.getFlag());
|
||||
}
|
||||
else if (callback.getMethod().equals("replayInit")) {
|
||||
} else if (callback.getMethod().equals("replayInit")) {
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.init((GameView) callback.getData());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("replayDone")) {
|
||||
} else if (callback.getMethod().equals("replayDone")) {
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.endMessage((String) callback.getData(), callback.getMessageId());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("replayUpdate")) {
|
||||
} else if (callback.getMethod().equals("replayUpdate")) {
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.updateGame((GameView) callback.getData());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gameInit")) {
|
||||
} else if (callback.getMethod().equals("gameInit")) {
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.init((GameView) callback.getData());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gameOver")) {
|
||||
} else if (callback.getMethod().equals("gameOver")) {
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.endMessage((String) callback.getData(), callback.getMessageId());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gameError")) {
|
||||
} else if (callback.getMethod().equals("gameError")) {
|
||||
frame.showErrorDialog("Game Error", (String) callback.getData());
|
||||
}
|
||||
else if (callback.getMethod().equals("gameAsk")) {
|
||||
} else if (callback.getMethod().equals("gameAsk")) {
|
||||
GameClientMessage message = (GameClientMessage) callback.getData();
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.ask(message.getMessage(), message.getGameView(), callback.getMessageId());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gameTarget")) {
|
||||
} else if (callback.getMethod().equals("gameTarget")) {
|
||||
GameClientMessage message = (GameClientMessage) callback.getData();
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.pickTarget(message.getMessage(), message.getCardsView(), message.getGameView(),
|
||||
message.getTargets(), message.isFlag(), message.getOptions(), callback.getMessageId());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gameSelect")) {
|
||||
} else if (callback.getMethod().equals("gameSelect")) {
|
||||
GameClientMessage message = (GameClientMessage) callback.getData();
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.select(message.getMessage(), message.getGameView(), callback.getMessageId());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gameChooseAbility")) {
|
||||
} else if (callback.getMethod().equals("gameChooseAbility")) {
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.pickAbility((AbilityPickerView) callback.getData());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gameChoosePile")) {
|
||||
} else if (callback.getMethod().equals("gameChoosePile")) {
|
||||
GameClientMessage message = (GameClientMessage) callback.getData();
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.pickPile(message.getMessage(), message.getPile1(), message.getPile2());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gameChoose")) {
|
||||
} else if (callback.getMethod().equals("gameChoose")) {
|
||||
GameClientMessage message = (GameClientMessage) callback.getData();
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.getChoice(message.getMessage(), message.getStrings());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gamePlayMana")) {
|
||||
} else if (callback.getMethod().equals("gamePlayMana")) {
|
||||
GameClientMessage message = (GameClientMessage) callback.getData();
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.playMana(message.getMessage(), message.getGameView(), callback.getMessageId());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gamePlayXMana")) {
|
||||
} else if (callback.getMethod().equals("gamePlayXMana")) {
|
||||
GameClientMessage message = (GameClientMessage) callback.getData();
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.playXMana(message.getMessage(), message.getGameView(), callback.getMessageId());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gameSelectAmount")) {
|
||||
} else if (callback.getMethod().equals("gameSelectAmount")) {
|
||||
GameClientMessage message = (GameClientMessage) callback.getData();
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.getAmount(message.getMin(), message.getMax(), message.getMessage());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gameUpdate")) {
|
||||
} else if (callback.getMethod().equals("gameUpdate")) {
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.updateGame((GameView) callback.getData());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("endGameInfo")) {
|
||||
} else if (callback.getMethod().equals("endGameInfo")) {
|
||||
MageFrame.getInstance().showGameEndDialog((GameEndView) callback.getData());
|
||||
}
|
||||
else if (callback.getMethod().equals("showUserMessage")) {
|
||||
} else if (callback.getMethod().equals("showUserMessage")) {
|
||||
List<String> messageData = (List<String>) callback.getData();
|
||||
if (messageData.size() == 2) {
|
||||
JOptionPane.showMessageDialog(null, messageData.get(1), messageData.get(0), JOptionPane.WARNING_MESSAGE);
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gameInform")) {
|
||||
} else if (callback.getMethod().equals("gameInform")) {
|
||||
|
||||
if (callback.getMessageId() > messageId) {
|
||||
GameClientMessage message = (GameClientMessage) callback.getData();
|
||||
|
|
@ -269,76 +244,62 @@ public class CallbackClientImpl implements CallbackClient {
|
|||
if (panel != null) {
|
||||
panel.inform(message.getMessage(), message.getGameView(), callback.getMessageId());
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
logger.warn("message out of sequence - ignoring");
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("gameInformPersonal")) {
|
||||
} else if (callback.getMethod().equals("gameInformPersonal")) {
|
||||
GameClientMessage message = (GameClientMessage) callback.getData();
|
||||
GamePanel panel = MageFrame.getGame(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
JOptionPane.showMessageDialog(panel, message.getMessage(), "Game message",
|
||||
JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("sideboard")) {
|
||||
} else if (callback.getMethod().equals("sideboard")) {
|
||||
TableClientMessage message = (TableClientMessage) callback.getData();
|
||||
DeckView deckView = message.getDeck();
|
||||
Deck deck = DeckUtil.construct(deckView);
|
||||
if (message.getFlag()) {
|
||||
construct(deck, message.getTableId(), message.getTime());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
sideboard(deck, message.getTableId(), message.getTime());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("construct")) {
|
||||
} else if (callback.getMethod().equals("construct")) {
|
||||
TableClientMessage message = (TableClientMessage) callback.getData();
|
||||
DeckView deckView = message.getDeck();
|
||||
Deck deck = DeckUtil.construct(deckView);
|
||||
construct(deck, message.getTableId(), message.getTime());
|
||||
}
|
||||
else if (callback.getMethod().equals("draftOver")) {
|
||||
} else if (callback.getMethod().equals("draftOver")) {
|
||||
DraftPanel panel = MageFrame.getDraft(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.hideDraft();
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("draftPick")) {
|
||||
} else if (callback.getMethod().equals("draftPick")) {
|
||||
DraftClientMessage message = (DraftClientMessage) callback.getData();
|
||||
DraftPanel panel = MageFrame.getDraft(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.loadBooster(message.getDraftPickView());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("draftUpdate")) {
|
||||
} else if (callback.getMethod().equals("draftUpdate")) {
|
||||
DraftPanel panel = MageFrame.getDraft(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.updateDraft((DraftView) callback.getData());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("draftInform")) {
|
||||
} else if (callback.getMethod().equals("draftInform")) {
|
||||
if (callback.getMessageId() > messageId) {
|
||||
DraftClientMessage message = (DraftClientMessage) callback.getData();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
logger.warn("message out of sequence - ignoring");
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("draftInit")) {
|
||||
} else if (callback.getMethod().equals("draftInit")) {
|
||||
DraftClientMessage message = (DraftClientMessage) callback.getData();
|
||||
DraftPanel panel = MageFrame.getDraft(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
panel.loadBooster(message.getDraftPickView());
|
||||
}
|
||||
}
|
||||
else if (callback.getMethod().equals("tournamentInit")) {
|
||||
|
||||
} else if (callback.getMethod().equals("tournamentInit")) {
|
||||
}
|
||||
messageId = callback.getMessageId();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
}
|
||||
|
|
@ -353,24 +314,26 @@ public class CallbackClientImpl implements CallbackClient {
|
|||
}
|
||||
switch (usedPanel.getChatType()) {
|
||||
case GAME:
|
||||
usedPanel.receiveMessage("", "You may use hot keys to play faster: " + "" +
|
||||
"\nTurn Mousewheel - Show big image of card your mousepointer hovers over" +
|
||||
"\nF2 - Confirm \"Ok\", \"Yes\" or \"Done\" button" +
|
||||
"\nF4 - Skip current turn but stop on declare attackers" +
|
||||
"\nF9 - Skip everything until your next turn" +
|
||||
"\nF3 - Undo F4/F9", "", ChatMessage.MessageColor.ORANGE);
|
||||
usedPanel.receiveMessage("", new StringBuilder("You may use hot keys to play faster:")
|
||||
.append("\nTurn Mousewheel - Show big image of card your mousepointer hovers over")
|
||||
.append("\nF2 - Confirm \"Ok\", \"Yes\" or \"Done\" button")
|
||||
.append("\nF4 - Skip current turn but stop on declare attackers/blockers and something on the stack")
|
||||
.append("\nF9 - Skip everything until your next turn")
|
||||
.append("\nF3 - Undo F4/F9").toString(),
|
||||
null, MessageType.USER_INFO, ChatMessage.MessageColor.ORANGE);
|
||||
break;
|
||||
case TOURNAMENT:
|
||||
usedPanel.receiveMessage("", "On this panel you can see the players, their state and the results of the games of the tournament. Also you can chat with the competitors of the tournament.", "", ChatMessage.MessageColor.ORANGE);
|
||||
usedPanel.receiveMessage("", new StringBuilder("On this panel you can see the players, their state and the results of the games of the tournament. Also you can chat with the competitors of the tournament.").toString(),
|
||||
null, MessageType.USER_INFO, ChatMessage.MessageColor.ORANGE);
|
||||
break;
|
||||
case TABLES:
|
||||
usedPanel.receiveMessage("",
|
||||
"Download card images by using the \"Images\" menu to the top right ." +
|
||||
"\nDownload icons and symbols by using the \"Symbols\" menu to the top right.",
|
||||
"", ChatMessage.MessageColor.ORANGE);
|
||||
usedPanel.receiveMessage("", new StringBuilder("Download card images by using the \"Images\" menu to the top right .")
|
||||
.append("\nDownload icons and symbols by using the \"Symbols\" menu to the top right.")
|
||||
.append("\n\\list - Show a list of available chat commands.").toString(),
|
||||
null, MessageType.USER_INFO, ChatMessage.MessageColor.ORANGE);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
|
|
@ -380,18 +343,16 @@ public class CallbackClientImpl implements CallbackClient {
|
|||
private void joinedTable(UUID roomId, UUID tableId, boolean isTournament) {
|
||||
try {
|
||||
frame.showTableWaitingDialog(roomId, tableId, isTournament);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void gameStarted(final UUID gameId, final UUID playerId) {
|
||||
try {
|
||||
frame.showGame(gameId, playerId);
|
||||
logger.info("Game " + gameId + " started for player " + playerId);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
|
||||
|
|
@ -404,8 +365,7 @@ public class CallbackClientImpl implements CallbackClient {
|
|||
try {
|
||||
frame.showDraft(draftId);
|
||||
logger.info("Draft " + draftId + " started for player " + playerId);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
}
|
||||
|
|
@ -414,23 +374,21 @@ public class CallbackClientImpl implements CallbackClient {
|
|||
try {
|
||||
frame.showTournament(tournamentId);
|
||||
logger.info("Tournament " + tournamentId + " started for player " + playerId);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the tournament info panel for a tournament
|
||||
*
|
||||
*
|
||||
* @param tournamentId
|
||||
*/
|
||||
protected void showTournament(UUID tournamentId) {
|
||||
try {
|
||||
frame.showTournament(tournamentId);
|
||||
logger.info("Showing tournament " + tournamentId);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
}
|
||||
|
|
@ -439,17 +397,16 @@ public class CallbackClientImpl implements CallbackClient {
|
|||
try {
|
||||
frame.watchGame(gameId);
|
||||
logger.info("Watching game " + gameId);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
protected void replayGame(UUID gameId) {
|
||||
try {
|
||||
frame.replayGame(gameId);
|
||||
logger.info("Replaying game");
|
||||
}
|
||||
catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
}
|
||||
|
|
@ -466,5 +423,4 @@ public class CallbackClientImpl implements CallbackClient {
|
|||
logger.fatal("Client error\n", ex);
|
||||
frame.showError("Error: " + ex.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue