Rename and clean up MapleClient

This commit is contained in:
P0nk
2021-09-09 21:13:48 +02:00
parent da8837710a
commit b07e6799dc
425 changed files with 1110 additions and 1109 deletions

View File

@@ -319,7 +319,7 @@ public class MapleItemInformationProvider {
return list;
}
private static short getExtraSlotMaxFromPlayer(MapleClient c, int itemId) {
private static short getExtraSlotMaxFromPlayer(Client c, int itemId) {
short ret = 0;
// thanks GMChuck for detecting player sensitive data being cached into getSlotMax
@@ -336,7 +336,7 @@ public class MapleItemInformationProvider {
return ret;
}
public short getSlotMax(MapleClient c, int itemId) {
public short getSlotMax(Client c, int itemId) {
Short slotMax = slotMaxCache.get(itemId);
if (slotMax != null) {
return (short)(slotMax + getExtraSlotMaxFromPlayer(c, itemId));

View File

@@ -20,7 +20,7 @@
package server;
import client.Character;
import client.MapleClient;
import client.Client;
import client.inventory.Inventory;
import client.inventory.InventoryType;
import client.inventory.Item;
@@ -69,7 +69,7 @@ public class MapleMarriage extends EventInstanceManager {
this.setObjectProperty("brideGiftlist", brideGifts);
}
public List<Item> getGiftItems(MapleClient c, boolean groom) {
public List<Item> getGiftItems(Client c, boolean groom) {
List<Item> gifts = getGiftItemsList(groom);
synchronized (gifts) {
return new LinkedList<>(gifts);
@@ -80,7 +80,7 @@ public class MapleMarriage extends EventInstanceManager {
return (List<Item>) this.getObjectProperty(groom ? "groomGiftlist" : "brideGiftlist");
}
public Item getGiftItem(MapleClient c, boolean groom, int idx) {
public Item getGiftItem(Client c, boolean groom, int idx) {
try {
return getGiftItems(c, groom).get(idx);
} catch (IndexOutOfBoundsException e) {
@@ -116,7 +116,7 @@ public class MapleMarriage extends EventInstanceManager {
return groom;
}
public static boolean claimGiftItems(MapleClient c, Character chr) {
public static boolean claimGiftItems(Client c, Character chr) {
List<Item> gifts = loadGiftItemsFromDb(c, chr.getId());
if (Inventory.checkSpot(chr, gifts)) {
try (Connection con = DatabaseConnection.getConnection()) {
@@ -135,7 +135,7 @@ public class MapleMarriage extends EventInstanceManager {
return false;
}
public static List<Item> loadGiftItemsFromDb(MapleClient c, int cid) {
public static List<Item> loadGiftItemsFromDb(Client c, int cid) {
List<Item> items = new LinkedList<>();
try {
@@ -149,11 +149,11 @@ public class MapleMarriage extends EventInstanceManager {
return items;
}
public void saveGiftItemsToDb(MapleClient c, boolean groom, int cid) {
public void saveGiftItemsToDb(Client c, boolean groom, int cid) {
MapleMarriage.saveGiftItemsToDb(c, getGiftItems(c, groom), cid);
}
public static void saveGiftItemsToDb(MapleClient c, List<Item> giftItems, int cid) {
public static void saveGiftItemsToDb(Client c, List<Item> giftItems, int cid) {
List<Pair<Item, InventoryType>> items = new LinkedList<>();
for (Item it : giftItems) {
items.add(new Pair<>(it, it.getInventoryType()));

View File

@@ -21,7 +21,7 @@
*/
package server;
import client.MapleClient;
import client.Client;
import client.inventory.InventoryType;
import client.inventory.Item;
import client.inventory.Pet;
@@ -74,12 +74,12 @@ public class MapleShop {
items.add(item);
}
public void sendShop(MapleClient c) {
public void sendShop(Client c) {
c.getPlayer().setShop(this);
c.sendPacket(PacketCreator.getNPCShop(c, getNpcId(), items));
}
public void buy(MapleClient c, short slot, int itemId, short quantity) {
public void buy(Client c, short slot, int itemId, short quantity) {
MapleShopItem item = findBySlot(slot);
if (item != null) {
if (item.getItemId() != itemId) {
@@ -186,7 +186,7 @@ public class MapleShop {
return quantity;
}
public void sell(MapleClient c, InventoryType type, short slot, short quantity) {
public void sell(Client c, InventoryType type, short slot, short quantity) {
if (quantity == 0xFFFF || quantity == 0) {
quantity = 1;
} else if (quantity < 0) {
@@ -209,7 +209,7 @@ public class MapleShop {
}
}
public void recharge(MapleClient c, short slot) {
public void recharge(Client c, short slot) {
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
Item item = c.getPlayer().getInventory(InventoryType.USE).getItem(slot);
if (item == null || !ItemConstants.isRechargeable(item.getItemId())) {

View File

@@ -18,7 +18,7 @@
*/
package server;
import client.MapleClient;
import client.Client;
import client.inventory.InventoryType;
import client.inventory.Item;
import client.inventory.ItemFactory;
@@ -224,7 +224,7 @@ public class MapleStorage {
}
}
public void sendStorage(MapleClient c, int npcId) {
public void sendStorage(Client c, int npcId) {
if (c.getPlayer().getLevel() < 15){
c.getPlayer().dropMessage(1, "You may only use the storage once you have reached level 15.");
c.sendPacket(PacketCreator.enableActions());
@@ -254,7 +254,7 @@ public class MapleStorage {
}
}
public void sendStored(MapleClient c, InventoryType type) {
public void sendStored(Client c, InventoryType type) {
lock.lock();
try {
c.sendPacket(PacketCreator.storeStorage(slots, type, typeItems.get(type)));
@@ -263,7 +263,7 @@ public class MapleStorage {
}
}
public void sendTakenOut(MapleClient c, InventoryType type) {
public void sendTakenOut(Client c, InventoryType type) {
lock.lock();
try {
c.sendPacket(PacketCreator.takeOutStorage(slots, type, typeItems.get(type)));
@@ -272,7 +272,7 @@ public class MapleStorage {
}
}
public void arrangeItems(MapleClient c) {
public void arrangeItems(Client c) {
lock.lock();
try {
MapleStorageInventory msi = new MapleStorageInventory(c, items);
@@ -300,7 +300,7 @@ public class MapleStorage {
this.meso = meso;
}
public void sendMeso(MapleClient c) {
public void sendMeso(Client c) {
c.sendPacket(PacketCreator.mesoStorage(slots, meso));
}

View File

@@ -19,7 +19,7 @@
*/
package server;
import client.MapleClient;
import client.Client;
import client.inventory.Equip;
import client.inventory.Item;
import config.YamlConfig;
@@ -173,11 +173,11 @@ class PairedQuicksort {
}
public class MapleStorageInventory {
private MapleClient c;
private Client c;
private Map<Short, Item> inventory = new LinkedHashMap<>();
private byte slotLimit;
public MapleStorageInventory(MapleClient c, List<Item> toSort) {
public MapleStorageInventory(Client c, List<Item> toSort) {
this.inventory = new LinkedHashMap<>();
this.slotLimit = (byte)toSort.size();
this.c = c;

View File

@@ -1017,7 +1017,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
}
@Override
public void sendSpawnData(MapleClient client) {
public void sendSpawnData(Client client) {
if (hp.get() <= 0) { // mustn't monsterLock this function
return;
}
@@ -1033,7 +1033,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
}
@Override
public void sendDestroyData(MapleClient client) {
public void sendDestroyData(Client client) {
client.sendPacket(PacketCreator.killMonster(getObjectId(), false));
client.sendPacket(PacketCreator.killMonster(getObjectId(), true));
}
@@ -2101,7 +2101,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
}
}
private static void aggroMonsterControl(MapleClient c, MapleMonster mob, boolean immediateAggro) {
private static void aggroMonsterControl(Client c, MapleMonster mob, boolean immediateAggro) {
c.sendPacket(PacketCreator.controlMonster(mob, false, immediateAggro));
}
@@ -2120,7 +2120,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
}
chrController.sendPacket(PacketCreator.removeSummon(puppet, false));
MapleClient c = chrController.getClient();
Client c = chrController.getClient();
for (MapleMonster mob : puppetControlled) { // thanks BHB for noticing puppets disrupting mobstatuses for bowmans
aggroMonsterControl(c, mob, mob.isControllerKnowsAboutAggro());
}

View File

@@ -21,7 +21,7 @@
*/
package server.life;
import client.MapleClient;
import client.Client;
import server.MapleShopFactory;
import server.maps.MapleMapObjectType;
import tools.PacketCreator;
@@ -38,18 +38,18 @@ public class MapleNPC extends AbstractLoadedMapleLife {
return MapleShopFactory.getInstance().getShopForNPC(getId()) != null;
}
public void sendShop(MapleClient c) {
public void sendShop(Client c) {
MapleShopFactory.getInstance().getShopForNPC(getId()).sendShop(c);
}
@Override
public void sendSpawnData(MapleClient client) {
public void sendSpawnData(Client client) {
client.sendPacket(PacketCreator.spawnNPC(this));
client.sendPacket(PacketCreator.spawnNPCRequestController(this, true));
}
@Override
public void sendDestroyData(MapleClient client) {
public void sendDestroyData(Client client) {
client.sendPacket(PacketCreator.removeNPCController(getObjectId()));
client.sendPacket(PacketCreator.removeNPC(getObjectId()));
}

View File

@@ -22,7 +22,7 @@
package server.life;
import client.Character;
import client.MapleClient;
import client.Client;
import client.inventory.InventoryType;
import client.inventory.Item;
import config.YamlConfig;
@@ -199,13 +199,13 @@ public class MaplePlayerNPC extends AbstractMapleMapObject {
}
@Override
public void sendSpawnData(MapleClient client) {
public void sendSpawnData(Client client) {
client.sendPacket(PacketCreator.spawnPlayerNPC(this));
client.sendPacket(PacketCreator.getPlayerNPC(this));
}
@Override
public void sendDestroyData(MapleClient client) {
public void sendDestroyData(Client client) {
client.sendPacket(PacketCreator.removeNPCController(this.getObjectId()));
client.sendPacket(PacketCreator.removePlayerNPC(this.getObjectId()));
}
@@ -588,7 +588,7 @@ public class MaplePlayerNPC extends AbstractMapleMapObject {
World wserv = Server.getInstance().getWorld(world);
if (wserv == null) return;
MapleClient c = MapleClient.createMock();
Client c = Client.createMock();
c.setWorld(world);
c.setChannel(1);

View File

@@ -20,7 +20,7 @@
package server.maps;
import client.Character;
import client.MapleClient;
import client.Client;
import net.server.audit.locks.MonitoredLockType;
import net.server.audit.locks.MonitoredReadLock;
import net.server.audit.locks.MonitoredReentrantReadWriteLock;
@@ -105,11 +105,11 @@ public class MapleDoorObject extends AbstractMapleMapObject {
}
@Override
public void sendSpawnData(MapleClient client) {
public void sendSpawnData(Client client) {
sendSpawnData(client, true);
}
public void sendSpawnData(MapleClient client, boolean launched) {
public void sendSpawnData(Client client, boolean launched) {
Character chr = client.getPlayer();
if (this.getFrom().getId() == chr.getMapId()) {
if (chr.getParty() != null && (this.getOwnerId() == chr.getId() || chr.getParty().getMemberById(this.getOwnerId()) != null)) {
@@ -124,7 +124,7 @@ public class MapleDoorObject extends AbstractMapleMapObject {
}
@Override
public void sendDestroyData(MapleClient client) {
public void sendDestroyData(Client client) {
Character chr = client.getPlayer();
if (from.getId() == chr.getMapId()) {
MapleParty party = chr.getParty();
@@ -135,7 +135,7 @@ public class MapleDoorObject extends AbstractMapleMapObject {
}
}
public void sendDestroyData(MapleClient client, boolean partyUpdate) {
public void sendDestroyData(Client client, boolean partyUpdate) {
if (client != null && from.getId() == client.getPlayer().getMapId()) {
client.sendPacket(PacketCreator.partyPortal(999999999, 999999999, new Point(-1, -1)));
client.sendPacket(PacketCreator.removeDoor(ownerId, inTown()));

View File

@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package server.maps;
import client.Character;
import client.MapleClient;
import client.Client;
import tools.PacketCreator;
@@ -45,7 +45,7 @@ public class MapleDragon extends AbstractAnimatedMapleMapObject {
}
@Override
public void sendSpawnData(MapleClient client) {
public void sendSpawnData(Client client) {
client.sendPacket(PacketCreator.spawnDragon(this));
}
@@ -55,7 +55,7 @@ public class MapleDragon extends AbstractAnimatedMapleMapObject {
}
@Override
public void sendDestroyData(MapleClient c) {
public void sendDestroyData(Client c) {
c.sendPacket(PacketCreator.removeDragon(owner.getId()));
}

View File

@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package server.maps;
import client.Character;
import client.MapleClient;
import client.Client;
import constants.game.GameConstants;
import net.server.audit.locks.MonitoredLockType;
import net.server.audit.locks.MonitoredReentrantLock;
@@ -128,7 +128,7 @@ public class MapleGenericPortal implements MaplePortal {
}
@Override
public void enterPortal(MapleClient c) {
public void enterPortal(Client c) {
boolean changed = false;
if (getScriptName() != null) {
try {

View File

@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package server.maps;
import client.Character;
import client.MapleClient;
import client.Client;
import client.inventory.Inventory;
import client.inventory.InventoryType;
import client.inventory.Item;
@@ -239,7 +239,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
}
}
private static boolean canBuy(MapleClient c, Item newItem) { // thanks xiaokelvin (Conrad) for noticing a leaked test code here
private static boolean canBuy(Client c, Item newItem) { // thanks xiaokelvin (Conrad) for noticing a leaked test code here
return InventoryManipulator.checkSpace(c, newItem.getItemId(), newItem.getQuantity(), newItem.getOwner()) && InventoryManipulator.addFromDrop(c, newItem, false);
}
@@ -257,7 +257,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
}
}
public void buy(MapleClient c, int item, short quantity) {
public void buy(Client c, int item, short quantity) {
synchronized (items) {
MaplePlayerShopItem pItem = items.get(item);
Item newItem = pItem.getItem().copy();
@@ -397,7 +397,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
}
}
private void closeShop(MapleClient c, boolean timeout) {
private void closeShop(Client c, boolean timeout) {
map.removeMapObject(this);
map.broadcastMessage(PacketCreator.removeHiredMerchantBox(ownerId));
c.getChannelServer().removeHiredMerchant(ownerId);
@@ -710,10 +710,10 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
}
@Override
public void sendDestroyData(MapleClient client) {}
public void sendDestroyData(Client client) {}
@Override
public void sendSpawnData(MapleClient client) {
public void sendSpawnData(Client client) {
client.sendPacket(PacketCreator.spawnHiredMerchantBox(this));
}

View File

@@ -1,7 +1,7 @@
package server.maps;
import client.Character;
import client.MapleClient;
import client.Client;
import net.packet.Packet;
import tools.PacketCreator;
@@ -42,12 +42,12 @@ public class MapleKite extends AbstractMapleMapObject {
}
@Override
public void sendDestroyData(MapleClient client) {
public void sendDestroyData(Client client) {
client.sendPacket(makeDestroyData());
}
@Override
public void sendSpawnData(MapleClient client) {
public void sendSpawnData(Client client) {
client.sendPacket(makeSpawnData());
}

View File

@@ -23,7 +23,7 @@ package server.maps;
import client.BuffStat;
import client.Character;
import client.MapleClient;
import client.Client;
import client.autoban.AutobanFactory;
import client.inventory.Equip;
import client.inventory.InventoryType;
@@ -2207,7 +2207,7 @@ public class MapleMap {
service.registerOverallAction(mapid, r, delay);
}
private void activateItemReactors(final MapleMapItem drop, final MapleClient c) {
private void activateItemReactors(final MapleMapItem drop, final Client c) {
final Item item = drop.getItem();
for (final MapleMapObject o : getReactors()) {
@@ -2247,7 +2247,7 @@ public class MapleMap {
if (item != null && reactItem == item.getItemId() && reactQty == item.getQuantity()) {
if (reactArea.contains(drop.getPosition())) {
MapleClient owner = drop.getOwnerClient();
Client owner = drop.getOwnerClient();
if(owner != null) {
registerMapSchedule(new ActivateItemReactor(drop, react, owner), 5000);
}
@@ -2579,7 +2579,7 @@ public class MapleMap {
announcePlayerDiseases(chr.getClient());
}
private static void announcePlayerDiseases(final MapleClient c) {
private static void announcePlayerDiseases(final Client c) {
Server.getInstance().registerAnnouncePlayerDiseases(c);
}
@@ -2923,7 +2923,7 @@ public class MapleMap {
}
}
private void sendObjectPlacement(MapleClient c) {
private void sendObjectPlacement(Client c) {
Character chr = c.getPlayer();
Collection<MapleMapObject> objects;
@@ -3413,9 +3413,9 @@ public class MapleMap {
private MapleMapItem mapitem;
private MapleReactor reactor;
private MapleClient c;
private Client c;
public ActivateItemReactor(MapleMapItem mapitem, MapleReactor reactor, MapleClient c) {
public ActivateItemReactor(MapleMapItem mapitem, MapleReactor reactor, Client c) {
this.mapitem = mapitem;
this.reactor = reactor;
this.c = c;
@@ -3661,7 +3661,7 @@ public class MapleMap {
private interface DelayedPacketCreation {
void sendPackets(MapleClient c);
void sendPackets(Client c);
}
private interface SpawnCondition {

View File

@@ -21,7 +21,7 @@
*/
package server.maps;
import client.MapleClient;
import client.Client;
import net.packet.Packet;
import tools.PacketCreator;
@@ -43,7 +43,7 @@ public class MapleMapEffect {
return PacketCreator.startMapEffect(msg, itemId, active);
}
public void sendStartData(MapleClient client) {
public void sendStartData(Client client) {
client.sendPacket(makeStartData());
}
}

View File

@@ -21,7 +21,7 @@
package server.maps;
import client.Character;
import client.MapleClient;
import client.Client;
import client.inventory.Item;
import net.server.audit.locks.MonitoredLockType;
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
@@ -31,7 +31,7 @@ import java.awt.*;
import java.util.concurrent.locks.Lock;
public class MapleMapItem extends AbstractMapleMapObject {
protected MapleClient ownerClient;
protected Client ownerClient;
protected Item item;
protected MapleMapObject dropper;
protected int character_ownerid, party_ownerid, meso, questid = -1;
@@ -40,7 +40,7 @@ public class MapleMapItem extends AbstractMapleMapObject {
protected long dropTime;
private Lock itemLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.MAP_ITEM);
public MapleMapItem(Item item, Point position, MapleMapObject dropper, Character owner, MapleClient ownerClient, byte type, boolean playerDrop) {
public MapleMapItem(Item item, Point position, MapleMapObject dropper, Character owner, Client ownerClient, byte type, boolean playerDrop) {
setPosition(position);
this.item = item;
this.dropper = dropper;
@@ -53,7 +53,7 @@ public class MapleMapItem extends AbstractMapleMapObject {
this.playerDrop = playerDrop;
}
public MapleMapItem(Item item, Point position, MapleMapObject dropper, Character owner, MapleClient ownerClient, byte type, boolean playerDrop, int questid) {
public MapleMapItem(Item item, Point position, MapleMapObject dropper, Character owner, Client ownerClient, byte type, boolean playerDrop, int questid) {
setPosition(position);
this.item = item;
this.dropper = dropper;
@@ -67,7 +67,7 @@ public class MapleMapItem extends AbstractMapleMapObject {
this.questid = questid;
}
public MapleMapItem(int meso, Point position, MapleMapObject dropper, Character owner, MapleClient ownerClient, byte type, boolean playerDrop) {
public MapleMapItem(int meso, Point position, MapleMapObject dropper, Character owner, Client ownerClient, byte type, boolean playerDrop) {
setPosition(position);
this.item = null;
this.dropper = dropper;
@@ -153,7 +153,7 @@ public class MapleMapItem extends AbstractMapleMapObject {
return hasExpiredOwnershipTime();
}
public final MapleClient getOwnerClient() {
public final Client getOwnerClient() {
return (ownerClient.isLoggedIn() && !ownerClient.getPlayer().isAwayFromWorld()) ? ownerClient : null;
}
@@ -199,7 +199,7 @@ public class MapleMapItem extends AbstractMapleMapObject {
}
@Override
public void sendSpawnData(final MapleClient client) {
public void sendSpawnData(final Client client) {
Character chr = client.getPlayer();
if (chr.needQuestItem(questid, getItemId())) {
@@ -213,7 +213,7 @@ public class MapleMapItem extends AbstractMapleMapObject {
}
@Override
public void sendDestroyData(final MapleClient client) {
public void sendDestroyData(final Client client) {
client.sendPacket(PacketCreator.removeItemFromMap(getObjectId(), 1, 0));
}
}

View File

@@ -21,7 +21,7 @@
*/
package server.maps;
import client.MapleClient;
import client.Client;
import java.awt.*;
@@ -31,7 +31,7 @@ public interface MapleMapObject {
MapleMapObjectType getType();
Point getPosition();
void setPosition(Point position);
void sendSpawnData(MapleClient client);
void sendDestroyData(MapleClient client);
void sendSpawnData(Client client);
void sendDestroyData(Client client);
void nullifyPosition();
}

View File

@@ -22,7 +22,7 @@
package server.maps;
import client.Character;
import client.MapleClient;
import client.Client;
import net.packet.Packet;
import net.server.Server;
import tools.PacketCreator;
@@ -156,7 +156,7 @@ public class MapleMiniGame extends AbstractMapleMapObject {
}
public void broadcastToOwner(Packet packet) {
MapleClient c = owner.getClient();
Client c = owner.getClient();
if (c != null) {
c.sendPacket(packet);
}
@@ -390,15 +390,15 @@ public class MapleMiniGame extends AbstractMapleMapObject {
broadcastToVisitor(packet);
}
public void chat(MapleClient c, String chat) {
public void chat(Client c, String chat) {
broadcast(PacketCreator.getPlayerShopChat(c.getPlayer(), chat, isOwner(c.getPlayer())));
}
public void sendOmok(MapleClient c, int type) {
public void sendOmok(Client c, int type) {
c.sendPacket(PacketCreator.getMiniGame(c, this, isOwner(c.getPlayer()), type));
}
public void sendMatchCard(MapleClient c, int type) {
public void sendMatchCard(Client c, int type) {
c.sendPacket(PacketCreator.getMatchCard(c, this, isOwner(c.getPlayer()), type));
}
@@ -510,10 +510,10 @@ public class MapleMiniGame extends AbstractMapleMapObject {
}
@Override
public void sendDestroyData(MapleClient client) {}
public void sendDestroyData(Client client) {}
@Override
public void sendSpawnData(MapleClient client) {}
public void sendSpawnData(Client client) {}
@Override
public MapleMapObjectType getType() {

View File

@@ -22,7 +22,7 @@
package server.maps;
import client.Character;
import client.MapleClient;
import client.Client;
import client.Skill;
import client.SkillFactory;
import constants.skills.*;
@@ -148,12 +148,12 @@ public class MapleMist extends AbstractMapleMapObject {
}
@Override
public void sendSpawnData(MapleClient client) {
public void sendSpawnData(Client client) {
client.sendPacket(makeSpawnData());
}
@Override
public void sendDestroyData(MapleClient client) {
public void sendDestroyData(Client client) {
client.sendPacket(makeDestroyData());
}

View File

@@ -22,7 +22,7 @@
package server.maps;
import client.Character;
import client.MapleClient;
import client.Client;
import client.inventory.Inventory;
import client.inventory.InventoryType;
import client.inventory.Item;
@@ -212,7 +212,7 @@ public class MaplePlayerShop extends AbstractMapleMapObject {
items.remove(slot);
}
private static boolean canBuy(MapleClient c, Item newItem) {
private static boolean canBuy(Client c, Item newItem) {
return InventoryManipulator.checkSpace(c, newItem.getItemId(), newItem.getQuantity(), newItem.getOwner()) && InventoryManipulator.addFromDrop(c, newItem, false);
}
@@ -245,7 +245,7 @@ public class MaplePlayerShop extends AbstractMapleMapObject {
* @param item
* @param quantity
*/
public boolean buy(MapleClient c, int item, short quantity) {
public boolean buy(Client c, int item, short quantity) {
synchronized (items) {
if (isVisitor(c.getPlayer())) {
MaplePlayerShopItem pItem = items.get(item);
@@ -376,7 +376,7 @@ public class MaplePlayerShop extends AbstractMapleMapObject {
}
public void broadcast(Packet packet) {
MapleClient client = owner.getClient();
Client client = owner.getClient();
if (client != null) {
client.sendPacket(packet);
}
@@ -399,7 +399,7 @@ public class MaplePlayerShop extends AbstractMapleMapObject {
return s;
}
public void chat(MapleClient c, String chat) {
public void chat(Client c, String chat) {
byte s = getVisitorSlot(c.getPlayer());
synchronized(chatLog) {
@@ -434,7 +434,7 @@ public class MaplePlayerShop extends AbstractMapleMapObject {
owner.getMap().broadcastMessage(PacketCreator.removePlayerShopBox(this));
}
public void sendShop(MapleClient c) {
public void sendShop(Client c) {
visitorLock.lock();
try {
c.sendPacket(PacketCreator.getPlayerShop(this, isOwner(c.getPlayer())));
@@ -561,12 +561,12 @@ public class MaplePlayerShop extends AbstractMapleMapObject {
}
@Override
public void sendDestroyData(MapleClient client) {
public void sendDestroyData(Client client) {
client.sendPacket(PacketCreator.removePlayerShopBox(this));
}
@Override
public void sendSpawnData(MapleClient client) {
public void sendSpawnData(Client client) {
client.sendPacket(PacketCreator.updatePlayerShopBox(this));
}

View File

@@ -21,7 +21,7 @@
*/
package server.maps;
import client.MapleClient;
import client.Client;
import java.awt.*;
@@ -41,7 +41,7 @@ public interface MaplePortal {
void setPortalStatus(boolean newStatus);
boolean getPortalStatus();
int getTargetMapId();
void enterPortal(MapleClient c);
void enterPortal(Client c);
void setPortalState(boolean state);
boolean getPortalState();
}

View File

@@ -21,7 +21,7 @@
*/
package server.maps;
import client.MapleClient;
import client.Client;
import config.YamlConfig;
import net.packet.Packet;
import net.server.audit.locks.MonitoredLockType;
@@ -166,7 +166,7 @@ public class MapleReactor extends AbstractMapleMapObject {
}
@Override
public void sendDestroyData(MapleClient client) {
public void sendDestroyData(Client client) {
client.sendPacket(makeDestroyData());
}
@@ -175,7 +175,7 @@ public class MapleReactor extends AbstractMapleMapObject {
}
@Override
public void sendSpawnData(MapleClient client) {
public void sendSpawnData(Client client) {
if (this.isAlive()) {
client.sendPacket(makeSpawnData());
}
@@ -238,15 +238,15 @@ public class MapleReactor extends AbstractMapleMapObject {
}
}
public void delayedHitReactor(final MapleClient c, long delay) {
public void delayedHitReactor(final Client c, long delay) {
TimerManager.getInstance().schedule(() -> hitReactor(c), delay);
}
public void hitReactor(MapleClient c) {
public void hitReactor(Client c) {
hitReactor(false, 0, (short) 0, 0, c);
}
public void hitReactor(boolean wHit, int charPos, short stance, int skillid, MapleClient c) {
public void hitReactor(boolean wHit, int charPos, short stance, int skillid, Client c) {
try {
if (!this.isActive()) {
return;

View File

@@ -22,7 +22,7 @@
package server.maps;
import client.Character;
import client.MapleClient;
import client.Client;
import client.SkillFactory;
import tools.PacketCreator;
@@ -49,12 +49,12 @@ public class MapleSummon extends AbstractAnimatedMapleMapObject {
}
@Override
public void sendSpawnData(MapleClient client) {
public void sendSpawnData(Client client) {
client.sendPacket(PacketCreator.spawnSummon(this, false));
}
@Override
public void sendDestroyData(MapleClient client) {
public void sendDestroyData(Client client) {
client.sendPacket(PacketCreator.removeSummon(this, true));
}

View File

@@ -1,6 +1,6 @@
package server.minigame;
import client.MapleClient;
import client.Client;
import client.inventory.Item;
import client.inventory.manipulator.InventoryManipulator;
import tools.PacketCreator;
@@ -17,14 +17,14 @@ public class MapleRockPaperScissor{
private boolean ableAnswer = true;
private boolean win = false;
public MapleRockPaperScissor(final MapleClient c, final byte mode){
public MapleRockPaperScissor(final Client c, final byte mode){
c.sendPacket(PacketCreator.rpsMode((byte) (9 + mode)));
if(mode == 0){
c.getPlayer().gainMeso(-1000, true, true, true);
}
}
public final boolean answer(final MapleClient c, final int answer){
public final boolean answer(final Client c, final int answer){
if(ableAnswer && !win && answer >= 0 && answer <= 2){
final int response = Randomizer.nextInt(3);
if(response == answer){
@@ -44,7 +44,7 @@ public class MapleRockPaperScissor{
return false;
}
public final boolean timeOut(final MapleClient c){
public final boolean timeOut(final Client c){
if(ableAnswer && !win){
ableAnswer = false;
c.sendPacket(PacketCreator.rpsMode((byte) 0x0A));
@@ -54,7 +54,7 @@ public class MapleRockPaperScissor{
return false;
}
public final boolean nextRound(final MapleClient c){
public final boolean nextRound(final Client c){
if(win){
round++;
if(round < 10){
@@ -70,14 +70,14 @@ public class MapleRockPaperScissor{
return false;
}
public final void reward(final MapleClient c){
public final void reward(final Client c){
if(win){
InventoryManipulator.addFromDrop(c, new Item(4031332 + round, (short) 0, (short) 1), true);
}
c.getPlayer().setRPS(null);
}
public final void dispose(final MapleClient c){
public final void dispose(final Client c){
reward(c);
c.sendPacket(PacketCreator.rpsMode((byte) 0x0D));
}

View File

@@ -22,7 +22,7 @@
package server.quest.actions;
import client.Character;
import client.MapleClient;
import client.Client;
import client.inventory.InventoryType;
import client.inventory.Item;
import client.inventory.manipulator.InventoryManipulator;
@@ -204,7 +204,7 @@ public class ItemAction extends MapleQuestAction {
if(!randomList.isEmpty()) {
int result;
MapleClient c = chr.getClient();
Client c = chr.getClient();
List<Integer> rndUsed = new ArrayList(5);
for(byte i = 0; i < 5; i++) rndUsed.add(allSlotUsed.get(i));

View File

@@ -20,7 +20,7 @@
package server.quest.actions;
import client.Character;
import client.MapleClient;
import client.Client;
import client.inventory.Pet;
import provider.MapleData;
import server.quest.MapleQuest;
@@ -43,7 +43,7 @@ public class PetSpeedAction extends MapleQuestAction {
@Override
public void run(Character chr, Integer extSelection) {
MapleClient c = chr.getClient();
Client c = chr.getClient();
Pet pet = chr.getPet(0); // assuming here only the pet leader will gain owner speed
if(pet == null) return;

View File

@@ -20,7 +20,7 @@
package server.quest.actions;
import client.Character;
import client.MapleClient;
import client.Client;
import client.inventory.Pet;
import provider.MapleData;
import provider.MapleDataTool;
@@ -48,7 +48,7 @@ public class PetTamenessAction extends MapleQuestAction {
@Override
public void run(Character chr, Integer extSelection) {
MapleClient c = chr.getClient();
Client c = chr.getClient();
Pet pet = chr.getPet(0); // assuming here only the pet leader will gain tameness
if(pet == null) return;