Implemented an event recall system. Players that went disconnected during an event instance are able to rejoin the ongoing event upon relogin. Implemented a player-activity backed best-sellers system for the Cash Shop. Patched the recently added selective loot system interfering with quest items, ever disabling drops after the player picked up one item. Implemented a server flag for everlasting buffs. Fixed some inconsistencies with Priest Dispel skill, sometimes crashing party players. Fixed change job not properly showing effects for other players. Fixed wrong fee value being taken from players that expands their guild size. Also, implemented GMS-like fee for this action. Reworked the MapleSessionCoordinator, now evaluating client's HWID as well as remote IP. This's expected to lessen account drought time for players that are constantly changing their IP. Last but not least, added world maps for Mushroom Castle, Zipangu, CBD/Malaysia and Ellin Forest regions. Original artwork content used on files depicted in this topic are rightful property of Nexon Corps., these files thoroughly trying to adhere the "Fair Use" disclaimer policy, their purpose being solely to fulfill gaming experience for the areas that were already present on v83 GMS but still lacked worldmaps. For more info regarding Fair Use, please refer to "http://www.dmlp.org/legal-guide/fair-use".
100 lines
3.3 KiB
Java
100 lines
3.3 KiB
Java
package net.server.handlers.login;
|
|
|
|
import java.net.InetAddress;
|
|
import java.net.InetSocketAddress;
|
|
import java.net.UnknownHostException;
|
|
|
|
import net.AbstractMaplePacketHandler;
|
|
import net.server.Server;
|
|
import net.server.coordinator.MapleSessionCoordinator;
|
|
import net.server.coordinator.MapleSessionCoordinator.AntiMulticlientResult;
|
|
import net.server.world.World;
|
|
import org.apache.mina.core.session.IoSession;
|
|
import tools.MaplePacketCreator;
|
|
import tools.data.input.SeekableLittleEndianAccessor;
|
|
import client.MapleClient;
|
|
|
|
public class CharSelectedWithPicHandler extends AbstractMaplePacketHandler {
|
|
|
|
private static int parseAntiMulticlientError(AntiMulticlientResult res) {
|
|
switch (res) {
|
|
case REMOTE_PROCESSING:
|
|
return 10;
|
|
|
|
case REMOTE_LOGGEDIN:
|
|
return 7;
|
|
|
|
case REMOTE_NO_MATCH:
|
|
return 17;
|
|
|
|
case COORDINATOR_ERROR:
|
|
return 8;
|
|
|
|
default:
|
|
return 9;
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
|
String pic = slea.readMapleAsciiString();
|
|
int charId = slea.readInt();
|
|
|
|
String macs = slea.readMapleAsciiString();
|
|
String hwid = slea.readMapleAsciiString();
|
|
|
|
if (!hwid.matches("[0-9A-F]{12}_[0-9A-F]{8}")) {
|
|
c.announce(MaplePacketCreator.getAfterLoginError(17));
|
|
return;
|
|
}
|
|
|
|
c.updateMacs(macs);
|
|
c.updateHWID(hwid);
|
|
|
|
IoSession session = c.getSession();
|
|
AntiMulticlientResult res = MapleSessionCoordinator.getInstance().attemptGameSession(session, c.getAccID(), hwid);
|
|
if (res != AntiMulticlientResult.SUCCESS) {
|
|
c.announce(MaplePacketCreator.getAfterLoginError(parseAntiMulticlientError(res)));
|
|
return;
|
|
}
|
|
|
|
if (c.hasBannedMac() || c.hasBannedHWID()) {
|
|
c.getSession().close(true);
|
|
return;
|
|
}
|
|
|
|
Server server = Server.getInstance();
|
|
if(!server.haveCharacterEntry(c.getAccID(), charId)) {
|
|
c.getSession().close(true);
|
|
return;
|
|
}
|
|
|
|
if (c.checkPic(pic)) {
|
|
c.setWorld(server.getCharacterWorld(charId));
|
|
World wserv = c.getWorldServer();
|
|
if(wserv == null || wserv.isWorldCapacityFull()) {
|
|
c.announce(MaplePacketCreator.getAfterLoginError(10));
|
|
return;
|
|
}
|
|
|
|
String[] socket = server.getInetSocket(c.getWorld(), c.getChannel());
|
|
if(socket == null) {
|
|
c.announce(MaplePacketCreator.getAfterLoginError(10));
|
|
return;
|
|
}
|
|
|
|
server.unregisterLoginState(c);
|
|
c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION);
|
|
server.setCharacteridInTransition((InetSocketAddress) c.getSession().getRemoteAddress(), charId);
|
|
|
|
try {
|
|
c.announce(MaplePacketCreator.getServerIP(InetAddress.getByName(socket[0]), Integer.parseInt(socket[1]), charId));
|
|
} catch (UnknownHostException | NumberFormatException e) {
|
|
e.printStackTrace();
|
|
}
|
|
} else {
|
|
c.announce(MaplePacketCreator.wrongPic());
|
|
}
|
|
}
|
|
}
|