diff --git a/src/engine/net/client/ClientConnection.java b/src/engine/net/client/ClientConnection.java index ad113a6a..b325c9f3 100644 --- a/src/engine/net/client/ClientConnection.java +++ b/src/engine/net/client/ClientConnection.java @@ -278,7 +278,7 @@ public class ClientConnection extends AbstractConnection { // case ClientOpcodes.ToggleSitStand: // case ClientOpcodes.SocialChannel: // case ClientOpcodes.OpenFriendsCondemnList: - case SELLOBJECT: + case SELLTONPC: this.setLastMsgTime(); break; case MOVETOPOINT: diff --git a/src/engine/net/client/Protocol.java b/src/engine/net/client/Protocol.java index 94fe8d4a..11ffd86a 100644 --- a/src/engine/net/client/Protocol.java +++ b/src/engine/net/client/Protocol.java @@ -54,7 +54,7 @@ public enum Protocol { BANISHMEMBER(0x31AA3368, BanishUnbanishMsg.class, BanishUnbanishHandler.class), // Banish/Unbanish BANKINVENTORY(0x32F3F503, ShowBankInventoryMsg.class, null), // ShowCombatInfo Bank Inventory BREAKFEALTY(0x479A4C19, BreakFealtyMsg.class, BreakFealtyHandler.class), - BUYFROMNPC(0xA2B8DFA5, BuyFromNPCMsg.class, BuyFromNPCMsgHandler.class), // Buy Item From NPC + BUYFROMNPC(0xA2B8DFA5, VendorBuyMsg.class, VendorBuyMsgHandler.class), // Buy Item From NPC CANCELGUILDCREATION(0x385EA922, GuildCreationCloseMsg.class, GuildCreationCloseHandler.class), //Close the window CHANGEALTITUDE(0x624F08BA, ChangeAltitudeMsg.class, ChangeAltitudeHandler.class), //Change Altitude CHANGEGUILDLEADER(0xE40BC95D, ChangeGuildLeaderMsg.class, ChangeGuildLeaderHandler.class), @@ -187,7 +187,7 @@ public enum Protocol { SELECTCHAR(0x7E6A9338, GameServerIPRequestMsg.class, null), // Game Server IP Request SELECTCITY(0x7E6BE630, null, null), SELECTSERVER(0x440D28B7, ServerInfoMsg.class, null), // Server Info Request/Response - SELLOBJECT(0x57111C67, SellToNPCMsg.class, SellToNPCMsgHandler.class), //Sell to NPC + SELLTONPC(0x57111C67, VendorSellMsg.class, VendorSellMsgHandler.class), //Sell to NPC SENDCITYENTRY(0xBC3B5E72, null, null), //Send Teleport/Repledge List SENDGUILDENTRY(0x6D5EF164, null, null), SENDMEMBERENTRY(0x6949C720, GuildListMsg.class, GuildListHandler.class), // ShowCombatInfo guild members list, I think diff --git a/src/engine/net/client/handlers/BuyFromNPCMsgHandler.java b/src/engine/net/client/handlers/VendorBuyMsgHandler.java similarity index 92% rename from src/engine/net/client/handlers/BuyFromNPCMsgHandler.java rename to src/engine/net/client/handlers/VendorBuyMsgHandler.java index b9bc5031..cf3e0277 100644 --- a/src/engine/net/client/handlers/BuyFromNPCMsgHandler.java +++ b/src/engine/net/client/handlers/VendorBuyMsgHandler.java @@ -13,18 +13,18 @@ import engine.exception.MsgSendException; import engine.gameManager.DbManager; import engine.gameManager.SessionManager; import engine.net.client.ClientConnection; -import engine.net.client.msg.BuyFromNPCMsg; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; +import engine.net.client.msg.VendorBuyMsg; import engine.objects.*; import org.pmw.tinylog.Logger; import java.util.ArrayList; -public class BuyFromNPCMsgHandler extends AbstractClientMsgHandler { +public class VendorBuyMsgHandler extends AbstractClientMsgHandler { - public BuyFromNPCMsgHandler() { - super(BuyFromNPCMsg.class); + public VendorBuyMsgHandler() { + super(VendorBuyMsg.class); } public static Item createItemForPlayer(PlayerCharacter pc, int templateID) { @@ -47,11 +47,11 @@ public class BuyFromNPCMsgHandler extends AbstractClientMsgHandler { // Member variable declaration - BuyFromNPCMsg buyFromNPCMsg; + VendorBuyMsg vendorBuyMsg; // Member variable assignment - buyFromNPCMsg = (BuyFromNPCMsg) baseMsg; + vendorBuyMsg = (VendorBuyMsg) baseMsg; PlayerCharacter sourcePlayer = SessionManager.getPlayerCharacter(origin); Item vendorItem; @@ -66,7 +66,7 @@ public class BuyFromNPCMsgHandler extends AbstractClientMsgHandler { if (itemMan == null) return true; - NPC npc = NPC.getFromCache(buyFromNPCMsg.getNPCID()); + NPC npc = NPC.getFromCache(vendorBuyMsg.getNPCID()); if (npc == null) return true; @@ -81,10 +81,10 @@ public class BuyFromNPCMsgHandler extends AbstractClientMsgHandler { if (sellInventory == null) return true; - if (buyFromNPCMsg.getItemID() < 0) { + if (vendorBuyMsg.getItemID() < 0) { for (Item me : sellInventory) { - if (me.objectUUID == buyFromNPCMsg.getItemID()) { + if (me.objectUUID == vendorBuyMsg.getItemID()) { //test room available for item if (!itemMan.hasRoomInventory(me.template.item_wt)) @@ -142,7 +142,7 @@ public class BuyFromNPCMsgHandler extends AbstractClientMsgHandler { if (npcCim == null) return true; - vendorItem = Item.getFromCache(buyFromNPCMsg.getItemID()); + vendorItem = Item.getFromCache(vendorBuyMsg.getItemID()); if (vendorItem == null) return true; diff --git a/src/engine/net/client/handlers/SellToNPCMsgHandler.java b/src/engine/net/client/handlers/VendorSellMsgHandler.java similarity index 89% rename from src/engine/net/client/handlers/SellToNPCMsgHandler.java rename to src/engine/net/client/handlers/VendorSellMsgHandler.java index 0eda5721..0fda1216 100644 --- a/src/engine/net/client/handlers/SellToNPCMsgHandler.java +++ b/src/engine/net/client/handlers/VendorSellMsgHandler.java @@ -17,16 +17,16 @@ import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; -import engine.net.client.msg.SellToNPCMsg; import engine.net.client.msg.UpdateGoldMsg; +import engine.net.client.msg.VendorSellMsg; import engine.objects.*; import java.util.ArrayList; -public class SellToNPCMsgHandler extends AbstractClientMsgHandler { +public class VendorSellMsgHandler extends AbstractClientMsgHandler { - public SellToNPCMsgHandler() { - super(SellToNPCMsg.class); + public VendorSellMsgHandler() { + super(VendorSellMsg.class); } @Override @@ -44,9 +44,9 @@ public class SellToNPCMsgHandler extends AbstractClientMsgHandler { if (itemMan == null) return true; - SellToNPCMsg sellToNPCMsg = (SellToNPCMsg) baseMsg; + VendorSellMsg vendorSellMsg = (VendorSellMsg) baseMsg; - NPC npc = NPC.getFromCache(sellToNPCMsg.getNPCID()); + NPC npc = NPC.getFromCache(vendorSellMsg.getNPCID()); if (npc == null) return true; @@ -81,10 +81,10 @@ public class SellToNPCMsgHandler extends AbstractClientMsgHandler { // Early exit sanity check - if (sellToNPCMsg.getItemType() == Enum.GameObjectType.Item.ordinal() == false) + if (vendorSellMsg.getItemType() == Enum.GameObjectType.Item.ordinal() == false) return true; - sell = Item.getFromCache(sellToNPCMsg.getItemID()); + sell = Item.getFromCache(vendorSellMsg.getItemID()); if (sell == null) return true; @@ -183,11 +183,11 @@ public class SellToNPCMsgHandler extends AbstractClientMsgHandler { DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); //send the sell message back to update player - sellToNPCMsg.setItemType(sell.getObjectType().ordinal()); - sellToNPCMsg.setItemID(sell.getObjectUUID()); - sellToNPCMsg.setUnknown01(cost); //not sure if this is correct + vendorSellMsg.setItemType(sell.getObjectType().ordinal()); + vendorSellMsg.setItemID(sell.getObjectUUID()); + vendorSellMsg.setUnknown01(cost); //not sure if this is correct - dispatch = Dispatch.borrow(player, sellToNPCMsg); + dispatch = Dispatch.borrow(player, vendorSellMsg); DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } finally { @@ -199,7 +199,7 @@ public class SellToNPCMsgHandler extends AbstractClientMsgHandler { // Send ping to client - dispatch = Dispatch.borrow(pc, sellToNPCMsg); + dispatch = Dispatch.borrow(pc, vendorSellMsg); DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); return true; diff --git a/src/engine/net/client/msg/BuyFromNPCMsg.java b/src/engine/net/client/msg/VendorBuyMsg.java similarity index 95% rename from src/engine/net/client/msg/BuyFromNPCMsg.java rename to src/engine/net/client/msg/VendorBuyMsg.java index 748ab1f8..58183e53 100644 --- a/src/engine/net/client/msg/BuyFromNPCMsg.java +++ b/src/engine/net/client/msg/VendorBuyMsg.java @@ -17,7 +17,7 @@ import engine.net.ByteBufferWriter; import engine.net.client.Protocol; import engine.objects.Item; -public class BuyFromNPCMsg extends ClientNetMsg { +public class VendorBuyMsg extends ClientNetMsg { private int npcType; private int npcID; @@ -29,7 +29,7 @@ public class BuyFromNPCMsg extends ClientNetMsg { /** * This is the general purpose constructor */ - public BuyFromNPCMsg() { + public VendorBuyMsg() { super(Protocol.BUYFROMNPC); } @@ -39,7 +39,7 @@ public class BuyFromNPCMsg extends ClientNetMsg { * past the limit) then this constructor Throws that Exception to the * caller. */ - public BuyFromNPCMsg(AbstractConnection origin, ByteBufferReader reader) { + public VendorBuyMsg(AbstractConnection origin, ByteBufferReader reader) { super(Protocol.BUYFROMNPC, origin, reader); } diff --git a/src/engine/net/client/msg/SellToNPCMsg.java b/src/engine/net/client/msg/VendorSellMsg.java similarity index 92% rename from src/engine/net/client/msg/SellToNPCMsg.java rename to src/engine/net/client/msg/VendorSellMsg.java index dba25dba..830400e4 100644 --- a/src/engine/net/client/msg/SellToNPCMsg.java +++ b/src/engine/net/client/msg/VendorSellMsg.java @@ -21,7 +21,7 @@ import engine.net.client.Protocol; * * @author Eighty */ -public class SellToNPCMsg extends ClientNetMsg { +public class VendorSellMsg extends ClientNetMsg { int npcType; int npcID; @@ -32,8 +32,8 @@ public class SellToNPCMsg extends ClientNetMsg { /** * This is the general purpose constructor */ - public SellToNPCMsg() { - super(Protocol.SELLOBJECT); + public VendorSellMsg() { + super(Protocol.SELLTONPC); } /** @@ -42,8 +42,8 @@ public class SellToNPCMsg extends ClientNetMsg { * past the limit) then this constructor Throws that Exception to the * caller. */ - public SellToNPCMsg(AbstractConnection origin, ByteBufferReader reader) { - super(Protocol.SELLOBJECT, origin, reader); + public VendorSellMsg(AbstractConnection origin, ByteBufferReader reader) { + super(Protocol.SELLTONPC, origin, reader); } /**