use of server.MTSItemInfo in project HeavenMS by ronancpl.
the class MaplePacketCreator method sendMTS.
public static byte[] sendMTS(List<MTSItemInfo> items, int tab, int type, int page, int pages) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.MTS_OPERATION.getValue());
// operation
mplew.write(0x15);
// testing, change to 10 if fails
mplew.writeInt(pages * 16);
// number of items
mplew.writeInt(items.size());
mplew.writeInt(tab);
mplew.writeInt(type);
mplew.writeInt(page);
mplew.write(1);
mplew.write(1);
for (int i = 0; i < items.size(); i++) {
MTSItemInfo item = items.get(i);
addItemInfo(mplew, item.getItem(), true);
// id
mplew.writeInt(item.getID());
// this + below = price
mplew.writeInt(item.getTaxes());
// price
mplew.writeInt(item.getPrice());
mplew.writeInt(0);
mplew.writeLong(getTime(item.getEndingDate()));
// account name (what was nexon thinking?)
mplew.writeMapleAsciiString(item.getSeller());
// char name
mplew.writeMapleAsciiString(item.getSeller());
for (int j = 0; j < 28; j++) {
mplew.write(0);
}
}
mplew.write(1);
return mplew.getPacket();
}
Aggregations