summaryrefslogtreecommitdiff
path: root/src/net/eathena/mail2handler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-11 18:26:21 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-11 18:26:21 +0300
commit58de724683af04b627fbe5fb435b8771c77cdf50 (patch)
treec7a58234d1b721ba291442c2827ee5278beaea69 /src/net/eathena/mail2handler.cpp
parentcd02cce9c9b344c67b05b9b70f944bbed600c62e (diff)
downloadmanaverse-58de724683af04b627fbe5fb435b8771c77cdf50.tar.gz
manaverse-58de724683af04b627fbe5fb435b8771c77cdf50.tar.bz2
manaverse-58de724683af04b627fbe5fb435b8771c77cdf50.tar.xz
manaverse-58de724683af04b627fbe5fb435b8771c77cdf50.zip
Fix added MAIL2 packets limits by packet version and plugin version.
Diffstat (limited to 'src/net/eathena/mail2handler.cpp')
-rw-r--r--src/net/eathena/mail2handler.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/net/eathena/mail2handler.cpp b/src/net/eathena/mail2handler.cpp
index 58acd7feb..0e87a3731 100644
--- a/src/net/eathena/mail2handler.cpp
+++ b/src/net/eathena/mail2handler.cpp
@@ -30,6 +30,9 @@
#include "debug.h"
+extern int packetVersion;
+extern int serverVersion;
+
namespace EAthena
{
@@ -45,6 +48,11 @@ Mail2Handler::~Mail2Handler()
void Mail2Handler::openWriteMail(const std::string &receiver) const
{
+ if (packetVersion < 20140416 ||
+ serverVersion < 19)
+ {
+ return;
+ }
createOutPacket(CMSG_MAIL2_OPEN_WRITE_MAIL);
outMsg.writeString(receiver, 24, "receiver name");
}
@@ -54,6 +62,11 @@ void Mail2Handler::addItem(const Item *const item,
{
if (item == nullptr)
return;
+ if (packetVersion < 20140416 ||
+ serverVersion < 19)
+ {
+ return;
+ }
createOutPacket(CMSG_MAIL2_ADD_ITEM_TO_MAIL);
outMsg.writeInt16(CAST_S16(
@@ -66,6 +79,11 @@ void Mail2Handler::removeItem(const Item *const item,
{
if (item == nullptr)
return;
+ if (packetVersion < 20140416 ||
+ serverVersion < 19)
+ {
+ return;
+ }
createOutPacket(CMSG_MAIL2_REMOVE_ITEM_MAIL);
outMsg.writeInt16(CAST_S16(