52 struct RequestTradeListener :
public gcn::ActionListener
54 void action(
const gcn::ActionEvent &event)
override
68 static const Uint16 _messages[] = {
96 std::string tradePartnerNameTemp = msg.
readString(24);
110 strprintf(
_(
"%s wants to trade with you, do you "
127 "partner is too far away."));
181 const int index = msg.
readInt16() - INVENTORY_OFFSET;
205 "Trade partner is over weighted."));
210 "Trade partner has no free slot."));
215 "You can't trade this item."));
Item * getItem(int index) const
Returns the item at the specified index.
Represents one or more instances of a certain item type.
void doEvent(Event::Type eventType)
bool isEquipped() const
Returns whether this item is equipped.
int getInvIndex() const
Returns the inventory index of this item.
void increaseQuantity(int amount)
Increases the number of items by the given amount.
int getId() const
Returns the item id.
bool isEquippable() const
Returns whether this item is equippable.
const uint16_t * handledMessages
virtual void respond(bool accept)
bool hasPermission(Being *being, unsigned int flags)
Tests whether the player in question is being ignored for any of the actions in the specified flags.
Used for parsing an incoming message from eAthena.
std::string readString(int length=-1)
Reads a string.
void skip(unsigned int length)
Skips a given number of bytes.
uint16_t readInt16()
Reads an unsigned 16-bit integer from the message.
uint8_t readInt8()
Reads an unsigned 8-bit integer from the message.
uint16_t getId() const
Returns the message ID.
uint32_t readInt32()
Reads an unsigned 32-bit integer from the message.
Used for building an outgoing message to eAthena.
void writeInt32(uint32_t value)
Writes an unsigned 32-bit integer to the message.
void writeInt8(uint8_t value)
Writes an unsigned 8-bit integer to the message.
void writeInt16(uint16_t value)
Writes an unsigned 16-bit integer to the message.
void handleMessage(MessageIn &msg) override
void respond(bool accept) override
void setMoney(int amount) override
void addItem(Item *item, int amount) override
void removeItem(int slotNum, int amount) override
void request(Being *being) override
void addItem(int id, bool own, int quantity)
Add an item to the trade window.
void reset()
Reset both item containers.
void receivedOk(bool own)
Player received ok message from server.
void setMoney(int quantity)
Displays expected money in the trade window.
virtual void setVisible(bool visible)
Overloads window setVisible by Guichan to allow sticky window handling.
void serverNotice(const std::string &message)
TradeWindow * tradeWindow
std::string tradePartnerName
Net::TradeHandler * tradeHandler
TradeHandler * getTradeHandler()
Inventory * getInventory()
Returns the player's inventory.
Warning: buffers and other variables are shared, so there can be only one connection active at a time...
@ CMSG_TRADE_ADD_COMPLETE
@ CMSG_TRADE_ITEM_ADD_REQUEST
@ SMSG_TRADE_ITEM_ADD_RESPONSE
@ CMSG_TRADE_CANCEL_REQUEST
PlayerRelationsManager player_relations
std::string strprintf(char const *format,...)
A safe version of sprintf that returns a std::string of the result.
ConfirmDialog * confirmDlg