ManaPlus
chatrecv.cpp
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2018 The ManaPlus Developers
6  *
7  * This file is part of The ManaPlus Client.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #include "net/eathena/chatrecv.h"
24 
25 #include "actormanager.h"
26 #include "notifymanager.h"
27 
28 #include "being/localplayer.h"
29 #include "being/playerinfo.h"
30 #include "being/playerrelation.h"
31 #include "being/playerrelations.h"
32 
33 #include "const/gui/chat.h"
34 
36 
37 #include "gui/windows/chatwindow.h"
38 
40 
41 #include "net/messagein.h"
42 
43 #include "net/ea/chatrecv.h"
44 
46 
47 #include "resources/chatobject.h"
48 #include "utils/gettext.h"
49 #include "utils/stringutils.h"
50 
51 #include "debug.h"
52 
53 namespace EAthena
54 {
55 
56 namespace ChatRecv
57 {
58  std::string mChatRoom;
59 } // namespace ChatRecv
60 
62 {
63  const int type = msg.readUInt8("type");
64  const int flag = msg.readUInt8("flag");
65  switch (type)
66  {
67  case 0:
68  switch (flag)
69  {
70  case 0:
72  break;
73  case 1:
75  break;
76  case 2:
78  break;
79  default:
81  break;
82  }
83  break;
84  case 1:
85  switch (flag)
86  {
87  case 0:
90  break;
91  case 1:
94  break;
95  default:
98  break;
99  }
100  break;
101 
102  default:
104  break;
105  }
106 }
107 
109 {
110  BLOCK_START("ChatRecv::processChat")
111  const int chatMsgLength = msg.readInt16("len") - 4;
112  if (chatMsgLength <= 0)
113  {
114  BLOCK_END("ChatRecv::processChat")
115  return;
116  }
117 
118  processChatContinue(msg.readRawString(chatMsgLength, "message"),
120 }
121 
123 {
124  const int msgId = msg.readInt16("msg id");
125  // +++ here need load message from configuration file
126  std::string chatMsg;
127  if (msgId >= 1266 && msgId <= 1269)
128  {
130  return;
131  }
132  switch (msgId)
133  {
134  case 1334:
135  // TRANSLATORS: error message
136  chatMsg = _("Can't cast skill in this area.");
137  break;
138  case 1335:
139  // TRANSLATORS: error message
140  chatMsg = _("Can't use item in this area.");
141  break;
142  case 1773:
143  // TRANSLATORS: error message
144  chatMsg = _("Can't equip. Wrong level.");
145  break;
146  case 1774:
147  // TRANSLATORS: error message
148  chatMsg = _("Can't use. Wrong level.");
149  break;
150  case 1923:
151  // TRANSLATORS: error message
152  chatMsg = _("Work in progress."); // busy with npc
153  break;
154  default:
155  chatMsg = strprintf("Message #%d", msgId);
156  break;
157  }
159 }
160 
162 {
163  const int msgId = msg.readInt16("msg id");
164  const int value = msg.readInt32("value");
165  if (msgId == 1862)
166  {
168  return;
169  }
170  // +++ here need load message from configuration file
171  const std::string chatMsg = strprintf(
172  "Message #%d, value: %d", msgId, value);
174 }
175 
177 {
178  const int msgId = msg.readInt16("msg id");
179  msg.readInt32("color");
180  // +++ here need load message from configuration file
181  const std::string chatMsg = strprintf(
182  "Message #%d", msgId);
184 }
185 
187 {
188  const int strLen = msg.readInt16("len") - 6;
189  const int msgId = msg.readInt16("msg id");
190  const std::string message = msg.readString(strLen, "value");
191  // +++ here need load message from configuration file
192  const std::string chatMsg = strprintf(
193  "Message #%d, value: %s", msgId, message.c_str());
195 }
196 
198 {
199  const int strLen = msg.readInt16("len") - 10;
200  const int msgId = msg.readInt16("msg id");
201  msg.readInt32("color");
202  const std::string message = msg.readString(strLen, "value");
203  // +++ here need load message from configuration file
204  const std::string chatMsg = strprintf(
205  "Message #%d, value: %s", msgId, message.c_str());
207 }
208 
210 {
211  const int skillId = msg.readInt16("skill id");
212  const int msgId = msg.readInt32("msg id");
213  // +++ here need load message from configuration file
214  const std::string chatMsg = strprintf(
215  "Message #%d, skill: %d", msgId, skillId);
217 }
218 
220 {
221  BLOCK_START("ChatRecv::processChat")
222  int chatMsgLength = msg.readInt16("len") - 4;
223  msg.readInt32("unused");
224  msg.readInt32("chat color");
225  chatMsgLength -= 8;
226  if (chatMsgLength <= 0)
227  {
228  BLOCK_END("ChatRecv::processChat")
229  return;
230  }
231 
232  std::string message = msg.readRawString(chatMsgLength, "message");
233  std::string msg2 = message;
234  if (findCutFirst(msg2, "You're now in the '#") && findCutLast(msg2, "'"))
235  {
236  const size_t idx = msg2.find("' channel for '");
237  if (idx != std::string::npos && (chatWindow != nullptr))
238  {
239  chatWindow->addChannelTab(std::string("#").append(
240  msg2.substr(0, idx)), false);
241  return;
242  }
243  }
244  else
245  {
246  const std::string nick = Ea::ChatRecv::getLastWhisperNick();
247  if (nick.size() > 1 && nick[0] == '#')
248  {
249  if (message == strprintf("[ %s ] %s : \302\202\302",
250  nick.c_str(), localPlayer->getName().c_str()))
251  {
253  }
254  }
255  }
257 }
258 
259 std::string ChatRecv::extractChannelFromMessage(std::string &chatMsg)
260 {
261  std::string msg = chatMsg;
262  std::string channel(GENERAL_CHANNEL);
263  if (findCutFirst(msg, "[ #"))
264  { // found channel message
265  const size_t idx = msg.find(" ] ");
266  if (idx != std::string::npos)
267  {
268  channel = std::string("#").append(msg.substr(0, idx));
269  chatMsg = msg.substr(idx + 3);
270  }
271  }
272  return channel;
273 }
274 
275 void ChatRecv::processChatContinue(std::string chatMsg,
276  const ChatMsgTypeT own)
277 {
278  const std::string channel = extractChannelFromMessage(chatMsg);
279  bool allow(true);
280  if (chatWindow != nullptr)
281  {
282  allow = chatWindow->resortChatLog(chatMsg,
283  own,
284  channel,
287  }
288 
289  const size_t pos = chatMsg.find(" : ", 0);
290  if (pos != std::string::npos)
291  chatMsg.erase(0, pos + 3);
292 
293  trim(chatMsg);
294 
295  if (localPlayer != nullptr)
296  {
297  if (((chatWindow != nullptr) || Ea::ChatRecv::mShowMotd) && allow)
298  localPlayer->setSpeech(chatMsg);
299  }
300  BLOCK_END("ChatRecv::processChat")
301 }
302 
304 {
305  BLOCK_START("ChatRecv::processChat")
306  const int chatMsgLength = msg.readInt16("len") - 4;
307  if (chatMsgLength <= 0)
308  {
309  BLOCK_END("ChatRecv::processChat")
310  return;
311  }
312 
313  std::string chatMsg = msg.readRawString(chatMsgLength, "message");
314  // remove non persistend "colors" from server.
315  if (!findCutFirst(chatMsg, "ssss"))
316  findCutFirst(chatMsg, "eulb");
317 
318  if (chatWindow != nullptr)
319  chatWindow->addGlobalMessage(chatMsg);
320  BLOCK_END("ChatRecv::processChat")
321 }
322 
324 {
325  const int chatMsgLength = msg.readInt16("len") - 16;
326  msg.readInt32("font color");
327  msg.readInt16("font type");
328  msg.readInt16("font size");
329  msg.readInt16("font align");
330  msg.readInt16("font y");
331  if (chatWindow != nullptr)
332  {
333  const std::string chatMsg = msg.readRawString(chatMsgLength,
334  "message");
335  chatWindow->addGlobalMessage(chatMsg);
336  }
337  else
338  {
339  msg.readRawString(chatMsgLength, "message");
340  }
341 }
342 
344 {
345  BLOCK_START("ChatRecv::processWhisper")
346  int packetLen = 28;
347  if (msg.getVersion() >= 20091104)
348  packetLen += 4;
349  const int chatMsgLength = msg.readInt16("len") - packetLen;
350  std::string nick = msg.readString(24, "nick");
351  if (msg.getVersion() >= 20091104)
352  msg.readInt32("admin flag");
353 
354  if (chatMsgLength <= 0)
355  {
356  BLOCK_END("ChatRecv::processWhisper")
357  return;
358  }
359 
360  processWhisperContinue(nick, msg.readString(chatMsgLength, "message"));
361 }
362 
364 {
365  BLOCK_START("ChatRecv::processWhisperResponse")
366 
367  const uint8_t type = msg.readUInt8("response");
368  if (msg.getVersion() >= 20131223)
369  msg.readBeingId("being id");
370  if (type == 1 && (chatWindow != nullptr))
371  {
372  const std::string nick = Ea::ChatRecv::getLastWhisperNick();
373  if (nick.size() > 1 && nick[0] == '#')
374  {
376  // TRANSLATORS: chat message
377  strprintf(_("Message could not be sent, channel "
378  "%s is not exists."), nick.c_str()),
384  return;
385  }
386  }
388 }
389 
391 {
393  // +++ need put it in some object or window
394  const int count = (msg.readInt16("len") - 4) / 24;
395  for (int f = 0; f < count; f ++)
396  msg.readString(24, "nick");
397 }
398 
400 {
401  if (actorManager == nullptr)
402  return;
403  const int len = msg.readInt16("len") - 17;
404  ChatObject *const obj = new ChatObject;
405  obj->ownerId = msg.readBeingId("owner account id");
406  obj->chatId = msg.readInt32("chat id");
407  obj->maxUsers = msg.readInt16("max users");
408  obj->currentUsers = msg.readInt16("current users");
409  obj->type = msg.readUInt8("type");
410  obj->title = msg.readString(len, "title");
411  obj->update();
412 
413  Being *const dstBeing = actorManager->findBeing(obj->ownerId);
414  if (dstBeing != nullptr)
415  dstBeing->setChat(obj);
416 }
417 
419 {
420  const int count = (msg.readInt16("len") - 8) / 28;
421  const int id = msg.readInt32("chat id");
422 
423  // +++ ignore chat members for now
424  for (int f = 0; f < count; f ++)
425  {
426  msg.readInt32("role");
427  msg.readString(24, "name");
428  }
429 
430  const ChatObject *const oldChat = ChatObject::findById(id);
431 
432  if (oldChat != nullptr)
433  PlayerInfo::setRoomName(oldChat->title);
434  else
435  PlayerInfo::setRoomName(std::string());
436  chatWindow->joinRoom(true);
437  ChatObject *const obj = new ChatObject;
438  if (oldChat != nullptr)
439  {
440  obj->ownerId = oldChat->ownerId;
441  obj->chatId = oldChat->chatId;
442  obj->maxUsers = oldChat->maxUsers;
443  obj->currentUsers = oldChat->currentUsers;
444  obj->type = oldChat->type;
445  obj->title = oldChat->title;
446 // obj->update();
447  }
448  localPlayer->setChat(obj);
449 }
450 
452 {
453  if (actorManager == nullptr)
454  return;
455  msg.readInt16("users");
456  const std::string name = msg.readString(24, "name");
457  const int status = msg.readUInt8("flag"); // 0 - left, 1 - kicked
458  switch (status)
459  {
460  case 0:
462  break;
463  case 1:
465  break;
466  default:
467  UNIMPLEMENTEDPACKETFIELD(status);
468  break;
469  }
470  if ((localPlayer != nullptr) && name == localPlayer->getName())
471  {
472  if (chatWindow != nullptr)
473  chatWindow->joinRoom(false);
474  PlayerInfo::setRoomName(std::string());
475  if (localPlayer != nullptr)
476  localPlayer->setChat(nullptr);
477  }
478  else
479  {
480  Being *const being = actorManager->findBeingByName(
481  name, ActorType::Player);
482  if (being != nullptr)
483  being->setChat(nullptr);
484  }
485 }
486 
488 {
489  if (chatWindow == nullptr)
490  return;
491 
492  const std::string channel = msg.readString(24, "channel name");
493  const int flag = msg.readUInt8("flag");
494 
495  if (channel.size() < 2)
496  return;
497  switch (flag)
498  {
499  case 0:
500  default:
501  chatWindow->channelChatLog(channel,
502  // TRANSLATORS: chat message
503  strprintf(_("Can't open channel. Channel "
504  "%s is not exists."), channel.c_str()),
508  break;
509 
510  case 1:
511  case 2:
512  chatWindow->addChannelTab(std::string("#").append(
513  channel.substr(1)), false);
514  break;
515  }
516 }
517 
518 void ChatRecv::processWhisperContinue(const std::string &nick,
519  std::string chatMsg)
520 {
521  // ignoring future whisper messages
522  if (chatMsg.find("\302\202G") == 0 || chatMsg.find("\302\202A") == 0)
523  {
524  BLOCK_END("ChatRecv::processWhisper")
525  return;
526  }
527  // remove first unicode space if this is may be whisper command.
528  if (chatMsg.find("\302\202!") == 0)
529  chatMsg = chatMsg.substr(2);
530 
531  if (nick != "Server")
532  {
534  {
535  chatWindow->addWhisper(nick,
536  chatMsg,
538  }
539  }
540  else if (localChatTab != nullptr)
541  {
542  localChatTab->chatLog(chatMsg,
546  }
547  BLOCK_END("ChatRecv::processWhisper")
548 }
549 
551 {
552  if (actorManager == nullptr)
553  return;
554 
555  BLOCK_START("ChatRecv::processBeingChat")
556  const int chatMsgLength = msg.readInt16("len") - 8;
557  Being *const being = actorManager->findBeing(msg.readBeingId("being id"));
558 
559  if (chatMsgLength <= 0)
560  {
561  BLOCK_END("ChatRecv::processBeingChat")
562  return;
563  }
564 
565  std::string chatMsg = msg.readRawString(chatMsgLength, "message");
566 
567  if ((being != nullptr) && being->getType() == ActorType::Player)
568  being->setTalkTime();
569 
570  const size_t pos = chatMsg.find(" : ", 0);
571  std::string sender_name = ((pos == std::string::npos)
572  ? "" : chatMsg.substr(0, pos));
573 
574  if ((being != nullptr) && sender_name != being->getName()
575  && being->getType() == ActorType::Player)
576  {
577  if (!being->getName().empty())
578  sender_name = being->getName();
579  }
580  else
581  {
582  chatMsg.erase(0, pos + 3);
583  }
584 
585  trim(chatMsg);
586 
587  bool allow(true);
588  // We use getIgnorePlayer instead of ignoringPlayer here
589  // because ignorePlayer' side effects are triggered
590  // right below for Being::IGNORE_SPEECH_FLOAT.
591  if ((playerRelations.checkPermissionSilently(sender_name,
592  PlayerRelation::SPEECH_LOG) != 0U) && (chatWindow != nullptr))
593  {
594  allow = chatWindow->resortChatLog(
595  removeColors(sender_name).append(" : ").append(chatMsg),
600  }
601 
602  if (allow &&
603  being != nullptr &&
604  playerRelations.hasPermission(sender_name,
606  {
607  being->setSpeech(chatMsg);
608  }
609  BLOCK_END("ChatRecv::processBeingChat")
610 }
611 
613 {
614  const int result = msg.readUInt8("flag");
615  switch (result)
616  {
617  case 0:
618  {
620  chatWindow->joinRoom(true);
621  ChatObject *const obj = new ChatObject;
622  obj->ownerId = localPlayer->getId();
623  obj->chatId = 0;
624  obj->maxUsers = 1000;
625  obj->currentUsers = 1;
626  obj->type = 1;
627  obj->title = mChatRoom;
628  obj->update();
629  localPlayer->setChat(obj);
630  break;
631  }
632  case 1:
634  break;
635  case 2:
637  break;
638  default:
639  UNIMPLEMENTEDPACKETFIELD(result);
640  break;
641  }
642  mChatRoom.clear();
643 }
644 
646 {
647  const int chatId = msg.readInt32("chat id");
648  if (actorManager == nullptr)
649  return;
650  actorManager->removeRoom(chatId);
651 }
652 
654 {
655  const int result = msg.readUInt8("flag");
656  switch (result)
657  {
658  case 0:
660  break;
661  case 1:
663  break;
664  case 2:
666  break;
667  case 3:
668  break;
669  case 4:
671  break;
672  case 5:
674  break;
675  case 6:
677  break;
678  case 7:
680  break;
681  default:
682  UNIMPLEMENTEDPACKETFIELD(result);
683  break;
684  }
685 }
686 
688 {
689  msg.readInt16("users");
690  const std::string name = msg.readString(24, "name");
691  if (localChatTab == nullptr)
692  return;
694 }
695 
697 {
698  const int sz = msg.readInt16("len") - 17;
699  const BeingId ownerId = msg.readBeingId("owner id");
700  const int chatId = msg.readInt32("chat id");
701  const uint16_t limit = msg.readInt16("limit");
702  msg.readInt16("users");
703  const uint8_t type = msg.readUInt8("type");
704  const std::string &title = msg.readString(sz, "title");
705  ChatObject *const chat = localPlayer->getChat();
706  if ((chat != nullptr) && chat->chatId == chatId)
707  {
708  chat->ownerId = ownerId;
709  chat->maxUsers = limit;
710  chat->type = type;
711  if (chat->title != title)
712  {
713  chat->title = title;
714  if (actorManager != nullptr)
715  actorManager->updateRoom(chat);
716  if (chatWindow != nullptr)
717  chatWindow->joinRoom(true);
718  }
719  }
720 }
721 
723 {
724  const int role = msg.readInt32("role");
725  const std::string name = msg.readString(24, "name");
726  switch (role)
727  {
728  case 0:
730  break;
731  case 1:
732  // dont show normal role
733  break;
734  default:
736  break;
737  }
738 }
739 
741 {
743  msg.readItemId("item id");
744 }
745 
747 {
749  msg.readInt32("exp");
750 }
751 
753 {
755 }
756 
758 {
759  const int result = msg.readInt32("type");
760  switch (result)
761  {
762  case 0:
764  break;
765  case 5:
766  break;
767  default:
768  UNIMPLEMENTEDPACKETFIELD(result);
769  break;
770  }
771 }
772 
774 {
775  const int result = msg.readUInt8("type");
776  const std::string name = msg.readString(24, "gm name");
777 
778  switch (result)
779  {
780  case 0:
782  break;
783  case 1:
785  break;
786  default:
787  UNIMPLEMENTEDPACKETFIELD(result);
788  break;
789  }
790 }
791 
793 {
794  msg.readBeingId("being id");
795  const std::string message = msg.readString(80, "message");
796  localChatTab->chatLog(message,
800 }
801 
803 {
805  const int sz = msg.readInt16("len") - 24 - 8;
806  msg.readBeingId("account id");
807  msg.readString(24, "nick");
808  msg.readString(sz, "message");
809 }
810 
812 {
813  const int sz = msg.readInt16("len") - 8;
814  msg.readBeingId("being id");
815  const std::string message = msg.readString(sz, "message");
816  localChatTab->chatLog(message,
820 }
821 
822 } // namespace EAthena
void processGmChat(Net::MessageIn &msg)
Definition: chatrecv.cpp:303
ChatWindow * chatWindow
Definition: chatwindow.cpp:89
void processColorChat(Net::MessageIn &msg)
Definition: chatrecv.cpp:219
void processWhisperResponse(Net::MessageIn &msg)
Definition: chatrecv.cpp:363
unsigned char readUInt8(const char *const str)
Definition: messagein.cpp:103
#define _(s)
Definition: gettext.h:34
void processChatRoomRoleChange(Net::MessageIn &msg)
Definition: chatrecv.cpp:722
void processChatContinue(std::string chatMsg, const ChatMsgTypeT own)
Definition: chatrecv.cpp:275
static const unsigned int WHISPER
void processMannerMessage(Net::MessageIn &msg)
Definition: chatrecv.cpp:757
void processGmChat2(Net::MessageIn &msg)
Definition: chatrecv.cpp:323
void processFormatMessageStringColor(Net::MessageIn &msg)
Definition: chatrecv.cpp:197
BeingId readBeingId(const char *const str)
Definition: messagein.cpp:223
void processChatSilence(Net::MessageIn &msg)
Definition: chatrecv.cpp:773
ChatTab * localChatTab
Definition: chattab.cpp:61
std::string mChatRoom
Definition: chatrecv.cpp:58
void update()
Definition: chatobject.cpp:48
std::string getLastWhisperNick()
Definition: chatrecv.cpp:70
void processChatRoomAddMember(Net::MessageIn &msg)
Definition: chatrecv.cpp:687
ChatTab * addChannelTab(const std::string &name, const bool switchTo)
void setSpeech(const std::string &text)
Definition: being.cpp:571
void setTalkTime()
Definition: being.h:711
void processFormatMessage(Net::MessageIn &msg)
Definition: chatrecv.cpp:122
BeingId getId() const
Definition: actorsprite.h:63
void handleMercenaryMessage(const int cmd)
uint16_t maxUsers
Definition: chatobject.h:47
#define BLOCK_START(name)
Definition: perfomance.h:78
void processIgnoreNickAck(Net::MessageIn &msg)
Definition: chatrecv.cpp:61
int BeingId
Definition: beingid.h:29
void processChatRoomJoinFailed(Net::MessageIn &msg)
Definition: chatrecv.cpp:653
#define BLOCK_END(name)
Definition: perfomance.h:79
const bool TryRemoveColors_true
void chatLog(std::string line, ChatMsgTypeT own, const IgnoreRecord ignoreRecord, const TryRemoveColors tryRemoveColors)
Definition: chattab.cpp:110
bool msg(InputEvent &event)
Definition: chat.cpp:38
void processJoinChannel(Net::MessageIn &msg)
Definition: chatrecv.cpp:487
std::string removeColors(std::string msg)
void notify(const unsigned int message)
static const unsigned int SPEECH_FLOAT
void processFormatColor(Net::MessageIn &msg)
Definition: chatrecv.cpp:176
void processChatDisplay(Net::MessageIn &msg)
Definition: chatrecv.cpp:399
int16_t readInt16(const char *const str)
Definition: messagein.cpp:130
static ChatObject * findById(const int id)
Definition: chatobject.cpp:63
bool hasPermission(const Being *const being, const unsigned int flags) const
bool findCutLast(std::string &str1, const std::string &str2)
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
WhisperQueue mSentWhispers
Definition: chatrecv.cpp:48
void processChatIgnoreList(Net::MessageIn &msg)
Definition: chatrecv.cpp:390
std::string readRawString(int length, const char *const dstr)
Definition: messagein.cpp:394
int getVersion() const
Definition: messagein.h:133
LocalPlayer * localPlayer
void processBattleChatMessage(Net::MessageIn &msg)
Definition: chatrecv.cpp:802
uint16_t currentUsers
Definition: chatobject.h:48
void processChatTalkieBox(Net::MessageIn &msg)
Definition: chatrecv.cpp:792
void processMVPNoItem(Net::MessageIn &msg)
Definition: chatrecv.cpp:752
std::string trim(std::string const &str)
const bool IgnoreRecord_false
Definition: ignorerecord.h:29
Being * findBeing(const BeingId id) const
ActorTypeT getType() const
Definition: being.h:115
std::string extractChannelFromMessage(std::string &chatMsg)
Definition: chatrecv.cpp:259
void processMVPExp(Net::MessageIn &msg)
Definition: chatrecv.cpp:746
void processChatRoomCreateAck(Net::MessageIn &msg)
Definition: chatrecv.cpp:612
const std::string & getName() const
Definition: being.h:231
std::string empty
Definition: podict.cpp:25
void processChatRoomSettings(Net::MessageIn &msg)
Definition: chatrecv.cpp:696
int readItemId(const char *const str)
Definition: messagein.cpp:216
void processWhisperResponseContinue(Net::MessageIn &msg, const uint8_t type)
Definition: chatrecv.cpp:80
void processChatRoomLeave(Net::MessageIn &msg)
Definition: chatrecv.cpp:451
const std::string GENERAL_CHANNEL
Definition: chat.h:28
void processChatRoomDestroy(Net::MessageIn &msg)
Definition: chatrecv.cpp:645
void addGlobalMessage(const std::string &line)
std::string title
Definition: chatobject.h:50
void setRoomName(const std::string &name)
Definition: playerinfo.cpp:635
void joinRoom(const bool isJoin)
void updateRoom(const ChatObject *const newChat)
static const unsigned int SPEECH_LOG
unsigned int checkPermissionSilently(const std::string &player_name, const unsigned int flags) const
void processFormatMessageNumber(Net::MessageIn &msg)
Definition: chatrecv.cpp:161
std::string readString(int length, const char *const dstr)
Definition: messagein.cpp:367
bool mShowMotd
Definition: chatrecv.cpp:51
Being * findBeingByName(const std::string &name, const ActorTypeT type) const
#define UNIMPLEMENTEDPACKET
Definition: logger.h:55
int chatId
Definition: chatobject.h:46
void processFormatMessageString(Net::MessageIn &msg)
Definition: chatrecv.cpp:186
const bool TryRemoveColors_false
bool findCutFirst(std::string &str1, const std::string &str2)
void processMVPItem(Net::MessageIn &msg)
Definition: chatrecv.cpp:740
ChatMsgType ::T ChatMsgTypeT
Definition: chatmsgtype.h:40
int32_t readInt32(const char *const str)
Definition: messagein.cpp:174
BeingId ownerId
Definition: chatobject.h:45
void processChat(Net::MessageIn &msg)
Definition: chatrecv.cpp:108
void processScriptMessage(Net::MessageIn &msg)
Definition: chatrecv.cpp:811
void setChat(ChatObject *const obj)
Definition: being.cpp:5322
void processWhisperContinue(const std::string &nick, std::string chatMsg)
Definition: chatrecv.cpp:518
Definition: being.h:93
void processFormatMessageSkill(Net::MessageIn &msg)
Definition: chatrecv.cpp:209
PlayerRelationsManager playerRelations
void processWhisper(Net::MessageIn &msg)
Definition: chatrecv.cpp:343
void processChatRoomJoinAck(Net::MessageIn &msg)
Definition: chatrecv.cpp:418
uint8_t type
Definition: chatobject.h:49
void addWhisper(const std::string &nick, const std::string &mes, const ChatMsgTypeT own)
bool resortChatLog(std::string line, ChatMsgTypeT own, const std::string &channel, const IgnoreRecord ignoreRecord, const TryRemoveColors tryRemoveColors)
ChatObject * getChat() const
Definition: being.h:1002
ActorManager * actorManager
void processBeingChat(Net::MessageIn &msg)
Definition: chatrecv.cpp:550
#define UNIMPLEMENTEDPACKETFIELD(field)
Definition: logger.h:58
void channelChatLog(const std::string &channel, const std::string &line, ChatMsgTypeT own, const IgnoreRecord ignoreRecord, const TryRemoveColors tryRemoveColors)
void removeRoom(const int chatId)
bool msg2(InputEvent &event)
Definition: chat.cpp:40