Handlers created for vendor buy/sell windows

This commit is contained in:
2024-03-24 10:34:41 -04:00
parent 083349b75b
commit 53b7aca0ce
6 changed files with 153 additions and 88 deletions
@@ -21,7 +21,7 @@ import engine.objects.*;
import java.util.ArrayList;
public class BuyFromNPCWindowMsg extends ClientNetMsg {
public class VendorBuyWindowMsg extends ClientNetMsg {
private int unknown01;
private int npcType;
@@ -33,9 +33,9 @@ public class BuyFromNPCWindowMsg extends ClientNetMsg {
/**
* This is the general purpose constructor
*/
public BuyFromNPCWindowMsg(int unknown01, int npcType, int npcID,
float unknown02, byte unknown03, int unknown04) {
super(Protocol.SHOPLIST);
public VendorBuyWindowMsg(int unknown01, int npcType, int npcID,
float unknown02, byte unknown03, int unknown04) {
super(Protocol.VENDORBUYWINDOW);
this.unknown01 = unknown01;
this.npcType = npcType;
this.npcID = npcID;
@@ -50,8 +50,8 @@ public class BuyFromNPCWindowMsg extends ClientNetMsg {
* past the limit) then this constructor Throws that Exception to the
* caller.
*/
public BuyFromNPCWindowMsg(AbstractConnection origin, ByteBufferReader reader) {
super(Protocol.SHOPLIST, origin, reader);
public VendorBuyWindowMsg(AbstractConnection origin, ByteBufferReader reader) {
super(Protocol.VENDORBUYWINDOW, origin, reader);
}
/**
@@ -24,7 +24,7 @@ import java.util.ArrayList;
*
* @author Eighty
*/
public class SellToNPCWindowMsg extends ClientNetMsg {
public class VendorSellWindowMsg extends ClientNetMsg {
//Item Types:
//1: weapon
@@ -53,10 +53,10 @@ public class SellToNPCWindowMsg extends ClientNetMsg {
/**
* This is the general purpose constructor
*/
public SellToNPCWindowMsg(int npcType, int npcID, byte unknownByte02,
ArrayList<Integer> itemTypes, ArrayList<Integer> skillTokens,
ArrayList<Integer> unknownArray02, float unknown05, int unknown06) {
super(Protocol.SHOPINFO);
public VendorSellWindowMsg(int npcType, int npcID, byte unknownByte02,
ArrayList<Integer> itemTypes, ArrayList<Integer> skillTokens,
ArrayList<Integer> unknownArray02, float unknown05, int unknown06) {
super(Protocol.VENDORSELLWINDOW);
this.npcType = npcType;
this.npcID = npcID;
this.unknownByte01 = (byte) 0;
@@ -75,8 +75,8 @@ public class SellToNPCWindowMsg extends ClientNetMsg {
/**
* This constructor is used by NetMsgFactory. It attempts to deserialize the ByteBuffer into a message. If a BufferUnderflow occurs (based on reading past the limit) then this constructor Throws that Exception to the caller.
*/
public SellToNPCWindowMsg(AbstractConnection origin, ByteBufferReader reader) {
super(Protocol.SHOPINFO, origin, reader);
public VendorSellWindowMsg(AbstractConnection origin, ByteBufferReader reader) {
super(Protocol.VENDORSELLWINDOW, origin, reader);
}
/**