From 58de724683af04b627fbe5fb435b8771c77cdf50 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 11 Aug 2017 18:26:21 +0300 Subject: Fix added MAIL2 packets limits by packet version and plugin version. --- src/net/eathena/beinghandler.cpp | 5 ++++- src/net/eathena/mail2handler.cpp | 18 ++++++++++++++++++ src/net/eathena/packetsout.inc | 3 +++ 3 files changed, 25 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index 31380aa0d..94e58457b 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -108,8 +108,11 @@ void BeingHandler::requestNameByCharId(const int id) const void BeingHandler::requestCheckName(const std::string &name) const { - if (packetVersion < 20140423) + if (packetVersion < 20140423 || + serverVersion < 19) + { return; + } createOutPacket(CMSG_CHECK_NAME); outMsg.writeString(name, 24, "name"); } 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( diff --git a/src/net/eathena/packetsout.inc b/src/net/eathena/packetsout.inc index b26a6ef9d..29e741669 100644 --- a/src/net/eathena/packetsout.inc +++ b/src/net/eathena/packetsout.inc @@ -1378,6 +1378,9 @@ if (packetVersion == 20140416) packet(CMSG_SKILL_USE_BEING, 0x083c, 10, clif->pUseSkillToId); packet(CMSG_STORAGE_PASSWORD, 0x095c, 36, clif->pStoragePassword); packet(CMSG_NAME_REQUEST, 0x096a, 6, clif->pGetCharNameRequest); +} +if (packetVersion >= 20140416) +{ 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); -- cgit v1.2.3-60-g2f50