diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-07-25 18:04:38 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-07-25 18:04:38 +0000 |
commit | c7e7b62aa94bf295ca1dc556762ad6070221e0cd (patch) | |
tree | 04f827df0df64a80e04a4115986609486d715237 /src/gui/trade.cpp | |
parent | c0c8775271679ac4904bc0bc02a74d28fc75efd0 (diff) | |
download | mana-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.tar.gz mana-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.tar.bz2 mana-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.tar.xz mana-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.zip |
Switched client to use enet and modified login sequence to work with the new protocol from tmwserv.
Diffstat (limited to 'src/gui/trade.cpp')
-rw-r--r-- | src/gui/trade.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index 9b98fa09..4efdb06c 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -215,10 +215,10 @@ void TradeWindow::receivedOk(bool own) void TradeWindow::tradeItem(Item *item, int quantity) { - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_TRADE_ITEM_ADD_REQUEST); - outMsg.writeInt16(item->getInvIndex()); - outMsg.writeInt32(quantity); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_ITEM_ADD_REQUEST); + outMsg.writeShort(item->getInvIndex()); + outMsg.writeLong(quantity); } void TradeWindow::mouseClick(int x, int y, int button, int count) @@ -287,8 +287,8 @@ void TradeWindow::action(const std::string &eventId) } else if (eventId == "cancel") { - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_TRADE_CANCEL_REQUEST); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_CANCEL_REQUEST); } else if (eventId == "ok") { @@ -298,20 +298,20 @@ void TradeWindow::action(const std::string &eventId) { mMoneyField->setText(toString(tempInt)); - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_TRADE_ITEM_ADD_REQUEST); - outMsg.writeInt16(0); - outMsg.writeInt32(tempInt); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_ITEM_ADD_REQUEST); + outMsg.writeShort(0); + outMsg.writeLong(tempInt); } else { mMoneyField->setText(""); } mMoneyField->setEnabled(false); - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_TRADE_ADD_COMPLETE); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_ADD_COMPLETE); } else if (eventId == "trade") { - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_TRADE_OK); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_OK); } } |