Use MapleClient for session management
First working version of the Netty implementation, but there's a lot remaining to be done.
This commit is contained in:
@@ -58,7 +58,6 @@ import org.apache.mina.core.buffer.IoBuffer;
|
||||
import org.apache.mina.core.buffer.SimpleBufferAllocator;
|
||||
import org.apache.mina.core.service.IoAcceptor;
|
||||
import org.apache.mina.core.session.IdleStatus;
|
||||
import org.apache.mina.core.session.IoSession;
|
||||
import org.apache.mina.filter.codec.ProtocolCodecFilter;
|
||||
import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
|
||||
import org.slf4j.Logger;
|
||||
@@ -294,8 +293,8 @@ public class Server {
|
||||
}
|
||||
}
|
||||
|
||||
public String[] getInetSocket(IoSession session, int world, int channel) {
|
||||
String remoteIp = MapleSessionCoordinator.getSessionRemoteAddress(session);
|
||||
public String[] getInetSocket(MapleClient client, int world, int channel) {
|
||||
String remoteIp = client.getRemoteAddress();
|
||||
|
||||
String[] hostAddress = getIP(world, channel).split(":");
|
||||
if (IpAddresses.isLocalAddress(remoteIp)) {
|
||||
@@ -1792,7 +1791,7 @@ public class Server {
|
||||
}
|
||||
|
||||
private static String getRemoteHost(MapleClient client) {
|
||||
return MapleSessionCoordinator.getSessionRemoteHost(client.getSession());
|
||||
return MapleSessionCoordinator.getSessionRemoteHost(client);
|
||||
}
|
||||
|
||||
public void setCharacteridInTransition(MapleClient client, int charId) {
|
||||
@@ -1894,7 +1893,7 @@ public class Server {
|
||||
if (c.isLoggedIn()) {
|
||||
c.disconnect(false, false);
|
||||
} else {
|
||||
MapleSessionCoordinator.getInstance().closeSession(c.getSession(), true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(c, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user