summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/mailhandler.cpp29
-rw-r--r--src/net/eathena/mailhandler.h3
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h2
4 files changed, 35 insertions, 1 deletions
diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp
index 32080b529..3cbefb623 100644
--- a/src/net/eathena/mailhandler.cpp
+++ b/src/net/eathena/mailhandler.cpp
@@ -20,6 +20,8 @@
#include "net/eathena/mailhandler.h"
+#include "logger.h"
+
#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
@@ -35,6 +37,7 @@ MailHandler::MailHandler() :
{
static const uint16_t _messages[] =
{
+ SMSG_MAIL_OPEN_WINDOW,
0
};
handledMessages = _messages;
@@ -43,6 +46,32 @@ MailHandler::MailHandler() :
void MailHandler::handleMessage(Net::MessageIn &msg)
{
+ switch(msg.getId())
+ {
+ case SMSG_MAIL_OPEN_WINDOW:
+ processMailOpen(msg);
+ break;
+
+ default:
+ break;
+ }
+}
+
+void MailHandler::processMailOpen(Net::MessageIn &msg) const
+{
+ const int flag = msg.readInt32("flag");
+ switch(flag)
+ {
+ case 0: // open window
+ break;
+
+ case 1: // close window
+ break;
+
+ default:
+ logger->log("unknown mail window open flag: %u", flag);
+ break;
+ }
}
} // namespace EAthena
diff --git a/src/net/eathena/mailhandler.h b/src/net/eathena/mailhandler.h
index c3a44cfab..ec3ed3e9e 100644
--- a/src/net/eathena/mailhandler.h
+++ b/src/net/eathena/mailhandler.h
@@ -37,6 +37,9 @@ class MailHandler final : public MessageHandler, public Net::MailHandler
A_DELETE_COPY(MailHandler)
void handleMessage(Net::MessageIn &msg) override final;
+
+ protected:
+ void processMailOpen(Net::MessageIn &msg) const;
};
} // namespace EAthena
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index 8eb80105f..cb044e516 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -90,7 +90,7 @@ int16_t packet_lengths[] =
// #0x0240
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// #0x0280
0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index bb50a69cd..bd729bcc8 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -202,6 +202,8 @@
#define SMSG_MONSTER_HP 0x0977
#define SMSG_PLAYER_HP 0x080e
+#define SMSG_MAIL_OPEN_WINDOW 0x0260
+
/**********************************
* Packets from client to server *
**********************************/