diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-19 17:55:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-19 17:55:52 +0300 |
commit | fa378412565f98a1ce6d438425ca34b20aaf223a (patch) | |
tree | 34bf055f2b179b9d49cbe5cabd646173737a053a | |
parent | 2ef04505f91aa7bb1629ac294e9f166280961510 (diff) | |
download | mv-fa378412565f98a1ce6d438425ca34b20aaf223a.tar.gz mv-fa378412565f98a1ce6d438425ca34b20aaf223a.tar.bz2 mv-fa378412565f98a1ce6d438425ca34b20aaf223a.tar.xz mv-fa378412565f98a1ce6d438425ca34b20aaf223a.zip |
Add static in tradehandler.
-rw-r--r-- | src/net/ea/tradehandler.cpp | 13 | ||||
-rw-r--r-- | src/net/ea/tradehandler.h | 6 | ||||
-rw-r--r-- | src/net/eathena/tradehandler.cpp | 6 | ||||
-rw-r--r-- | src/net/eathena/tradehandler.h | 6 | ||||
-rw-r--r-- | src/net/tmwa/tradehandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/tradehandler.h | 2 |
6 files changed, 17 insertions, 18 deletions
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp index 41e8be6d7..1b0067f7c 100644 --- a/src/net/ea/tradehandler.cpp +++ b/src/net/ea/tradehandler.cpp @@ -64,20 +64,20 @@ void TradeHandler::removeItem(const int slotNum A_UNUSED, { } -void TradeHandler::processTradeResponse(Net::MessageIn &msg) const +void TradeHandler::processTradeResponse(Net::MessageIn &msg) { if (confirmDlg || tradePartnerName.empty() || !player_relations.hasPermission(tradePartnerName, PlayerRelation::TRADE)) { - respond(false); + tradeHandler->respond(false); return; } const uint8_t type = msg.readUInt8("type"); processTradeResponseContinue(type); } -void TradeHandler::processTradeResponseContinue(const uint8_t type) const +void TradeHandler::processTradeResponseContinue(const uint8_t type) { switch (type) { @@ -164,14 +164,13 @@ void TradeHandler::processTradeComplete(Net::MessageIn &msg A_UNUSED) } void TradeHandler::processTradeRequestContinue(const std::string &partner) - const { if (player_relations.hasPermission(partner, PlayerRelation::TRADE)) { if (PlayerInfo::isTrading() || confirmDlg) { - respond(false); + tradeHandler->respond(false); return; } @@ -194,13 +193,13 @@ void TradeHandler::processTradeRequestContinue(const std::string &partner) } else { - respond(true); + tradeHandler->respond(true); } } } else { - respond(false); + tradeHandler->respond(false); return; } } diff --git a/src/net/ea/tradehandler.h b/src/net/ea/tradehandler.h index c7c1c0e72..186a9f981 100644 --- a/src/net/ea/tradehandler.h +++ b/src/net/ea/tradehandler.h @@ -44,7 +44,7 @@ class TradeHandler notfinal : public Net::TradeHandler const int amount) const override final; protected: - void processTradeResponse(Net::MessageIn &msg) const; + static void processTradeResponse(Net::MessageIn &msg); static void processTradeOk(Net::MessageIn &msg); @@ -52,9 +52,9 @@ class TradeHandler notfinal : public Net::TradeHandler static void processTradeComplete(Net::MessageIn &msg); - void processTradeRequestContinue(const std::string &partner) const; + static void processTradeRequestContinue(const std::string &partner); - void processTradeResponseContinue(const uint8_t type) const; + static void processTradeResponseContinue(const uint8_t type); }; } // namespace Ea diff --git a/src/net/eathena/tradehandler.cpp b/src/net/eathena/tradehandler.cpp index ef38a4e67..a183b70a6 100644 --- a/src/net/eathena/tradehandler.cpp +++ b/src/net/eathena/tradehandler.cpp @@ -163,7 +163,7 @@ void TradeHandler::cancel() const createOutPacket(CMSG_TRADE_CANCEL_REQUEST); } -void TradeHandler::processTradeRequest(Net::MessageIn &msg) const +void TradeHandler::processTradeRequest(Net::MessageIn &msg) { const std::string &partner = msg.readString(24, "name"); msg.readInt32("char id"); @@ -171,7 +171,7 @@ void TradeHandler::processTradeRequest(Net::MessageIn &msg) const processTradeRequestContinue(partner); } -void TradeHandler::processTradeResponse2(Net::MessageIn &msg) const +void TradeHandler::processTradeResponse2(Net::MessageIn &msg) { const uint8_t type = msg.readUInt8("type"); msg.readInt32("char id"); @@ -239,7 +239,7 @@ void TradeHandler::processTradeItemAddResponse(Net::MessageIn &msg) } } -void TradeHandler::processTradeUndo(Net::MessageIn &msg A_UNUSED) const +void TradeHandler::processTradeUndo(Net::MessageIn &msg A_UNUSED) { // +++ here need clear trade window from partner side? } diff --git a/src/net/eathena/tradehandler.h b/src/net/eathena/tradehandler.h index bdeebc91e..ca444ba31 100644 --- a/src/net/eathena/tradehandler.h +++ b/src/net/eathena/tradehandler.h @@ -55,11 +55,11 @@ class TradeHandler final : public MessageHandler, public Ea::TradeHandler void cancel() const override final; protected: - void processTradeRequest(Net::MessageIn &msg) const; + static void processTradeRequest(Net::MessageIn &msg); - void processTradeResponse2(Net::MessageIn &msg) const; + static void processTradeResponse2(Net::MessageIn &msg); - void processTradeUndo(Net::MessageIn &msg) const; + static void processTradeUndo(Net::MessageIn &msg); static void processTradeItemAdd(Net::MessageIn &msg); diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp index 4ee77a7ec..12e6b94ab 100644 --- a/src/net/tmwa/tradehandler.cpp +++ b/src/net/tmwa/tradehandler.cpp @@ -156,7 +156,7 @@ void TradeHandler::cancel() const createOutPacket(CMSG_TRADE_CANCEL_REQUEST); } -void TradeHandler::processTradeRequest(Net::MessageIn &msg) const +void TradeHandler::processTradeRequest(Net::MessageIn &msg) { processTradeRequestContinue(msg.readString(24, "name")); } diff --git a/src/net/tmwa/tradehandler.h b/src/net/tmwa/tradehandler.h index 34b67cbd5..715c69838 100644 --- a/src/net/tmwa/tradehandler.h +++ b/src/net/tmwa/tradehandler.h @@ -55,7 +55,7 @@ class TradeHandler final : public MessageHandler, public Ea::TradeHandler void cancel() const override final; protected: - void processTradeRequest(Net::MessageIn &msg) const; + static void processTradeRequest(Net::MessageIn &msg); static void processTradeItemAdd(Net::MessageIn &msg); |