Some more changes to Server Console and Admin server handling.

This commit is contained in:
LevelX2 2014-08-18 21:48:59 +02:00
parent e697cae98d
commit c03dc6c2b5
13 changed files with 113 additions and 60 deletions

View file

@ -28,7 +28,11 @@
package mage.remote;
import java.net.*;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.InterfaceAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;
/**

View file

@ -204,8 +204,10 @@ public class SessionImpl implements Session {
if (registerResult) {
sessionState = SessionState.CONNECTED;
serverState = server.getServerState();
updateDatabase();
logger.info("Connected as " + this.getUserName() == null ? "":this.getUserName() + " to MAGE server at " + connection.getHost() + ":" + connection.getPort());
if (!connection.getUsername().equals("Admin")) {
updateDatabase();
}
logger.info("Connected as " + (this.getUserName() == null ? "":this.getUserName()) + " to MAGE server at " + connection.getHost() + ":" + connection.getPort());
client.connected(this.getUserName() == null ? "":this.getUserName() +"@" + connection.getHost() + ":" + connection.getPort() +" ");
return true;
}

View file

@ -36,10 +36,10 @@ import java.util.Date;
*/
public class UserView implements Serializable {
private String userName;
private String host;
private String sessionId;
private Date timeConnected;
private final String userName;
private final String host;
private final String sessionId;
private final Date timeConnected;
public UserView(String userName, String host, String sessionId, Date timeConnected) {
this.userName = userName;