Now client can start embedded Mage Server (player's feature request).

Works only for "localhost". Still can be used with external server but in such case server should be started first.
This commit is contained in:
magenoxx 2011-12-23 13:14:32 +04:00
parent 810d33c8ba
commit a7a496af0e
23 changed files with 118 additions and 27 deletions

View file

@ -207,8 +207,15 @@ public class Main {
@Override
public Object invoke(final InvocationRequest invocation) throws Throwable {
String sessionId = invocation.getSessionId();
InetAddress clientAddress = (InetAddress) invocation.getRequestPayload().get(Remoting.CLIENT_ADDRESS);
SessionManager.getInstance().getSession(sessionId).setHost(clientAddress.getHostAddress());
Map map = invocation.getRequestPayload();
String host;
if (map != null) {
InetAddress clientAddress = (InetAddress) invocation.getRequestPayload().get(Remoting.CLIENT_ADDRESS);
host = clientAddress.getHostAddress();
} else {
host = "localhost";
}
SessionManager.getInstance().getSession(sessionId).setHost(host);
return null;
}