* Some connection handling changes.

This commit is contained in:
LevelX2 2014-10-02 01:14:32 +02:00
parent 54d43d30ab
commit 8ac8d36c03
3 changed files with 6 additions and 4 deletions

View file

@ -1232,7 +1232,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
@Override
public void disconnected(final boolean errorCall) {
if (SwingUtilities.isEventDispatchThread()) { // Returns true if the current thread is an AWT event dispatching thread.
logger.info("DISCONNECTED (Event Dispacth Thread)");
logger.info("DISCONNECTED (Event Dispatch Thread)");
setStatusText("Not connected");
disableButtons();
hideGames();
@ -1250,6 +1250,8 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
if (performConnect()) {
enableButtons();
}
} else {
session.disconnect(false);
}
}
});

View file

@ -305,7 +305,7 @@ public class MageActionCallback implements ActionCallback {
}
private void sort(CardPanel card, JPanel container, boolean sortSource) {
java.util.List<CardPanel> cards = new ArrayList<CardPanel>();
java.util.List<CardPanel> cards = new ArrayList<>();
for (Component component : container.getComponents()) {
if (component instanceof CardPanel) {
if (!component.equals(card)) {

View file

@ -251,8 +251,8 @@ public class SessionImpl implements Session {
listenerMetadata.put(ConnectionValidator.VALIDATOR_PING_PERIOD, "1000000");
listenerMetadata.put(ConnectionValidator.VALIDATOR_PING_TIMEOUT, "900000");
} else {
listenerMetadata.put(ConnectionValidator.VALIDATOR_PING_PERIOD, "10000");
listenerMetadata.put(ConnectionValidator.VALIDATOR_PING_TIMEOUT, "9000");
listenerMetadata.put(ConnectionValidator.VALIDATOR_PING_PERIOD, "15000");
listenerMetadata.put(ConnectionValidator.VALIDATOR_PING_TIMEOUT, "13000");
}
callbackClient.connect(new ClientConnectionListener(), listenerMetadata);