summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net/buyingstorehandler.h6
-rw-r--r--src/net/eathena/buyingstorehandler.cpp18
-rw-r--r--src/net/eathena/buyingstorehandler.h6
-rw-r--r--src/net/eathena/protocol.h1
-rw-r--r--src/net/tmwa/buyingstorehandler.cpp8
-rw-r--r--src/net/tmwa/buyingstorehandler.h6
6 files changed, 45 insertions, 0 deletions
diff --git a/src/net/buyingstorehandler.h b/src/net/buyingstorehandler.h
index 984fd0d98..856f2ad3d 100644
--- a/src/net/buyingstorehandler.h
+++ b/src/net/buyingstorehandler.h
@@ -46,6 +46,12 @@ class BuyingStoreHandler notfinal
std::vector<ShopItem*> &items) const = 0;
virtual void close() const = 0;
+
+ virtual void sell(const Being *const being,
+ const int storeId,
+ const int index,
+ const int itemId,
+ const int amount) const = 0;
};
} // namespace Net
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp
index 42bd41c7b..4bbfce091 100644
--- a/src/net/eathena/buyingstorehandler.cpp
+++ b/src/net/eathena/buyingstorehandler.cpp
@@ -187,4 +187,22 @@ void BuyingStoreHandler::open(const Being *const being) const
outMsg.writeInt32(being->getId(), "account id");
}
+void BuyingStoreHandler::sell(const Being *const being,
+ const int storeId,
+ const int index,
+ const int itemId,
+ const int amount) const
+{
+ if (!being)
+ return;
+
+ createOutPacket(CMSG_BUYINGSTORE_SELL);
+ outMsg.writeInt16(16, "len");
+ outMsg.writeInt32(being->getId(), "account id");
+ outMsg.writeInt32(storeId, "store id");
+ outMsg.writeInt16(static_cast<int16_t>(index), "index");
+ outMsg.writeInt16(static_cast<int16_t>(itemId), "item id");
+ outMsg.writeInt16(static_cast<int16_t>(amount), "amount");
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h
index 9c4e8a335..e13ed5731 100644
--- a/src/net/eathena/buyingstorehandler.h
+++ b/src/net/eathena/buyingstorehandler.h
@@ -46,6 +46,12 @@ class BuyingStoreHandler final : public MessageHandler,
void open(const Being *const being) const override final;
+ void sell(const Being *const being,
+ const int storeId,
+ const int index,
+ const int itemId,
+ const int amount) const override final;
+
protected:
static void processBuyingStoreOpen(Net::MessageIn &msg);
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 99f6d2e1d..4b2e2ae03 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -555,5 +555,6 @@
#define CMSG_BUYINGSTORE_CREATE 0x0815
#define CMSG_BUYINGSTORE_CLOSE 0x0817
#define CMSG_BUYINGSTORE_OPEN 0x0360
+#define CMSG_BUYINGSTORE_SELL 0x0811
#endif // NET_EATHENA_PROTOCOL_H
diff --git a/src/net/tmwa/buyingstorehandler.cpp b/src/net/tmwa/buyingstorehandler.cpp
index a0f3d9194..b2385eacb 100644
--- a/src/net/tmwa/buyingstorehandler.cpp
+++ b/src/net/tmwa/buyingstorehandler.cpp
@@ -57,4 +57,12 @@ void BuyingStoreHandler::open(const Being *const being A_UNUSED) const
{
}
+void BuyingStoreHandler::sell(const Being *const being A_UNUSED,
+ const int storeId A_UNUSED,
+ const int index A_UNUSED,
+ const int itemId A_UNUSED,
+ const int amount A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/buyingstorehandler.h b/src/net/tmwa/buyingstorehandler.h
index 205e30ecc..2eb965783 100644
--- a/src/net/tmwa/buyingstorehandler.h
+++ b/src/net/tmwa/buyingstorehandler.h
@@ -46,6 +46,12 @@ class BuyingStoreHandler final : public MessageHandler,
void close() const override final;
void open(const Being *const being) const override final;
+
+ void sell(const Being *const being,
+ const int storeId,
+ const int index,
+ const int itemId,
+ const int amount) const override final;
};
} // namespace TmwAthena