summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-11 17:21:30 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-11 17:21:30 +0300
commit1a43a25be73ab9ed464903edef65486e54699437 (patch)
treebaa8a39f2c15e08f582014fbba0e5c8060a71f3f /src/net
parentd3329d1900d306643706478cb2685dec7a1100e4 (diff)
downloadplus-1a43a25be73ab9ed464903edef65486e54699437.tar.gz
plus-1a43a25be73ab9ed464903edef65486e54699437.tar.bz2
plus-1a43a25be73ab9ed464903edef65486e54699437.tar.xz
plus-1a43a25be73ab9ed464903edef65486e54699437.zip
Add packet CMSG_MAIL2_REMOVE_ITEM_MAIL 0x0a06.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/mail2handler.cpp12
-rw-r--r--src/net/eathena/mail2handler.h3
-rw-r--r--src/net/eathena/packetsout.inc2
-rw-r--r--src/net/mail2handler.h3
-rw-r--r--src/net/tmwa/mail2handler.cpp5
-rw-r--r--src/net/tmwa/mail2handler.h3
6 files changed, 28 insertions, 0 deletions
diff --git a/src/net/eathena/mail2handler.cpp b/src/net/eathena/mail2handler.cpp
index 5d7f50ba3..58acd7feb 100644
--- a/src/net/eathena/mail2handler.cpp
+++ b/src/net/eathena/mail2handler.cpp
@@ -61,4 +61,16 @@ void Mail2Handler::addItem(const Item *const item,
outMsg.writeInt16(CAST_S16(amount), "amount");
}
+void Mail2Handler::removeItem(const Item *const item,
+ const int amount) const
+{
+ if (item == nullptr)
+ return;
+
+ createOutPacket(CMSG_MAIL2_REMOVE_ITEM_MAIL);
+ outMsg.writeInt16(CAST_S16(
+ item->getInvIndex() + INVENTORY_OFFSET), "index");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/mail2handler.h b/src/net/eathena/mail2handler.h
index f239eff86..b71b8a59b 100644
--- a/src/net/eathena/mail2handler.h
+++ b/src/net/eathena/mail2handler.h
@@ -39,6 +39,9 @@ class Mail2Handler final : public Net::Mail2Handler
void addItem(const Item *const item,
const int amount) const override final;
+
+ void removeItem(const Item *const item,
+ const int amount) const override final;
};
} // namespace EAthena
diff --git a/src/net/eathena/packetsout.inc b/src/net/eathena/packetsout.inc
index fcb22bcc8..446d95144 100644
--- a/src/net/eathena/packetsout.inc
+++ b/src/net/eathena/packetsout.inc
@@ -319,6 +319,7 @@ packet(CMSG_BOOKING_DELETE_REQ, 0x0000, 0, nullptr);
packet(CMSG_BOOKING_UPDATE_REQ, 0x0000, 0, nullptr);
packet(CMSG_MAIL2_OPEN_WRITE_MAIL, 0x0000, 0, nullptr);
packet(CMSG_MAIL2_ADD_ITEM_TO_MAIL, 0x0000, 0, nullptr);
+packet(CMSG_MAIL2_REMOVE_ITEM_MAIL, 0x0000, 0, nullptr);
#else
// 20040713
if (packetVersion >= 20040713)
@@ -1378,6 +1379,7 @@ if (packetVersion == 20140416)
packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest);
packet(CMSG_MAIL2_OPEN_WRITE_MAIL, 0x0a08, 26, clif->pRodexOpenWriteMail);
packet(CMSG_MAIL2_ADD_ITEM_TO_MAIL, 0x0a04, 6, clif->pRodexAddItem);
+ packet(CMSG_MAIL2_REMOVE_ITEM_MAIL, 0x0a06, 6, clif->pRodexRemoveItem);
}
// 20140605
diff --git a/src/net/mail2handler.h b/src/net/mail2handler.h
index f53d17a98..a2e3e9b94 100644
--- a/src/net/mail2handler.h
+++ b/src/net/mail2handler.h
@@ -45,6 +45,9 @@ class Mail2Handler notfinal
virtual void addItem(const Item *const item,
const int amount) const = 0;
+
+ virtual void removeItem(const Item *const item,
+ const int amount) const = 0;
};
} // namespace Net
diff --git a/src/net/tmwa/mail2handler.cpp b/src/net/tmwa/mail2handler.cpp
index 9f07f2585..daf874448 100644
--- a/src/net/tmwa/mail2handler.cpp
+++ b/src/net/tmwa/mail2handler.cpp
@@ -44,4 +44,9 @@ void Mail2Handler::addItem(const Item *const item A_UNUSED,
{
}
+void Mail2Handler::removeItem(const Item *const item A_UNUSED,
+ const int amount A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/mail2handler.h b/src/net/tmwa/mail2handler.h
index a8cceb0cb..c0780e128 100644
--- a/src/net/tmwa/mail2handler.h
+++ b/src/net/tmwa/mail2handler.h
@@ -39,6 +39,9 @@ class Mail2Handler final : public Net::Mail2Handler
void addItem(const Item *const item,
const int amount) const override final;
+
+ void removeItem(const Item *const item,
+ const int amount) const override final;
};
} // namespace TmwAthena