mirror of
https://github.com/correl/mage.git
synced 2025-01-11 11:05:23 +00:00
fixed some annoying client errors
This commit is contained in:
parent
b0d3f6640f
commit
e38111072d
1 changed files with 5 additions and 14 deletions
|
@ -143,23 +143,19 @@ public class Session {
|
|||
reconnecting = false;
|
||||
connecting = false;
|
||||
return true;
|
||||
} catch (MageException ex) {
|
||||
} catch (Exception ex) {
|
||||
logger.fatal("", ex);
|
||||
if (!reconnecting) {
|
||||
disconnect(false);
|
||||
JOptionPane.showMessageDialog(frame, "Unable to connect to server. " + ex.getMessage());
|
||||
}
|
||||
} catch (RemoteException ex) {
|
||||
logger.fatal("Unable to connect to server - ", ex);
|
||||
if (!reconnecting) {
|
||||
disconnect(false);
|
||||
JOptionPane.showMessageDialog(frame, "Unable to connect to server. " + ex.getMessage());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public synchronized void disconnect(boolean voluntary) {
|
||||
if (connection == null)
|
||||
return;
|
||||
if (reconnecting)
|
||||
return;
|
||||
if (future != null && !future.isDone())
|
||||
|
@ -215,14 +211,9 @@ public class Session {
|
|||
}
|
||||
|
||||
|
||||
private UUID registerClient(String userName, UUID clientId, MageVersion version) throws MageException {
|
||||
private UUID registerClient(String userName, UUID clientId, MageVersion version) throws MageException, ServerUnavailable {
|
||||
RegisterClient method = new RegisterClient(connection, userName, clientId, version);
|
||||
try {
|
||||
return method.makeCall();
|
||||
} catch (ServerUnavailable ex) {
|
||||
logger.fatal("server unavailable - ", ex);
|
||||
}
|
||||
return null;
|
||||
return method.makeCall();
|
||||
}
|
||||
|
||||
private void deregisterClient() throws MageException {
|
||||
|
|
Loading…
Reference in a new issue