summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-19 11:05:44 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-19 11:05:44 +0300
commit78d916e95061fb3bec4ba7791a2f20bcbeaecb3c (patch)
tree43b9335fcc92e21796f8861edefad94471de5fb6 /src/net
parent1e0a3842186c86e40eff6fa7894e578ae948d179 (diff)
downloadmv-78d916e95061fb3bec4ba7791a2f20bcbeaecb3c.tar.gz
mv-78d916e95061fb3bec4ba7791a2f20bcbeaecb3c.tar.bz2
mv-78d916e95061fb3bec4ba7791a2f20bcbeaecb3c.tar.xz
mv-78d916e95061fb3bec4ba7791a2f20bcbeaecb3c.zip
eathena: add packet CMSG_CHAT_JOIN 0x00d9.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/chathandler.h6
-rw-r--r--src/net/eathena/chathandler.cpp11
-rw-r--r--src/net/eathena/chathandler.h3
-rw-r--r--src/net/eathena/protocol.h1
-rw-r--r--src/net/tmwa/chathandler.cpp5
-rw-r--r--src/net/tmwa/chathandler.h3
6 files changed, 29 insertions, 0 deletions
diff --git a/src/net/chathandler.h b/src/net/chathandler.h
index bf4863b66..ede516f06 100644
--- a/src/net/chathandler.h
+++ b/src/net/chathandler.h
@@ -23,11 +23,14 @@
#ifndef NET_CHATHANDLER_H
#define NET_CHATHANDLER_H
+
#include <iosfwd>
#include <string>
#include "localconsts.h"
+struct ChatObject;
+
namespace Net
{
class ChatHandler notfinal
@@ -72,6 +75,9 @@ class ChatHandler notfinal
const bool isPublic) = 0;
virtual void battleTalk(const std::string &text) const = 0;
+
+ virtual void joinChat(const ChatObject *const chat,
+ const std::string &password) const = 0;
};
} // namespace Net
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index 7c08cbc28..d09234af3 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -469,4 +469,15 @@ void ChatHandler::processChatDisplay(Net::MessageIn &msg)
dstBeing->setChat(obj);
}
+void ChatHandler::joinChat(const ChatObject *const chat,
+ const std::string &password) const
+{
+ if (!chat)
+ return;
+
+ MessageOut outMsg(CMSG_CHAT_JOIN);
+ outMsg.writeInt32(chat->chatId, "chat id");
+ outMsg.writeString(password, 8, "password");
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h
index 590d461ca..ad66c9303 100644
--- a/src/net/eathena/chathandler.h
+++ b/src/net/eathena/chathandler.h
@@ -72,6 +72,9 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler
void battleTalk(const std::string &text) const override final;
+ void joinChat(const ChatObject *const chat,
+ const std::string &password) const override final;
+
protected:
void processChat(Net::MessageIn &msg);
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 3bf1b08a8..2d32d6f54 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -247,6 +247,7 @@
#define CMSG_CHAT_MESSAGE 0x00f3
#define CMSG_CHAT_WHISPER 0x0096
#define CMSG_CHAT_WHO 0x00c1
+#define CMSG_CHAT_JOIN 0x00d9
#define CMSG_BATTLE_CHAT_MESSAGE 0x02db
#define CMSG_CREAYE_CHAT_ROOM 0x00d5
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index 0d0c08d90..52089d365 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -453,4 +453,9 @@ void ChatHandler::processWhisperResponse(Net::MessageIn &msg)
processWhisperResponseContinue(type);
}
+void ChatHandler::joinChat(const ChatObject *const chat A_UNUSED,
+ const std::string &password A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h
index cebb0674f..15777c1e3 100644
--- a/src/net/tmwa/chathandler.h
+++ b/src/net/tmwa/chathandler.h
@@ -72,6 +72,9 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler
void battleTalk(const std::string &text) const override final;
+ void joinChat(const ChatObject *const chat,
+ const std::string &password) const override final;
+
protected:
void processChat(Net::MessageIn &msg);