diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-04 19:33:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 01:18:57 +0300 |
commit | 549d21c0c9995c2120ea539cfb3551817df214a2 (patch) | |
tree | d314c5fab2de5a39b26e0c628b9ca9968c5bfaa4 /src | |
parent | d3dda64049f13ca95bb86fe13c707b14039a7595 (diff) | |
download | manaplus-549d21c0c9995c2120ea539cfb3551817df214a2.tar.gz manaplus-549d21c0c9995c2120ea539cfb3551817df214a2.tar.bz2 manaplus-549d21c0c9995c2120ea539cfb3551817df214a2.tar.xz manaplus-549d21c0c9995c2120ea539cfb3551817df214a2.zip |
Move processTradeItemAdd from ea namespace into eathena and tmwa.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/ea/tradehandler.cpp | 23 | ||||
-rw-r--r-- | src/net/ea/tradehandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/tradehandler.cpp | 25 | ||||
-rw-r--r-- | src/net/eathena/tradehandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/tradehandler.cpp | 25 | ||||
-rw-r--r-- | src/net/tmwa/tradehandler.h | 2 |
6 files changed, 54 insertions, 25 deletions
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp index 5f507a01a..d22a602a6 100644 --- a/src/net/ea/tradehandler.cpp +++ b/src/net/ea/tradehandler.cpp @@ -128,29 +128,6 @@ void TradeHandler::processTradeResponse(Net::MessageIn &msg) const } } -void TradeHandler::processTradeItemAdd(Net::MessageIn &msg) -{ - const int amount = msg.readInt32(); - const int type = msg.readInt16(); - const uint8_t identify = msg.readUInt8(); // identified flag - msg.readUInt8(); // attribute - const uint8_t refine = msg.readUInt8(); // refine - msg.skip(8); // card (4 shorts) - - if (tradeWindow) - { - if (type == 0) - { - tradeWindow->setMoney(amount); - } - else - { - tradeWindow->addItem2(type, false, amount, - refine, identify, false); - } - } -} - void TradeHandler::processTradeItemAddResponse(Net::MessageIn &msg) { // Trade: New Item add response (was 0x00ea, now 01b1) diff --git a/src/net/ea/tradehandler.h b/src/net/ea/tradehandler.h index cbf19919e..f8534d117 100644 --- a/src/net/ea/tradehandler.h +++ b/src/net/ea/tradehandler.h @@ -45,8 +45,6 @@ class TradeHandler notfinal : public Net::TradeHandler void processTradeResponse(Net::MessageIn &msg) const; - static void processTradeItemAdd(Net::MessageIn &msg); - static void processTradeItemAddResponse(Net::MessageIn &msg); static void processTradeOk(Net::MessageIn &msg); diff --git a/src/net/eathena/tradehandler.cpp b/src/net/eathena/tradehandler.cpp index f73584deb..4de0ee779 100644 --- a/src/net/eathena/tradehandler.cpp +++ b/src/net/eathena/tradehandler.cpp @@ -26,6 +26,8 @@ #include "being/playerinfo.h" +#include "gui/windows/tradewindow.h" + #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" @@ -166,4 +168,27 @@ void TradeHandler::processTradeResponse2(Net::MessageIn &msg) const msg.readInt16("base level"); } +void TradeHandler::processTradeItemAdd(Net::MessageIn &msg) +{ + const int amount = msg.readInt32(); + const int type = msg.readInt16(); + const uint8_t identify = msg.readUInt8(); // identified flag + msg.readUInt8(); // attribute + const uint8_t refine = msg.readUInt8(); // refine + msg.skip(8); // card (4 shorts) + + if (tradeWindow) + { + if (type == 0) + { + tradeWindow->setMoney(amount); + } + else + { + tradeWindow->addItem2(type, false, amount, + refine, identify, false); + } + } +} + } // namespace EAthena diff --git a/src/net/eathena/tradehandler.h b/src/net/eathena/tradehandler.h index f112c8426..929b48ced 100644 --- a/src/net/eathena/tradehandler.h +++ b/src/net/eathena/tradehandler.h @@ -58,6 +58,8 @@ class TradeHandler final : public MessageHandler, public Ea::TradeHandler void processTradeRequest(Net::MessageIn &msg) const; void processTradeResponse2(Net::MessageIn &msg) const; + + static void processTradeItemAdd(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp index 0a67a9202..073fe78ed 100644 --- a/src/net/tmwa/tradehandler.cpp +++ b/src/net/tmwa/tradehandler.cpp @@ -26,6 +26,8 @@ #include "being/playerinfo.h" +#include "gui/windows/tradewindow.h" + #include "net/tmwa/messageout.h" #include "net/tmwa/protocol.h" @@ -153,4 +155,27 @@ void TradeHandler::processTradeRequest(Net::MessageIn &msg) const processTradeRequestContinue(msg.readString(24, "name")); } +void TradeHandler::processTradeItemAdd(Net::MessageIn &msg) +{ + const int amount = msg.readInt32(); + const int type = msg.readInt16(); + const uint8_t identify = msg.readUInt8(); // identified flag + msg.readUInt8(); // attribute + const uint8_t refine = msg.readUInt8(); // refine + msg.skip(8); // card (4 shorts) + + if (tradeWindow) + { + if (type == 0) + { + tradeWindow->setMoney(amount); + } + else + { + tradeWindow->addItem2(type, false, amount, + refine, identify, false); + } + } +} + } // namespace TmwAthena diff --git a/src/net/tmwa/tradehandler.h b/src/net/tmwa/tradehandler.h index 39222e7ba..cdbc3e853 100644 --- a/src/net/tmwa/tradehandler.h +++ b/src/net/tmwa/tradehandler.h @@ -56,6 +56,8 @@ class TradeHandler final : public MessageHandler, public Ea::TradeHandler protected: void processTradeRequest(Net::MessageIn &msg) const; + + static void processTradeItemAdd(Net::MessageIn &msg); }; } // namespace TmwAthena |