summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-18 23:40:58 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-18 23:40:58 +0300
commit1b1cfaf22ab8281943abed6f909fc32f6da46e61 (patch)
tree9bd5a44b9a11f6a80598a67012b310942eb366e1 /src/net
parent7f981b81b14612d9f35cd729401c63f9a019edd5 (diff)
downloadplus-1b1cfaf22ab8281943abed6f909fc32f6da46e61.tar.gz
plus-1b1cfaf22ab8281943abed6f909fc32f6da46e61.tar.bz2
plus-1b1cfaf22ab8281943abed6f909fc32f6da46e61.tar.xz
plus-1b1cfaf22ab8281943abed6f909fc32f6da46e61.zip
Add chat object to owner being.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/chathandler.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index 632997081..8b5d8683d 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -22,6 +22,8 @@
#include "net/eathena/chathandler.h"
+#include "actormanager.h"
+
#include "being/localplayer.h"
#include "gui/chatconsts.h"
@@ -33,6 +35,8 @@
#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
+#include "resources/chatobject.h"
+
#include "utils/stringutils.h"
#include <string>
@@ -452,12 +456,17 @@ void ChatHandler::processChatIgnoreList(Net::MessageIn &msg)
void ChatHandler::processChatDisplay(Net::MessageIn &msg)
{
const int len = msg.readInt16("len") - 17;
- msg.readInt32("owner account id");
- msg.readInt32("char id");
- msg.readInt16("max users");
- msg.readInt16("current users");
- msg.readUInt8("type");
- msg.readString(len, "title");
+ ChatObject *const obj = new ChatObject;
+ obj->ownerId = msg.readInt32("owner account id");
+ obj->charId = msg.readInt32("char id");
+ obj->maxUsers = msg.readInt16("max users");
+ obj->currentUsers = msg.readInt16("current users");
+ obj->type = msg.readUInt8("type");
+ obj->title = msg.readString(len, "title");
+
+ Being *const dstBeing = actorManager->findBeing(obj->ownerId);
+ if (dstBeing)
+ dstBeing->setChat(obj);
}
} // namespace EAthena