Rename and clean up MapleClient
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
package client.processor.action; // thanks Alex for pointing out some package structures containing broad modules
|
||||
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.Client;
|
||||
import server.maps.MapleMap;
|
||||
import tools.PacketCreator;
|
||||
|
||||
@@ -30,7 +30,7 @@ import tools.PacketCreator;
|
||||
*/
|
||||
public class BuybackProcessor {
|
||||
|
||||
public static void processBuyback(MapleClient c) {
|
||||
public static void processBuyback(Client c) {
|
||||
Character chr = c.getPlayer();
|
||||
boolean buyback;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package client.processor.action;
|
||||
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.Client;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
@@ -49,7 +49,7 @@ public class MakerProcessor {
|
||||
|
||||
private static MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
|
||||
public static void makerAction(InPacket p, MapleClient c) {
|
||||
public static void makerAction(InPacket p, Client c) {
|
||||
if (c.tryacquireClient()) {
|
||||
try {
|
||||
int type = p.readInt();
|
||||
@@ -308,7 +308,7 @@ public class MakerProcessor {
|
||||
return chr.getSkillLevel((chr.getJob().getId() / 1000) * 10000000 + 1007);
|
||||
}
|
||||
|
||||
private static short getCreateStatus(MapleClient c, MakerItemCreateEntry recipe) {
|
||||
private static short getCreateStatus(Client c, MakerItemCreateEntry recipe) {
|
||||
if(recipe.isInvalid()) {
|
||||
return -1;
|
||||
}
|
||||
@@ -351,7 +351,7 @@ public class MakerProcessor {
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static boolean hasItems(MapleClient c, MakerItemCreateEntry recipe) {
|
||||
private static boolean hasItems(Client c, MakerItemCreateEntry recipe) {
|
||||
for (Pair<Integer, Integer> p : recipe.getReqItems()) {
|
||||
int itemId = p.getLeft();
|
||||
if (c.getPlayer().getInventory(ItemConstants.getInventoryType(itemId)).countById(itemId) < p.getRight()) {
|
||||
@@ -361,7 +361,7 @@ public class MakerProcessor {
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean addBoostedMakerItem(MapleClient c, int itemid, int stimulantid, Map<Integer, Short> reagentids) {
|
||||
private static boolean addBoostedMakerItem(Client c, int itemid, int stimulantid, Map<Integer, Short> reagentids) {
|
||||
if(stimulantid != -1 && !ii.rollSuccessChance(90.0)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package client.processor.action;
|
||||
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.Client;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
@@ -42,7 +42,7 @@ public class PetAutopotProcessor {
|
||||
|
||||
private static class AutopotAction {
|
||||
|
||||
private MapleClient c;
|
||||
private Client c;
|
||||
private short slot;
|
||||
private int itemId;
|
||||
|
||||
@@ -73,14 +73,14 @@ public class PetAutopotProcessor {
|
||||
return false;
|
||||
}
|
||||
|
||||
public AutopotAction(MapleClient c, short slot, int itemId) {
|
||||
public AutopotAction(Client c, short slot, int itemId) {
|
||||
this.c = c;
|
||||
this.slot = slot;
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
MapleClient c = this.c;
|
||||
Client c = this.c;
|
||||
Character chr = c.getPlayer();
|
||||
if (!chr.isAlive()) {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
@@ -183,7 +183,7 @@ public class PetAutopotProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
public static void runAutopotAction(MapleClient c, short slot, int itemid) {
|
||||
public static void runAutopotAction(Client c, short slot, int itemid) {
|
||||
AutopotAction action = new AutopotAction(c, slot, itemid);
|
||||
action.run();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package client.processor.action;
|
||||
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.Client;
|
||||
import client.SkillFactory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Pet;
|
||||
@@ -40,7 +40,7 @@ import java.awt.*;
|
||||
public class SpawnPetProcessor {
|
||||
private static final MapleDataProvider dataRoot = MapleDataProviderFactory.getDataProvider(WZFiles.ITEM);
|
||||
|
||||
public static void processSpawnPet(MapleClient c, byte slot, boolean lead) {
|
||||
public static void processSpawnPet(Client c, byte slot, boolean lead) {
|
||||
if (c.tryacquireClient()) {
|
||||
try {
|
||||
Character chr = c.getPlayer();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
package client.processor.npc;
|
||||
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.Client;
|
||||
import client.autoban.AutobanFactory;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
@@ -106,7 +106,7 @@ public class DueyProcessor {
|
||||
return ids;
|
||||
}
|
||||
|
||||
private static void showDueyNotification(MapleClient c, Character player) {
|
||||
private static void showDueyNotification(Client c, Character player) {
|
||||
try (Connection con = DatabaseConnection.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT SenderName, Type FROM dueypackages WHERE ReceiverId = ? AND Checked = 1 ORDER BY Type DESC")) {
|
||||
|
||||
@@ -237,7 +237,7 @@ public class DueyProcessor {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static int addPackageItemFromInventory(int packageId, MapleClient c, byte invTypeId, short itemPos, short amount) {
|
||||
private static int addPackageItemFromInventory(int packageId, Client c, byte invTypeId, short itemPos, short amount) {
|
||||
if (invTypeId > 0) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
|
||||
@@ -278,7 +278,7 @@ public class DueyProcessor {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void dueySendItem(MapleClient c, byte invTypeId, short itemPos, short amount, int sendMesos, String sendMessage, String recipient, boolean quick) {
|
||||
public static void dueySendItem(Client c, byte invTypeId, short itemPos, short amount, int sendMesos, String sendMessage, String recipient, boolean quick) {
|
||||
if (c.tryacquireClient()) {
|
||||
try {
|
||||
int fee = MapleTrade.getFee(sendMesos);
|
||||
@@ -343,7 +343,7 @@ public class DueyProcessor {
|
||||
c.sendPacket(PacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_INCORRECT_REQUEST.getCode()));
|
||||
}
|
||||
|
||||
MapleClient rClient = null;
|
||||
Client rClient = null;
|
||||
int channel = c.getWorldServer().find(recipient);
|
||||
if (channel > -1) {
|
||||
Channel rcserv = c.getWorldServer().getChannel(channel);
|
||||
@@ -364,7 +364,7 @@ public class DueyProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
public static void dueyRemovePackage(MapleClient c, int packageid, boolean playerRemove) {
|
||||
public static void dueyRemovePackage(Client c, int packageid, boolean playerRemove) {
|
||||
if (c.tryacquireClient()) {
|
||||
try {
|
||||
removePackageFromDB(packageid);
|
||||
@@ -375,7 +375,7 @@ public class DueyProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
public static void dueyClaimPackage(MapleClient c, int packageId) {
|
||||
public static void dueyClaimPackage(Client c, int packageId) {
|
||||
if (c.tryacquireClient()) {
|
||||
try {
|
||||
try {
|
||||
@@ -435,7 +435,7 @@ public class DueyProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
public static void dueySendTalk(MapleClient c, boolean quickDelivery) {
|
||||
public static void dueySendTalk(Client c, boolean quickDelivery) {
|
||||
if (c.tryacquireClient()) {
|
||||
try {
|
||||
long timeNow = System.currentTimeMillis();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
package client.processor.npc;
|
||||
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.Client;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
@@ -264,7 +264,7 @@ public class FredrickProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
public static void fredrickRetrieveItems(MapleClient c) { // thanks Gustav for pointing out the dupe on Fredrick handling
|
||||
public static void fredrickRetrieveItems(Client c) { // thanks Gustav for pointing out the dupe on Fredrick handling
|
||||
if (c.tryacquireClient()) {
|
||||
try {
|
||||
Character chr = c.getPlayer();
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package client.processor.npc;
|
||||
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.Client;
|
||||
import client.autoban.AutobanFactory;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
@@ -44,7 +44,7 @@ import tools.PacketCreator;
|
||||
*/
|
||||
public class StorageProcessor {
|
||||
|
||||
public static void storageAction(InPacket p, MapleClient c) {
|
||||
public static void storageAction(InPacket p, Client c) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
Character chr = c.getPlayer();
|
||||
MapleStorage storage = chr.getStorage();
|
||||
|
||||
@@ -46,7 +46,7 @@ import java.util.List;
|
||||
*/
|
||||
public class AssignAPProcessor {
|
||||
|
||||
public static void APAutoAssignAction(InPacket inPacket, MapleClient c) {
|
||||
public static void APAutoAssignAction(InPacket inPacket, Client c) {
|
||||
Character chr = c.getPlayer();
|
||||
if (chr.getRemainingAp() < 1) return;
|
||||
|
||||
@@ -418,7 +418,7 @@ public class AssignAPProcessor {
|
||||
return MapleStat.STR;
|
||||
}
|
||||
|
||||
public static boolean APResetAction(MapleClient c, int APFrom, int APTo) {
|
||||
public static boolean APResetAction(Client c, int APFrom, int APTo) {
|
||||
c.lockClient();
|
||||
try {
|
||||
Character player = c.getPlayer();
|
||||
@@ -558,7 +558,7 @@ public class AssignAPProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
public static void APAssignAction(MapleClient c, int num) {
|
||||
public static void APAssignAction(Client c, int num) {
|
||||
c.lockClient();
|
||||
try {
|
||||
addStat(c.getPlayer(), num, false);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
package client.processor.stat;
|
||||
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.Client;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.autoban.AutobanFactory;
|
||||
@@ -39,7 +39,7 @@ import tools.PacketCreator;
|
||||
*/
|
||||
public class AssignSPProcessor {
|
||||
|
||||
public static boolean canSPAssign(MapleClient c, int skillid) {
|
||||
public static boolean canSPAssign(Client c, int skillid) {
|
||||
if (skillid == Aran.HIDDEN_FULL_DOUBLE || skillid == Aran.HIDDEN_FULL_TRIPLE || skillid == Aran.HIDDEN_OVER_DOUBLE || skillid == Aran.HIDDEN_OVER_TRIPLE) {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return false;
|
||||
@@ -57,7 +57,7 @@ public class AssignSPProcessor {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void SPAssignAction(MapleClient c, int skillid) {
|
||||
public static void SPAssignAction(Client c, int skillid) {
|
||||
c.lockClient();
|
||||
try {
|
||||
if (!canSPAssign(c, skillid)) {
|
||||
|
||||
Reference in New Issue
Block a user