cleanup: adjust syntax

This commit is contained in:
ronancpl
2021-04-10 09:43:05 -03:00
parent 7a3d5d2b94
commit d4e4150a6e
3 changed files with 5 additions and 3 deletions

View File

@@ -49,7 +49,7 @@ public class WarpWorldCommand extends Command {
byte worldb = Byte.parseByte(params[0]);
if (worldb <= (server.getWorldsSize() - 1)) {
try {
String[] socket = server.getInetSocket(worldb, c.getChannel());
String[] socket = server.getInetSocket(c.getSession(), worldb, c.getChannel());
c.getWorldServer().removePlayer(player);
player.getMap().removePlayer(player);//LOL FORGOT THIS ><
player.setSessionTransitionState();

View File

@@ -56,6 +56,7 @@ 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;
@@ -285,8 +286,7 @@ public class Server {
}
}
public String[] getInetSocket(int world, int channel) {
public String[] getInetSocket(IoSession session, int world, int channel) {
public String[] getInetSocket(IoSession session, int world, int channel) {
String remoteIp = MapleSessionCoordinator.getSessionRemoteAddress(session);
String[] hostAddress = getIP(world, channel).split(":");

View File

@@ -38,6 +38,8 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
*