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/requesttrade.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/requesttrade.cpp')
-rw-r--r-- | src/gui/requesttrade.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/gui/requesttrade.cpp b/src/gui/requesttrade.cpp index e3b70fd3..992b0c0f 100644 --- a/src/gui/requesttrade.cpp +++ b/src/gui/requesttrade.cpp @@ -27,7 +27,10 @@ #include <guichan/widgets/label.hpp> #include "button.h" + +#include "../net/messageout.h" #include "../net/network.h" +#include "../net/protocol.h" bool requestTradeDialogOpen = false; @@ -84,19 +87,18 @@ RequestTradeDialog::~RequestTradeDialog() void RequestTradeDialog::action(const std::string& eventId) { + int choice = 4; // 4 means trade canceled + if (eventId == "accept") { - // Send the selected index back to the server - writeWord(0, 0x00e6); - writeByte(2, 3); - writeSet(3); - scheduleDelete(); + choice = 3; // ok to trade } else if (eventId == "cancel") { - // 0xff packet means cancel - writeWord(0, 0x00e6); - writeByte(2, 4); - writeSet(3); requestTradeDialogOpen = false; - scheduleDelete(); } + + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_RESPONSE); + outMsg.writeByte(choice); + writeSet(3); + scheduleDelete(); } |