forked from External/mage
Server: improved ping info (added last activity time)
This commit is contained in:
parent
2079065af3
commit
f4a0c70cf3
3 changed files with 22 additions and 16 deletions
|
|
@ -1,12 +1,5 @@
|
|||
package mage.remote;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.UndeclaredThrowableException;
|
||||
import java.net.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.swing.*;
|
||||
import mage.MageException;
|
||||
import mage.cards.decks.DeckCardLists;
|
||||
import mage.cards.repository.CardInfo;
|
||||
|
|
@ -35,6 +28,14 @@ import org.jboss.remoting.transport.bisocket.Bisocket;
|
|||
import org.jboss.remoting.transport.socket.SocketWrapper;
|
||||
import org.jboss.remoting.transporter.TransporterClient;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.UndeclaredThrowableException;
|
||||
import java.net.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com, JayDi85
|
||||
*/
|
||||
|
|
@ -501,7 +502,7 @@ public class SessionImpl implements Session {
|
|||
|
||||
/**
|
||||
* @param askForReconnect - true = connection was lost because of error and
|
||||
* ask the user if they want to try to reconnect
|
||||
* ask the user if they want to try to reconnect
|
||||
*/
|
||||
@Override
|
||||
public synchronized void disconnect(boolean askForReconnect) {
|
||||
|
|
@ -1676,7 +1677,7 @@ public class SessionImpl implements Session {
|
|||
sum += time;
|
||||
}
|
||||
milliSeconds = TimeUnit.MILLISECONDS.convert(sum / pingTime.size(), TimeUnit.NANOSECONDS);
|
||||
pingInfo = lastPing + " (Av: " + (milliSeconds > 0 ? milliSeconds + "ms" : "<1ms") + ')';
|
||||
pingInfo = lastPing + " (avg: " + (milliSeconds > 0 ? milliSeconds + "ms" : "<1ms") + ')';
|
||||
}
|
||||
return true;
|
||||
} catch (MageException ex) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue