Added Puppets on Aggro + Guild/Alliance packet info patch + Pet flags
Added pet flags recognition, such as the "pet speed same as owner" mechanic. Fixed repeatable quest "Remnants of HT..." not rewarding Dragon Stones. Refactored character object's check slots method, now using the same algorithm from the API class. Fixed a vunerability from before reviving/respawning players to towns, on where players would get their HP restored in area map before sending them back to safety. Fixed some NPC gates in Mushking Empire, allowing players to access bosses free of quest requirements. Improved dialog of NPCs for "permission to attempt Zakum expeds". Implemented (or rather improved) item scripts, now using NPC conversation methods as it was intended originally. Rehauled mob-skill "summon mobs" limit, now using the placeholders found in the wz to determine limit of concurrent underlings spawned, and "limit" now refers to total of underlings spawned from a mob. Revised IoSession closing mechanics in several login classes. Implemented automated loggedin account shutdown if another player has gained a pass from the DB to login. Improved the server-side check for teleport rocks. Fixed removeAfter from mobs being procced after they were disposed. Reviewed EIM start references on several scripts, minding the latest EIM setup implementations. Fixed equipments that were reused Scissors of Karma not not being able to sell on pshops/merchants. Fixed a bug where entering alliances would lead a player to see information from other guilds of past alliances until an update takes place. Padronized a few skillbook names. Reviewed player puppets not gaining priority properly on the recent aggro system. Improved "item sold" message of merchants, now displaying also quantity left of an item on store. Fixed a bug with itemid limits of weapons on server.
This commit is contained in:
@@ -86,6 +86,7 @@ import constants.ItemConstants;
|
||||
import constants.GameConstants;
|
||||
import constants.ServerConstants;
|
||||
import java.util.TimeZone;
|
||||
import net.server.coordinator.MapleSessionCoordinator;
|
||||
import server.CashShop.CashItemFactory;
|
||||
import server.MapleSkillbookInformationProvider;
|
||||
import server.ThreadManager;
|
||||
@@ -1693,7 +1694,7 @@ public class Server {
|
||||
if(c.isLoggedIn()) {
|
||||
c.disconnect(false, false);
|
||||
} else {
|
||||
c.getSession().close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(c.getSession(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1766,8 +1767,13 @@ public class Server {
|
||||
System.out.println("Worlds + Channels are offline.");
|
||||
acceptor.unbind();
|
||||
acceptor = null;
|
||||
if (!restart) {
|
||||
System.exit(0);
|
||||
if (!restart) { // shutdown hook deadlocks if System.exit() method is used within its body chores, thanks MIKE for pointing that out
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.exit(0);
|
||||
}
|
||||
}).start();
|
||||
} else {
|
||||
System.out.println("\r\nRestarting the server....\r\n");
|
||||
try {
|
||||
|
||||
@@ -130,7 +130,7 @@ public final class AllianceOperationHandler extends AbstractMaplePacketHandler {
|
||||
chr.saveGuildStatus();
|
||||
|
||||
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.addGuildToAlliance(alliance, guildid, c), -1, -1);
|
||||
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.updateAllianceInfo(alliance, c), -1, -1);
|
||||
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.updateAllianceInfo(alliance, c.getWorld()), -1, -1);
|
||||
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.allianceNotice(alliance.getId(), alliance.getNotice()), -1, -1);
|
||||
chr.getGuild().dropMessage("Your guild has joined the [" + alliance.getName() + "] union.");
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ import tools.MaplePacketCreator;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
public final class CharInfoRequestHandler extends AbstractMaplePacketHandler {
|
||||
|
||||
@Override
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
slea.skip(4);
|
||||
int cid = slea.readInt();
|
||||
|
||||
@@ -24,7 +24,6 @@ package net.server.channel.handlers;
|
||||
import client.MapleBuffStat;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.SkillFactory;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import server.maps.MapleSummon;
|
||||
import server.maps.MapleMapObject;
|
||||
|
||||
@@ -25,6 +25,7 @@ import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.autoban.AutobanFactory;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventory;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.MapleKarmaManipulator;
|
||||
@@ -465,22 +466,41 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler {
|
||||
} else if (mode == Action.SET_ITEMS.getCode()) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
MapleInventoryType ivType = MapleInventoryType.getByType(slea.readByte());
|
||||
Item item = chr.getInventory(ivType).getItem(slea.readShort());
|
||||
short pos = slea.readShort();
|
||||
Item item = chr.getInventory(ivType).getItem(pos);
|
||||
short quantity = slea.readShort();
|
||||
byte targetSlot = slea.readByte();
|
||||
|
||||
if (targetSlot < 1 || targetSlot > 9) {
|
||||
System.out.println("[h4x] " + chr.getName() + " Trying to dupe on trade slot.");
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
if (item == null) {
|
||||
c.announce(MaplePacketCreator.serverNotice(1, "Invalid item description."));
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(ServerConstants.USE_ENFORCE_UNMERCHABLE_CASH && ii.isCash(item.getItemId())) {
|
||||
c.announce(MaplePacketCreator.serverNotice(1, "Cash items are not allowed to be traded."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (ServerConstants.USE_ENFORCE_UNMERCHABLE_PET && ItemConstants.isPet(item.getItemId())) {
|
||||
c.announce(MaplePacketCreator.serverNotice(1, "Pets are not allowed to be traded."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (quantity < 1 || quantity > item.getQuantity()) {
|
||||
c.announce(MaplePacketCreator.serverNotice(1, "You don't have enough quantity of the item."));
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
if (chr.getTrade() != null) {
|
||||
|
||||
MapleTrade trade = chr.getTrade();
|
||||
if (trade != null) {
|
||||
if ((quantity <= item.getQuantity() && quantity >= 0) || ItemConstants.isRechargeable(item.getItemId())) {
|
||||
if (ii.isDropRestricted(item.getItemId())) { // ensure that undroppable items do not make it to the trade window
|
||||
if (!MapleKarmaManipulator.hasKarmaFlag(item)) {
|
||||
@@ -489,16 +509,38 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Item tradeItem = item.copy();
|
||||
if (ItemConstants.isRechargeable(item.getItemId())) {
|
||||
tradeItem.setQuantity(item.getQuantity());
|
||||
MapleInventoryManipulator.removeFromSlot(c, ivType, item.getPosition(), item.getQuantity(), true);
|
||||
} else {
|
||||
|
||||
MapleInventory inv = chr.getInventory(ivType);
|
||||
inv.lockInventory();
|
||||
try {
|
||||
Item checkItem = chr.getInventory(ivType).getItem(pos);
|
||||
if (checkItem != item || checkItem.getPosition() != item.getPosition()) {
|
||||
c.announce(MaplePacketCreator.serverNotice(1, "Invalid item description."));
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
Item tradeItem = item.copy();
|
||||
if (ItemConstants.isRechargeable(item.getItemId())) {
|
||||
quantity = item.getQuantity();
|
||||
}
|
||||
|
||||
tradeItem.setQuantity(quantity);
|
||||
MapleInventoryManipulator.removeFromSlot(c, ivType, item.getPosition(), quantity, true);
|
||||
tradeItem.setPosition(targetSlot);
|
||||
|
||||
if (trade.addItem(tradeItem)) {
|
||||
MapleInventoryManipulator.removeFromSlot(c, ivType, item.getPosition(), quantity, true);
|
||||
|
||||
trade.getChr().announce(MaplePacketCreator.getTradeItemAdd((byte) 0, tradeItem));
|
||||
if (trade.getPartner() != null) {
|
||||
trade.getPartner().getChr().announce(MaplePacketCreator.getTradeItemAdd((byte) 1, tradeItem));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
FilePrinter.printError(FilePrinter.TRADE_EXCEPTION, e, "Player '" + chr + "' tried to add " + ii.getName(item.getItemId()) + " qty. " + item.getQuantity() + " in trade (slot " + targetSlot + ") then exception occurred.");
|
||||
} finally {
|
||||
inv.unlockInventory();
|
||||
}
|
||||
tradeItem.setPosition(targetSlot);
|
||||
chr.getTrade().addItem(tradeItem);
|
||||
}
|
||||
}
|
||||
} else if (mode == Action.CONFIRM.getCode()) {
|
||||
|
||||
@@ -289,7 +289,7 @@ public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler {
|
||||
}
|
||||
}
|
||||
if (newAlliance != null) {
|
||||
c.announce(MaplePacketCreator.updateAllianceInfo(newAlliance, c));
|
||||
c.announce(MaplePacketCreator.updateAllianceInfo(newAlliance, c.getWorld()));
|
||||
c.announce(MaplePacketCreator.allianceNotice(newAlliance.getId(), newAlliance.getNotice()));
|
||||
|
||||
if (newcomer) {
|
||||
|
||||
@@ -27,8 +27,7 @@ import constants.ItemConstants;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import scripting.item.ItemScriptManager;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.MapleItemInformationProvider.scriptedItem;
|
||||
import tools.MaplePacketCreator;
|
||||
import server.MapleItemInformationProvider.ScriptedItem;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
/**
|
||||
@@ -38,19 +37,20 @@ import tools.data.input.SeekableLittleEndianAccessor;
|
||||
public final class ScriptedItemHandler extends AbstractMaplePacketHandler {
|
||||
@Override
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
slea.readInt(); // trash stamp, thanks RMZero213
|
||||
short itemSlot = slea.readShort(); // item slot, thanks RMZero213
|
||||
int itemId = slea.readInt();
|
||||
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
slea.readInt(); // trash stamp (thanks rmzero)
|
||||
short itemSlot = slea.readShort(); // item slot (thanks rmzero)
|
||||
int itemId = slea.readInt(); // itemId
|
||||
scriptedItem info = ii.getScriptedItemInfo(itemId);
|
||||
ScriptedItem info = ii.getScriptedItemInfo(itemId);
|
||||
if (info == null) return;
|
||||
ItemScriptManager ism = ItemScriptManager.getInstance();
|
||||
|
||||
Item item = c.getPlayer().getInventory(ItemConstants.getInventoryType(itemId)).getItem(itemSlot);
|
||||
if (item == null || item.getItemId() != itemId || item.getQuantity() < 1 || !ism.scriptExists(info.getScript())) {
|
||||
if (item == null || item.getItemId() != itemId || item.getQuantity() < 1) {
|
||||
return;
|
||||
}
|
||||
ism.runItemScript(c, info.getScript());
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
//NPCScriptManager.getInstance().start(c, info.getNpc(), null, null);
|
||||
|
||||
ItemScriptManager ism = ItemScriptManager.getInstance();
|
||||
ism.runItemScript(c, info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ import tools.data.input.SeekableLittleEndianAccessor;
|
||||
* @author kevintjuh93
|
||||
*/
|
||||
public final class TrockAddMapHandler extends AbstractMaplePacketHandler {
|
||||
|
||||
@Override
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
byte type = slea.readByte();
|
||||
|
||||
@@ -53,6 +53,7 @@ import server.MapleShop;
|
||||
import server.MapleShopFactory;
|
||||
import server.TimerManager;
|
||||
import server.maps.AbstractMapleMapObject;
|
||||
import server.maps.FieldLimit;
|
||||
import server.maps.MaplePlayerShopItem;
|
||||
import server.maps.MapleKite;
|
||||
import server.maps.MapleMap;
|
||||
@@ -106,31 +107,32 @@ public final class UseCashItemHandler extends AbstractMaplePacketHandler {
|
||||
|
||||
if (itemType == 504) { // vip teleport rock
|
||||
String error1 = "Either the player could not be found or you were trying to teleport to an illegal location.";
|
||||
boolean vip = slea.readByte() == 1;
|
||||
boolean vip = slea.readByte() == 1 && itemId / 1000 >= 5041;
|
||||
remove(c, position, itemId);
|
||||
boolean success = false;
|
||||
if (!vip) {
|
||||
int mapId = slea.readInt();
|
||||
if (c.getChannelServer().getMapFactory().getMap(mapId).getForcedReturnId() == 999999999) {
|
||||
player.changeMap(c.getChannelServer().getMapFactory().getMap(mapId));
|
||||
if (itemId / 1000 >= 5041 || mapId / 100000000 == player.getMapId() / 100000000) { //check vip or same continent
|
||||
MapleMap targetMap = c.getChannelServer().getMapFactory().getMap(mapId);
|
||||
if (!FieldLimit.CANNOTVIPROCK.check(targetMap.getFieldLimit()) && (targetMap.getForcedReturnId() == 999999999 || mapId < 100000000)) {
|
||||
player.forceChangeMap(targetMap, targetMap.getRandomPlayerSpawnpoint());
|
||||
success = true;
|
||||
} else {
|
||||
player.dropMessage(1, error1);
|
||||
}
|
||||
} else {
|
||||
MapleInventoryManipulator.addById(c, itemId, (short) 1);
|
||||
player.dropMessage(1, error1);
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
player.dropMessage(1, "You cannot teleport between continents with this teleport rock.");
|
||||
}
|
||||
} else {
|
||||
String name = slea.readMapleAsciiString();
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(name);
|
||||
boolean success = false;
|
||||
|
||||
if (victim != null) {
|
||||
MapleMap target = victim.getMap();
|
||||
if (c.getChannelServer().getMapFactory().getMap(victim.getMapId()).getForcedReturnId() == 999999999 || victim.getMapId() < 100000000) {
|
||||
MapleMap targetMap = victim.getMap();
|
||||
if (!FieldLimit.CANNOTVIPROCK.check(targetMap.getFieldLimit()) && (targetMap.getForcedReturnId() == 999999999 || targetMap.getId() < 100000000)) {
|
||||
if (victim.gmLevel() <= player.gmLevel()) {
|
||||
if (itemId == 5041000 || victim.getMapId() / player.getMapId() == 1) { //viprock & same continent
|
||||
player.changeMap(target, target.findClosestPlayerSpawnpoint(victim.getPosition()));
|
||||
success = true;
|
||||
} else {
|
||||
player.dropMessage(1, "You cannot teleport between continents with this teleport rock.");
|
||||
}
|
||||
player.forceChangeMap(targetMap, targetMap.findClosestPlayerSpawnpoint(victim.getPosition()));
|
||||
success = true;
|
||||
} else {
|
||||
player.dropMessage(1, error1);
|
||||
}
|
||||
@@ -140,10 +142,11 @@ public final class UseCashItemHandler extends AbstractMaplePacketHandler {
|
||||
} else {
|
||||
player.dropMessage(1, "Player could not be found in this channel.");
|
||||
}
|
||||
if (!success) {
|
||||
MapleInventoryManipulator.addById(c, itemId, (short) 1);
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
}
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
MapleInventoryManipulator.addById(c, itemId, (short) 1);
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
}
|
||||
} else if (itemType == 505) { // AP/SP reset
|
||||
if(!player.isAlive()) {
|
||||
|
||||
@@ -25,8 +25,10 @@ import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import constants.ServerConstants;
|
||||
import client.MapleCharacter;
|
||||
@@ -56,6 +58,8 @@ public class MapleMonsterAggroCoordinator {
|
||||
private Map<MapleMonster, Map<Integer, PlayerAggroEntry>> mobAggroEntries = new HashMap<>();
|
||||
private Map<MapleMonster, List<PlayerAggroEntry>> mobSortedAggros = new HashMap<>();
|
||||
|
||||
private Set<Integer> mapPuppetEntries = new HashSet<>();
|
||||
|
||||
private class PlayerAggroEntry {
|
||||
protected int cid;
|
||||
protected int averageDamage = 0;
|
||||
@@ -291,6 +295,12 @@ public class MapleMonsterAggroCoordinator {
|
||||
}
|
||||
|
||||
public boolean isLeadingCharacterAggro(MapleMonster mob, MapleCharacter player) {
|
||||
if (mob.isLeadingPuppetInVicinity()) {
|
||||
return false;
|
||||
} else if (mob.isCharacterPuppetInVicinity(player)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// by assuming the quasi-sorted nature of "mobAggroList", this method
|
||||
// returns whether the player given as parameter can be elected as next aggro leader
|
||||
|
||||
@@ -342,6 +352,24 @@ public class MapleMonsterAggroCoordinator {
|
||||
}
|
||||
}
|
||||
|
||||
public void addPuppetAggro(MapleCharacter player) {
|
||||
synchronized (mapPuppetEntries) {
|
||||
mapPuppetEntries.add(player.getId());
|
||||
}
|
||||
}
|
||||
|
||||
public void removePuppetAggro(Integer cid) {
|
||||
synchronized (mapPuppetEntries) {
|
||||
mapPuppetEntries.remove(cid);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Integer> getPuppetAggroList() {
|
||||
synchronized (mapPuppetEntries) {
|
||||
return new ArrayList<>(mapPuppetEntries);
|
||||
}
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
stopAggroCoordinator();
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ public class MapleSessionCoordinator {
|
||||
}
|
||||
|
||||
private final LoginStorage loginStorage = new LoginStorage();
|
||||
private final Map<Integer, MapleClient> onlineClients = new HashMap<>();
|
||||
private final Set<String> onlineRemoteHwids = new HashSet<>();
|
||||
private final Map<String, Set<IoSession>> loginRemoteHosts = new HashMap<>();
|
||||
private final Set<String> pooledRemoteHosts = new HashSet<>();
|
||||
@@ -221,6 +222,24 @@ public class MapleSessionCoordinator {
|
||||
return ((InetSocketAddress) session.getRemoteAddress()).getAddress().getHostAddress();
|
||||
}
|
||||
|
||||
private static MapleClient getSessionClient(IoSession session) {
|
||||
return (MapleClient) session.getAttribute(MapleClient.CLIENT_KEY);
|
||||
}
|
||||
|
||||
public void updateOnlineSession(IoSession session) {
|
||||
MapleClient client = getSessionClient(session);
|
||||
|
||||
if (client != null) {
|
||||
int accountId = client.getAccID();
|
||||
MapleClient ingameClient = onlineClients.get(accountId);
|
||||
if (ingameClient != null) { // thanks MedicOP for finding out a loss of loggedin account uniqueness when using the CMS "Unstuck" feature
|
||||
ingameClient.forceDisconnect();
|
||||
}
|
||||
|
||||
onlineClients.put(accountId, client);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canStartLoginSession(IoSession session) {
|
||||
if (!ServerConstants.DETERRED_MULTICLIENT) return true;
|
||||
|
||||
@@ -296,6 +315,11 @@ public class MapleSessionCoordinator {
|
||||
String nibbleHwid = (String) session.removeAttribute(MapleClient.CLIENT_NIBBLEHWID);
|
||||
if (nibbleHwid != null) {
|
||||
onlineRemoteHwids.remove(nibbleHwid);
|
||||
|
||||
MapleClient client = getSessionClient(session);
|
||||
if (client != null) {
|
||||
onlineClients.remove(client.getAccID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,6 +472,11 @@ public class MapleSessionCoordinator {
|
||||
hwid = (String) session.removeAttribute(MapleClient.CLIENT_NIBBLEHWID); // making sure to clean up calls to this function on login phase
|
||||
onlineRemoteHwids.remove(hwid);
|
||||
|
||||
MapleClient client = getSessionClient(session);
|
||||
if (client != null) {
|
||||
onlineClients.remove(client.getAccID());
|
||||
}
|
||||
|
||||
if (immediately != null) {
|
||||
session.close(immediately);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,9 @@ public class MapleAlliance {
|
||||
|
||||
Server.getInstance().addAlliance(id, alliance);
|
||||
|
||||
Server.getInstance().allianceMessage(id, MaplePacketCreator.updateAllianceInfo(alliance, guildMasters.get(0).getClient()), -1, -1);
|
||||
int worldid = guildMasters.get(0).getWorld();
|
||||
Server.getInstance().allianceMessage(id, MaplePacketCreator.updateAllianceInfo(alliance, worldid), -1, -1);
|
||||
Server.getInstance().allianceMessage(id, MaplePacketCreator.getGuildAlliances(alliance, worldid), -1, -1); // thanks Vcoc for noticing guilds from other alliances being visually stacked here due to this not being updated
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
@@ -347,7 +349,7 @@ public class MapleAlliance {
|
||||
|
||||
public void updateAlliancePackets(MapleCharacter chr) {
|
||||
if (allianceId > 0) {
|
||||
this.broadcastMessage(MaplePacketCreator.updateAllianceInfo(this, chr.getClient()));
|
||||
this.broadcastMessage(MaplePacketCreator.updateAllianceInfo(this, chr.getWorld()));
|
||||
this.broadcastMessage(MaplePacketCreator.allianceNotice(this.getId(), this.getNotice()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,13 +78,13 @@ public final class CharSelectedHandler extends AbstractMaplePacketHandler {
|
||||
}
|
||||
|
||||
if (c.hasBannedMac() || c.hasBannedHWID()) {
|
||||
session.close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(session, true);
|
||||
return;
|
||||
}
|
||||
|
||||
Server server = Server.getInstance();
|
||||
if(!server.haveCharacterEntry(c.getAccID(), charId)) {
|
||||
session.close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(session, true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,13 +59,13 @@ public class CharSelectedWithPicHandler extends AbstractMaplePacketHandler {
|
||||
}
|
||||
|
||||
if (c.hasBannedMac() || c.hasBannedHWID()) {
|
||||
c.getSession().close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(c.getSession(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
Server server = Server.getInstance();
|
||||
if(!server.haveCharacterEntry(c.getAccID(), charId)) {
|
||||
c.getSession().close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(c.getSession(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ public final class LoginPasswordHandler implements MaplePacketHandler {
|
||||
c.setAccID(rs.getInt(1));
|
||||
rs.close();
|
||||
} catch (SQLException | NoSuchAlgorithmException | UnsupportedEncodingException e) {
|
||||
c.setAccID(-1);
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
disposeSql(con, ps);
|
||||
|
||||
@@ -59,13 +59,13 @@ public final class RegisterPicHandler extends AbstractMaplePacketHandler {
|
||||
}
|
||||
|
||||
if (c.hasBannedMac() || c.hasBannedHWID()) {
|
||||
c.getSession().close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(c.getSession(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
Server server = Server.getInstance();
|
||||
if(!server.haveCharacterEntry(c.getAccID(), charId)) {
|
||||
c.getSession().close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(c.getSession(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public final class RegisterPicHandler extends AbstractMaplePacketHandler {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
c.getSession().close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(c.getSession(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public final class ViewAllCharRegisterPicHandler extends AbstractMaplePacketHand
|
||||
c.updateHWID(hwid);
|
||||
|
||||
if (c.hasBannedMac() || c.hasBannedHWID()) {
|
||||
c.getSession().close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(c.getSession(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public final class ViewAllCharRegisterPicHandler extends AbstractMaplePacketHand
|
||||
|
||||
Server server = Server.getInstance();
|
||||
if(!server.haveCharacterEntry(c.getAccID(), charId)) {
|
||||
c.getSession().close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(c.getSession(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public final class ViewAllCharSelectedHandler extends AbstractMaplePacketHandler
|
||||
c.updateHWID(hwid);
|
||||
|
||||
if (c.hasBannedMac() || c.hasBannedHWID()) {
|
||||
c.getSession().close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(c.getSession(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public final class ViewAllCharSelectedHandler extends AbstractMaplePacketHandler
|
||||
|
||||
Server server = Server.getInstance();
|
||||
if(!server.haveCharacterEntry(c.getAccID(), charId)) {
|
||||
c.getSession().close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(c.getSession(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ViewAllCharSelectedWithPicHandler extends AbstractMaplePacketHandle
|
||||
c.updateHWID(hwid);
|
||||
|
||||
if (c.hasBannedMac() || c.hasBannedHWID()) {
|
||||
c.getSession().close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(c.getSession(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ViewAllCharSelectedWithPicHandler extends AbstractMaplePacketHandle
|
||||
|
||||
Server server = Server.getInstance();
|
||||
if(!server.haveCharacterEntry(c.getAccID(), charId)) {
|
||||
c.getSession().close(true);
|
||||
MapleSessionCoordinator.getInstance().closeSession(c.getSession(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user