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:
P0nk
2021-07-11 18:56:45 +02:00
parent 86224f5152
commit 5a7d8e6b1f
23 changed files with 210 additions and 238 deletions

View File

@@ -52,7 +52,7 @@ public class BanCommand extends Command {
MapleCharacter target = c.getChannelServer().getPlayerStorage().getCharacterByName(ign);
if (target != null) {
String readableTargetName = MapleCharacter.makeMapleReadable(target.getName());
String ip = target.getClient().getSession().getRemoteAddress().toString().split(":")[0];
String ip = target.getClient().getRemoteAddress();
//Ban ip
try (Connection con = DatabaseConnection.getConnection()) {
if (ip.matches("/[0-9]{1,3}\\..*")) {

View File

@@ -50,7 +50,7 @@ public class IpListCommand extends Command {
str += "\r\n" + GameConstants.WORLD_NAMES[w.getId()] + "\r\n";
for (MapleCharacter chr : chars) {
str += " " + chr.getName() + " - " + chr.getClient().getSession().getRemoteAddress() + "\r\n";
str += " " + chr.getName() + " - " + chr.getClient().getRemoteAddress() + "\r\n";
}
}
}

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(c.getSession(), worldb, c.getChannel());
String[] socket = server.getInetSocket(c, worldb, c.getChannel());
c.getWorldServer().removePlayer(player);
player.getMap().removePlayer(player);//LOL FORGOT THIS ><
player.setSessionTransitionState();