diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-09-17 13:51:37 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-09-17 13:51:37 +0000 |
commit | e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c (patch) | |
tree | 8feb8b51d731057412a59aeddbbe83b75b09912a /src/gui/trade.cpp | |
parent | 3bfcee0d9c033a46fe1b13795d89909c8fb6a239 (diff) | |
download | mana-e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c.tar.gz mana-e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c.tar.bz2 mana-e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c.tar.xz mana-e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c.zip |
Completed transition to use MessageOut.
Diffstat (limited to 'src/gui/trade.cpp')
-rw-r--r-- | src/gui/trade.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index e18dc969..6069b768 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -38,7 +38,9 @@ #include "../inventory.h" #include "../item.h" +#include "../net/messageout.h" #include "../net/network.h" +#include "../net/protocol.h" #include "../resources/iteminfo.h" @@ -240,9 +242,10 @@ void TradeWindow::receivedOk(bool own) void TradeWindow::tradeItem(Item *item, int quantity) { - writeWord(0, 0x00e8); - writeWord(2, item->getInvIndex()); - writeLong(4, quantity); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_ITEM_ADD_REQUEST); + outMsg.writeShort(item->getInvIndex()); + outMsg.writeLong(quantity); writeSet(8); flush(); } @@ -313,7 +316,8 @@ void TradeWindow::action(const std::string &eventId) } else if (eventId == "cancel") { - writeWord(0, 0x00ed); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_CANCEL_REQUEST); writeSet(2); flush(); } @@ -326,23 +330,26 @@ void TradeWindow::action(const std::string &eventId) { tempMoney[1] << tempInt; moneyField->setText(tempMoney[1].str()); - - writeWord(0, 0x00e8); - writeWord(2, 0); - writeLong(4, tempInt); + + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_ITEM_ADD_REQUEST); + outMsg.writeShort(0); + outMsg.writeLong(tempInt); writeSet(8); flush(); } else { moneyField->setText(""); } moneyField->setEnabled(false); - writeWord(0, 0x00eb); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_ADD_COMPLETE); writeSet(2); flush(); } else if (eventId == "trade") { - writeWord(0, 0x00ef); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_OK); writeSet(2); flush(); } |