mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-05 20:12:51 -04:00
Started work on bazaar
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class AcceptAuctionResponseMessage extends SWGMessage {
|
||||
|
||||
private long itemId;
|
||||
private int error;
|
||||
|
||||
public AcceptAuctionResponseMessage(long itemId, int error) {
|
||||
this.itemId = itemId;
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
IoBuffer result = IoBuffer.allocate(18).order(ByteOrder.LITTLE_ENDIAN);
|
||||
result.putShort((short) 3);
|
||||
result.putInt(0xC58A446E);
|
||||
result.putLong(itemId);
|
||||
result.putInt(error);
|
||||
return result.flip();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class AuctionItemDescriptionMessage extends SWGMessage {
|
||||
|
||||
private long itemId;
|
||||
private String description;
|
||||
|
||||
public AuctionItemDescriptionMessage(long itemId, String description) {
|
||||
this.itemId = itemId;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
IoBuffer result = IoBuffer.allocate(26 + (description.length() * 2)).order(ByteOrder.LITTLE_ENDIAN);
|
||||
result.putShort((short) 2);
|
||||
result.putInt(0xFE0E644B);
|
||||
result.putLong(itemId);
|
||||
result.put(getUnicodeString(description));
|
||||
result.putInt(0);
|
||||
result.putInt(0);
|
||||
return result.flip();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class AuctionQueryHeadersMessage extends SWGMessage {
|
||||
|
||||
private int range;
|
||||
private int counter;
|
||||
private int screen;
|
||||
private int category;
|
||||
private int itemTypeCRC;
|
||||
private String searchString;
|
||||
private int unkInt;
|
||||
private int minPrice;
|
||||
private int maxPrice;
|
||||
private byte includeEntranceFee;
|
||||
private long vendorId;
|
||||
private byte vendorFlag;
|
||||
private short offset;
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
data.skip(6);
|
||||
setRange(data.getInt());
|
||||
setCounter(data.getInt());
|
||||
setScreen(data.getInt());
|
||||
setCategory(data.getInt());
|
||||
setItemTypeCRC(data.getInt());
|
||||
int size = data.getInt();
|
||||
try {
|
||||
setSearchString(new String(ByteBuffer.allocate(size * 2).put(data.array(), data.position(), size * 2).array(), "UTF-16LE"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
data.position(data.position() + size * 2);
|
||||
setUnkInt(data.getInt());
|
||||
setMinPrice(data.getInt());
|
||||
setMaxPrice(data.getInt());
|
||||
setIncludeEntranceFee(data.get());
|
||||
data.skip(5); // unk
|
||||
setVendorId(data.getLong());
|
||||
setVendorFlag(data.get());
|
||||
setOffset(data.getShort());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getRange() {
|
||||
return range;
|
||||
}
|
||||
|
||||
public void setRange(int range) {
|
||||
this.range = range;
|
||||
}
|
||||
|
||||
public int getCounter() {
|
||||
return counter;
|
||||
}
|
||||
|
||||
public void setCounter(int counter) {
|
||||
this.counter = counter;
|
||||
}
|
||||
|
||||
public int getScreen() {
|
||||
return screen;
|
||||
}
|
||||
|
||||
public void setScreen(int screen) {
|
||||
this.screen = screen;
|
||||
}
|
||||
|
||||
public int getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(int category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public int getItemTypeCRC() {
|
||||
return itemTypeCRC;
|
||||
}
|
||||
|
||||
public void setItemTypeCRC(int itemTypeCRC) {
|
||||
this.itemTypeCRC = itemTypeCRC;
|
||||
}
|
||||
|
||||
public String getSearchString() {
|
||||
return searchString;
|
||||
}
|
||||
|
||||
public void setSearchString(String searchString) {
|
||||
this.searchString = searchString;
|
||||
}
|
||||
|
||||
public int getUnkInt() {
|
||||
return unkInt;
|
||||
}
|
||||
|
||||
public void setUnkInt(int unkInt) {
|
||||
this.unkInt = unkInt;
|
||||
}
|
||||
|
||||
public int getMinPrice() {
|
||||
return minPrice;
|
||||
}
|
||||
|
||||
public void setMinPrice(int minPrice) {
|
||||
this.minPrice = minPrice;
|
||||
}
|
||||
|
||||
public int getMaxPrice() {
|
||||
return maxPrice;
|
||||
}
|
||||
|
||||
public void setMaxPrice(int maxPrice) {
|
||||
this.maxPrice = maxPrice;
|
||||
}
|
||||
|
||||
public byte getIncludeEntranceFee() {
|
||||
return includeEntranceFee;
|
||||
}
|
||||
|
||||
public void setIncludeEntranceFee(byte includeEntranceFee) {
|
||||
this.includeEntranceFee = includeEntranceFee;
|
||||
}
|
||||
|
||||
public long getVendorId() {
|
||||
return vendorId;
|
||||
}
|
||||
|
||||
public void setVendorId(long vendorId) {
|
||||
this.vendorId = vendorId;
|
||||
}
|
||||
|
||||
public byte getVendorFlag() {
|
||||
return vendorFlag;
|
||||
}
|
||||
|
||||
public void setVendorFlag(byte vendorFlag) {
|
||||
this.vendorFlag = vendorFlag;
|
||||
}
|
||||
|
||||
public short getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
public void setOffset(short offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class AuctionQueryHeadersResponseMessage extends SWGMessage {
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class BidAuctionMessage extends SWGMessage {
|
||||
|
||||
private long auctionId;
|
||||
private int myPrice;
|
||||
private int proxyPrice;
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
data.skip(6);
|
||||
setAuctionId(data.getLong());
|
||||
setMyPrice(data.getInt());
|
||||
setProxyPrice(data.getInt());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public long getAuctionId() {
|
||||
return auctionId;
|
||||
}
|
||||
|
||||
public void setAuctionId(long auctionId) {
|
||||
this.auctionId = auctionId;
|
||||
}
|
||||
|
||||
public int getMyPrice() {
|
||||
return myPrice;
|
||||
}
|
||||
|
||||
public void setMyPrice(int myPrice) {
|
||||
this.myPrice = myPrice;
|
||||
}
|
||||
|
||||
public int getProxyPrice() {
|
||||
return proxyPrice;
|
||||
}
|
||||
|
||||
public void setProxyPrice(int proxyPrice) {
|
||||
this.proxyPrice = proxyPrice;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class BidAuctionResponseMessage extends SWGMessage {
|
||||
|
||||
private long objectId;
|
||||
private int status;
|
||||
|
||||
public static final int SUCCESS = 0;
|
||||
public static final int INVALIDAUCTIONER = 1;
|
||||
public static final int INVALIDITEM = 2;
|
||||
public static final int INVALIDPRICE = 4;
|
||||
public static final int NOTENOUGHCREDITS = 9;
|
||||
public static final int PURCHASEFAILED = 10;
|
||||
public static final int PURCHASEREJECTED = 11;
|
||||
public static final int PRICETOOHIGH = 13;
|
||||
public static final int PRICEOVERFLOW = 14;
|
||||
|
||||
public BidAuctionResponseMessage(long objectId, int status) {
|
||||
this.objectId = objectId;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
IoBuffer result = IoBuffer.allocate(18).order(ByteOrder.LITTLE_ENDIAN);
|
||||
result.putShort((short) 3);
|
||||
result.putInt(0x8FCBEF4A);
|
||||
result.putLong(objectId);
|
||||
result.putInt(status);
|
||||
return result.flip();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class CancelLiveAuctionMessage extends SWGMessage {
|
||||
|
||||
private long objectId;
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
data.skip(6);
|
||||
setObjectId(data.getLong());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public long getObjectId() {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(long objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class CancelLiveAuctionResponseMessage extends SWGMessage {
|
||||
|
||||
public static final int SUCCESS = 0;
|
||||
public static final int NOTALLOWED = 1;
|
||||
public static final int INVALIDITEM = 2;
|
||||
public static final int NOTOWNER = 8;
|
||||
public static final int ALREADYCOMPLETED = 15;
|
||||
private long itemId;
|
||||
private int status;
|
||||
|
||||
public CancelLiveAuctionResponseMessage(long itemId, int status) {
|
||||
this.itemId = itemId;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
IoBuffer result = IoBuffer.allocate(19).order(ByteOrder.LITTLE_ENDIAN);
|
||||
result.putShort((short) 4);
|
||||
result.putInt(0x7DA2246C);
|
||||
result.putLong(itemId);
|
||||
result.putInt(status);
|
||||
result.put((byte) 0); // unk
|
||||
return result.flip();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import main.NGECore;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class CommoditiesItemTypeListResponse extends SWGMessage {
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
String galaxy = NGECore.getInstance().getGalaxyName();
|
||||
IoBuffer result = IoBuffer.allocate(14 + galaxy.length()).order(ByteOrder.LITTLE_ENDIAN);
|
||||
result.putShort((short) 2);
|
||||
result.putInt(0xD4E937FC);
|
||||
result.put(getAsciiString(galaxy + ".0"));
|
||||
result.putInt(0);
|
||||
return result.flip();
|
||||
}
|
||||
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.Vector;
|
||||
|
||||
import main.NGECore;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class CommoditiesResourceTypeListResponse extends SWGMessage {
|
||||
|
||||
private Vector<String> resNames;
|
||||
|
||||
public CommoditiesResourceTypeListResponse(Vector<String> resNames) {
|
||||
this.resNames = resNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
String galaxyName = NGECore.getInstance().getGalaxyName();
|
||||
final IoBuffer result = IoBuffer.allocate(100).order(ByteOrder.LITTLE_ENDIAN);
|
||||
result.setAutoExpand(true);
|
||||
|
||||
result.putShort((short) 2);
|
||||
result.putInt(0x5EDD19CB);
|
||||
|
||||
result.put(getAsciiString(galaxyName + "." + String.valueOf(resNames.size())));
|
||||
result.putInt(479);
|
||||
result.putLong(0);
|
||||
|
||||
resNames.forEach(s -> result.put(getAsciiString(s)));
|
||||
|
||||
int size = result.position();
|
||||
IoBuffer result2 = IoBuffer.allocate(size).put(result.array(), 0, size);
|
||||
|
||||
return result2.flip();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class CreateAuctionMessage extends SWGMessage {
|
||||
|
||||
private long objectId;
|
||||
private long vendorId;
|
||||
private int price;
|
||||
private int duration;
|
||||
private String description;
|
||||
private byte premium;
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
data.skip(6);
|
||||
setObjectId(data.getLong());
|
||||
setVendorId(data.getLong());
|
||||
setPrice(data.getInt());
|
||||
setDuration(data.getInt()); // in minutes
|
||||
int size = data.getInt();
|
||||
try {
|
||||
setDescription(new String(ByteBuffer.allocate(size * 2).put(data.array(), data.position(), size * 2).array(), "UTF-16LE"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
data.position(data.position() + size * 2);
|
||||
setPremium(data.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public long getObjectId() {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(long objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public long getVendorId() {
|
||||
return vendorId;
|
||||
}
|
||||
|
||||
public void setVendorId(long vendorId) {
|
||||
this.vendorId = vendorId;
|
||||
}
|
||||
|
||||
public int getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(int price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setDuration(int duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public byte getPremium() {
|
||||
return premium;
|
||||
}
|
||||
|
||||
public void setPremium(byte premium) {
|
||||
this.premium = premium;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class CreateImmediateAuctionMessage extends SWGMessage {
|
||||
|
||||
private long objectId;
|
||||
private long vendorId;
|
||||
private int price;
|
||||
private int duration;
|
||||
private String description;
|
||||
private byte premium;
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
data.skip(6);
|
||||
setObjectId(data.getLong());
|
||||
setVendorId(data.getLong());
|
||||
setPrice(data.getInt());
|
||||
setDuration(data.getInt()); // in minutes
|
||||
int size = data.getInt();
|
||||
try {
|
||||
setDescription(new String(ByteBuffer.allocate(size * 2).put(data.array(), data.position(), size * 2).array(), "UTF-16LE"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
data.position(data.position() + size * 2);
|
||||
setPremium(data.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public long getObjectId() {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(long objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public long getVendorId() {
|
||||
return vendorId;
|
||||
}
|
||||
|
||||
public void setVendorId(long vendorId) {
|
||||
this.vendorId = vendorId;
|
||||
}
|
||||
|
||||
public int getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(int price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setDuration(int duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public byte getPremium() {
|
||||
return premium;
|
||||
}
|
||||
|
||||
public void setPremium(byte premium) {
|
||||
this.premium = premium;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class GetAuctionDetails extends SWGMessage {
|
||||
|
||||
private long objectId;
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
data.skip(6);
|
||||
setObjectId(data.getLong());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public long getObjectId() {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(long objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class GetAuctionDetailsResponse extends SWGMessage {
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class IsVendorOwnerMessage extends SWGMessage {
|
||||
|
||||
private long terminalId;
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
data.skip(6);
|
||||
setTerminalId(data.getLong());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public long getTerminalId() {
|
||||
return terminalId;
|
||||
}
|
||||
|
||||
public void setTerminalId(long terminalId) {
|
||||
this.terminalId = terminalId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class IsVendorOwnerResponseMessage extends SWGMessage {
|
||||
|
||||
private int permission;
|
||||
private int errorCode;
|
||||
private long terminalId;
|
||||
private String terminalString;
|
||||
|
||||
public IsVendorOwnerResponseMessage(int permission, int errorCode, long terminalId, String terminalString) {
|
||||
this.permission = permission;
|
||||
this.errorCode = errorCode;
|
||||
this.terminalId = terminalId;
|
||||
this.terminalString = terminalString;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
IoBuffer result = IoBuffer.allocate(26 + terminalString.length()).order(ByteOrder.LITTLE_ENDIAN);
|
||||
result.putShort((short) 6);
|
||||
result.putInt(0xCE04173E);
|
||||
result.putInt(permission);
|
||||
result.putInt(errorCode);
|
||||
result.putLong(terminalId);
|
||||
result.put(getAsciiString(terminalString));
|
||||
result.putShort((short) 0x64); // unk
|
||||
return result.flip();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class ItemSoldMessage extends SWGMessage {
|
||||
|
||||
public static final int SUCCESS = 0;
|
||||
public static final int INVALIDAUCTIONER = 1;
|
||||
public static final int INVALIDITEM = 2;
|
||||
public static final int BADVENDOR = 3;
|
||||
public static final int INVALIDPRICE = 4;
|
||||
public static final int INVALIDDURATION = 5;
|
||||
public static final int ALREADYFORSALE = 6;
|
||||
public static final int UNKERROR = 6;
|
||||
public static final int DONTOWNITEM = 8;
|
||||
public static final int NOTENOUGHCREDITS = 9;
|
||||
public static final int TOOMANYITEMS = 13;
|
||||
public static final int PRICETOOHIGH = 14;
|
||||
public static final int CANTSELLTRADINGITEM = 19;
|
||||
public static final int VENDORFULL = 25;
|
||||
|
||||
private long objectId;
|
||||
private int status;
|
||||
|
||||
public ItemSoldMessage(long objectId, int status) {
|
||||
this.objectId = objectId;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
IoBuffer result = IoBuffer.allocate(18).order(ByteOrder.LITTLE_ENDIAN);
|
||||
result.putShort((short) 3);
|
||||
result.putInt(0x0E61CC92);
|
||||
result.putLong(objectId);
|
||||
result.putInt(status);
|
||||
return result.flip();
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class RetrieveAuctionItemMessage extends SWGMessage {
|
||||
|
||||
private long objectId;
|
||||
private long vendorId;
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
data.skip(6);
|
||||
setObjectId(data.getLong());
|
||||
setVendorId(data.getLong());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public long getObjectId() {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(long objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public long getVendorId() {
|
||||
return vendorId;
|
||||
}
|
||||
|
||||
public void setVendorId(long vendorId) {
|
||||
this.vendorId = vendorId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package protocol.swg.auctionManagerClientListener;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import protocol.swg.SWGMessage;
|
||||
|
||||
public class RetrieveAuctionItemResponseMessage extends SWGMessage {
|
||||
|
||||
private long objectId;
|
||||
private int status;
|
||||
|
||||
public static final int SUCCESS = 0;
|
||||
public static final int NOTALLOWED = 1;
|
||||
public static final int FULLINVENTORY = 12;
|
||||
public static final int TOOFAR = 0x100;
|
||||
public static final int DONTRETRIEVE = 0x200;
|
||||
|
||||
public RetrieveAuctionItemResponseMessage(long objectId, int status) {
|
||||
this.objectId = objectId;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(IoBuffer data) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoBuffer serialize() {
|
||||
IoBuffer result = IoBuffer.allocate(18).order(ByteOrder.LITTLE_ENDIAN);
|
||||
result.putShort((short) 3);
|
||||
result.putInt(0x9499EF8C);
|
||||
result.putLong(objectId);
|
||||
result.putInt(status);
|
||||
return result.flip();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user