summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-15 12:28:16 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-15 12:28:16 +0300
commita0f83483c5d9ae0a6b809c93e62697ba399ac246 (patch)
tree7c4f2bd2804d98ecf177ed73f0a6351783efb81a /src/net
parented9ca814f58dff6e676a052ac67766fd1af451fb (diff)
downloadplus-a0f83483c5d9ae0a6b809c93e62697ba399ac246.tar.gz
plus-a0f83483c5d9ae0a6b809c93e62697ba399ac246.tar.bz2
plus-a0f83483c5d9ae0a6b809c93e62697ba399ac246.tar.xz
plus-a0f83483c5d9ae0a6b809c93e62697ba399ac246.zip
eathena: add packet CMSG_MAIL_SET_ATTACH 0x0247.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/mailhandler.cpp9
-rw-r--r--src/net/eathena/mailhandler.h2
-rw-r--r--src/net/eathena/protocol.h1
-rw-r--r--src/net/mailhandler.h2
-rw-r--r--src/net/tmwa/mailhandler.cpp5
-rw-r--r--src/net/tmwa/mailhandler.h2
6 files changed, 21 insertions, 0 deletions
diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp
index 006c5e9a2..ea420cfc4 100644
--- a/src/net/eathena/mailhandler.cpp
+++ b/src/net/eathena/mailhandler.cpp
@@ -22,6 +22,8 @@
#include "logger.h"
+#include "net/ea/eaprotocol.h"
+
#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
@@ -104,4 +106,11 @@ void MailHandler::returnMessage(const int msgId)
outMsg.writeString("", 24, "unused");
}
+void MailHandler::setAttach(const int index, const int amount)
+{
+ MessageOut outMsg(CMSG_MAIL_SET_ATTACH);
+ outMsg.writeInt16(static_cast<int16_t>(index + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(amount, "amount");
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/mailhandler.h b/src/net/eathena/mailhandler.h
index a90f3cbea..b6d2b9080 100644
--- a/src/net/eathena/mailhandler.h
+++ b/src/net/eathena/mailhandler.h
@@ -48,6 +48,8 @@ class MailHandler final : public MessageHandler, public Net::MailHandler
void returnMessage(const int msgId) override final;
+ void setAttach(const int index, const int amount) override final;
+
protected:
void processMailOpen(Net::MessageIn &msg) const;
};
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 1196988aa..d28806559 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -371,6 +371,7 @@
#define CMSG_MAIL_GET_ATTACH 0x0244
#define CMSG_MAIL_DELETE_MESSAGE 0x0243
#define CMSG_MAIL_RETURN_MESSAGE 0x0273
+#define CMSG_MAIL_SET_ATTACH 0x0247
#define SMSG_SOLVE_CHAR_NAME 0x0194
#define SMSG_SKILL_CASTING 0x07fb
diff --git a/src/net/mailhandler.h b/src/net/mailhandler.h
index 086c537b8..ebad9b7b4 100644
--- a/src/net/mailhandler.h
+++ b/src/net/mailhandler.h
@@ -41,6 +41,8 @@ class MailHandler notfinal
virtual void deleteMessage(const int msgId) = 0;
virtual void returnMessage(const int msgId) = 0;
+
+ virtual void setAttach(const int index, const int amount) = 0;
};
} // namespace Net
diff --git a/src/net/tmwa/mailhandler.cpp b/src/net/tmwa/mailhandler.cpp
index e4e682266..8d48094d2 100644
--- a/src/net/tmwa/mailhandler.cpp
+++ b/src/net/tmwa/mailhandler.cpp
@@ -62,4 +62,9 @@ void MailHandler::returnMessage(const int msgId A_UNUSED)
{
}
+void MailHandler::setAttach(const int index A_UNUSED,
+ const int amount A_UNUSED)
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/mailhandler.h b/src/net/tmwa/mailhandler.h
index d55093808..c6c77de26 100644
--- a/src/net/tmwa/mailhandler.h
+++ b/src/net/tmwa/mailhandler.h
@@ -46,6 +46,8 @@ class MailHandler final : public MessageHandler, public Net::MailHandler
void deleteMessage(const int msgId) override final;
void returnMessage(const int msgId) override final;
+
+ void setAttach(const int index, const int amount) override final;
};
} // namespace TmwAthena