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 skillId = msg.readInt16("skill id");
200  const int msgId = msg.readInt32("msg id");
201  // +++ here need load message from configuration file
202  const std::string chatMsg = strprintf(
203  "Message #%d, skill: %d", msgId, skillId);
205 }
206 
208 {
209  BLOCK_START("ChatRecv::processChat")
210  int chatMsgLength = msg.readInt16("len") - 4;
211  msg.readInt32("unused");
212  msg.readInt32("chat color");
213  chatMsgLength -= 8;
214  if (chatMsgLength <= 0)
215  {
216  BLOCK_END("ChatRecv::processChat")
217  return;
218  }
219 
220  std::string message = msg.readRawString(chatMsgLength, "message");
221  std::string msg2 = message;
222  if (findCutFirst(msg2, "You're now in the '#") && findCutLast(msg2, "'"))
223  {
224  const size_t idx = msg2.find("' channel for '");
225  if (idx != std::string::npos && (chatWindow != nullptr))
226  {
227  chatWindow->addChannelTab(std::string("#").append(
228  msg2.substr(0, idx)), false);
229  return;
230  }
231  }
232  else
233  {
234  const std::string nick = Ea::ChatRecv::getLastWhisperNick();
235  if (nick.size() > 1 && nick[0] == '#')
236  {
237  if (message == strprintf("[ %s ] %s : \302\202\302",
238  nick.c_str(), localPlayer->getName().c_str()))
239  {
241  }
242  }
243  }
245 }
246 
247 std::string ChatRecv::extractChannelFromMessage(std::string &chatMsg)
248 {
249  std::string msg = chatMsg;
250  std::string channel(GENERAL_CHANNEL);
251  if (findCutFirst(msg, "[ #"))
252  { // found channel message
253  const size_t idx = msg.find(" ] ");
254  if (idx != std::string::npos)
255  {
256  channel = std::string("#").append(msg.substr(0, idx));
257  chatMsg = msg.substr(idx + 3);
258  }
259  }
260  return channel;
261 }
262 
263 void ChatRecv::processChatContinue(std::string chatMsg,
264  const ChatMsgTypeT own)
265 {
266  const std::string channel = extractChannelFromMessage(chatMsg);
267  bool allow(true);
268  if (chatWindow != nullptr)
269  {
270  allow = chatWindow->resortChatLog(chatMsg,
271  own,
272  channel,
275  }
276 
277  const size_t pos = chatMsg.find(" : ", 0);
278  if (pos != std::string::npos)
279  chatMsg.erase(0, pos + 3);
280 
281  trim(chatMsg);
282 
283  if (localPlayer != nullptr)
284  {
285  if (((chatWindow != nullptr) || Ea::ChatRecv::mShowMotd) && allow)
286  localPlayer->setSpeech(chatMsg);
287  }
288  BLOCK_END("ChatRecv::processChat")
289 }
290 
292 {
293  BLOCK_START("ChatRecv::processChat")
294  const int chatMsgLength = msg.readInt16("len") - 4;
295  if (chatMsgLength <= 0)
296  {
297  BLOCK_END("ChatRecv::processChat")
298  return;
299  }
300 
301  std::string chatMsg = msg.readRawString(chatMsgLength, "message");
302  // remove non persistend "colors" from server.
303  if (!findCutFirst(chatMsg, "ssss"))
304  findCutFirst(chatMsg, "eulb");
305 
306  if (chatWindow != nullptr)
307  chatWindow->addGlobalMessage(chatMsg);
308  BLOCK_END("ChatRecv::processChat")
309 }
310 
312 {
313  const int chatMsgLength = msg.readInt16("len") - 16;
314  msg.readInt32("font color");
315  msg.readInt16("font type");
316  msg.readInt16("font size");
317  msg.readInt16("font align");
318  msg.readInt16("font y");
319  if (chatWindow != nullptr)
320  {
321  const std::string chatMsg = msg.readRawString(chatMsgLength,
322  "message");
323  chatWindow->addGlobalMessage(chatMsg);
324  }
325  else
326  {
327  msg.readRawString(chatMsgLength, "message");
328  }
329 }
330 
332 {
333  BLOCK_START("ChatRecv::processWhisper")
334  int packetLen = 28;
335  if (msg.getVersion() >= 20091104)
336  packetLen += 4;
337  const int chatMsgLength = msg.readInt16("len") - packetLen;
338  std::string nick = msg.readString(24, "nick");
339  if (msg.getVersion() >= 20091104)
340  msg.readInt32("admin flag");
341 
342  if (chatMsgLength <= 0)
343  {
344  BLOCK_END("ChatRecv::processWhisper")
345  return;
346  }
347 
348  processWhisperContinue(nick, msg.readString(chatMsgLength, "message"));
349 }
350 
352 {
353  BLOCK_START("ChatRecv::processWhisperResponse")
354 
355  const uint8_t type = msg.readUInt8("response");
356  if (msg.getVersion() >= 20131223)
357  msg.readInt32("unknown");
358  if (type == 1 && (chatWindow != nullptr))
359  {
360  const std::string nick = Ea::ChatRecv::getLastWhisperNick();
361  if (nick.size() > 1 && nick[0] == '#')
362  {
364  // TRANSLATORS: chat message
365  strprintf(_("Message could not be sent, channel "
366  "%s is not exists."), nick.c_str()),
372  return;
373  }
374  }
376 }
377 
379 {
381  // +++ need put it in some object or window
382  const int count = (msg.readInt16("len") - 4) / 24;
383  for (int f = 0; f < count; f ++)
384  msg.readString(24, "nick");
385 }
386 
388 {
389  if (actorManager == nullptr)
390  return;
391  const int len = msg.readInt16("len") - 17;
392  ChatObject *const obj = new ChatObject;
393  obj->ownerId = msg.readBeingId("owner account id");
394  obj->chatId = msg.readInt32("chat id");
395  obj->maxUsers = msg.readInt16("max users");
396  obj->currentUsers = msg.readInt16("current users");
397  obj->type = msg.readUInt8("type");
398  obj->title = msg.readString(len, "title");
399  obj->update();
400 
401  Being *const dstBeing = actorManager->findBeing(obj->ownerId);
402  if (dstBeing != nullptr)
403  dstBeing->setChat(obj);
404 }
405 
407 {
408  const int count = (msg.readInt16("len") - 8) / 28;
409  const int id = msg.readInt32("chat id");
410 
411  // +++ ignore chat members for now
412  for (int f = 0; f < count; f ++)
413  {
414  msg.readInt32("role");
415  msg.readString(24, "name");
416  }
417 
418  const ChatObject *const oldChat = ChatObject::findById(id);
419 
420  if (oldChat != nullptr)
421  PlayerInfo::setRoomName(oldChat->title);
422  else
423  PlayerInfo::setRoomName(std::string());
424  chatWindow->joinRoom(true);
425  ChatObject *const obj = new ChatObject;
426  if (oldChat != nullptr)
427  {
428  obj->ownerId = oldChat->ownerId;
429  obj->chatId = oldChat->chatId;
430  obj->maxUsers = oldChat->maxUsers;
431  obj->currentUsers = oldChat->currentUsers;
432  obj->type = oldChat->type;
433  obj->title = oldChat->title;
434 // obj->update();
435  }
436  localPlayer->setChat(obj);
437 }
438 
440 {
441  if (actorManager == nullptr)
442  return;
443  msg.readInt16("users");
444  const std::string name = msg.readString(24, "name");
445  const int status = msg.readUInt8("flag"); // 0 - left, 1 - kicked
446  switch (status)
447  {
448  case 0:
450  break;
451  case 1:
453  break;
454  default:
455  UNIMPLEMENTEDPACKETFIELD(status);
456  break;
457  }
458  if ((localPlayer != nullptr) && name == localPlayer->getName())
459  {
460  if (chatWindow != nullptr)
461  chatWindow->joinRoom(false);
462  PlayerInfo::setRoomName(std::string());
463  if (localPlayer != nullptr)
464  localPlayer->setChat(nullptr);
465  }
466  else
467  {
468  Being *const being = actorManager->findBeingByName(
469  name, ActorType::Player);
470  if (being != nullptr)
471  being->setChat(nullptr);
472  }
473 }
474 
476 {
477  if (chatWindow == nullptr)
478  return;
479 
480  const std::string channel = msg.readString(24, "channel name");
481  const int flag = msg.readUInt8("flag");
482 
483  if (channel.size() < 2)
484  return;
485  switch (flag)
486  {
487  case 0:
488  default:
489  chatWindow->channelChatLog(channel,
490  // TRANSLATORS: chat message
491  strprintf(_("Can't open channel. Channel "
492  "%s is not exists."), channel.c_str()),
496  break;
497 
498  case 1:
499  case 2:
500  chatWindow->addChannelTab(std::string("#").append(
501  channel.substr(1)), false);
502  break;
503  }
504 }
505 
506 void ChatRecv::processWhisperContinue(const std::string &nick,
507  std::string chatMsg)
508 {
509  // ignoring future whisper messages
510  if (chatMsg.find("\302\202G") == 0 || chatMsg.find("\302\202A") == 0)
511  {
512  BLOCK_END("ChatRecv::processWhisper")
513  return;
514  }
515  // remove first unicode space if this is may be whisper command.
516  if (chatMsg.find("\302\202!") == 0)
517  chatMsg = chatMsg.substr(2);
518 
519  if (nick != "Server")
520  {
522  {
523  chatWindow->addWhisper(nick,
524  chatMsg,
526  }
527  }
528  else if (localChatTab != nullptr)
529  {
530  localChatTab->chatLog(chatMsg,
534  }
535  BLOCK_END("ChatRecv::processWhisper")
536 }
537 
539 {
540  if (actorManager == nullptr)
541  return;
542 
543  BLOCK_START("ChatRecv::processBeingChat")
544  const int chatMsgLength = msg.readInt16("len") - 8;
545  Being *const being = actorManager->findBeing(msg.readBeingId("being id"));
546 
547  if (chatMsgLength <= 0)
548  {
549  BLOCK_END("ChatRecv::processBeingChat")
550  return;
551  }
552 
553  std::string chatMsg = msg.readRawString(chatMsgLength, "message");
554 
555  if ((being != nullptr) && being->getType() == ActorType::Player)
556  being->setTalkTime();
557 
558  const size_t pos = chatMsg.find(" : ", 0);
559  std::string sender_name = ((pos == std::string::npos)
560  ? "" : chatMsg.substr(0, pos));
561 
562  if ((being != nullptr) && sender_name != being->getName()
563  && being->getType() == ActorType::Player)
564  {
565  if (!being->getName().empty())
566  sender_name = being->getName();
567  }
568  else
569  {
570  chatMsg.erase(0, pos + 3);
571  }
572 
573  trim(chatMsg);
574 
575  bool allow(true);
576  // We use getIgnorePlayer instead of ignoringPlayer here
577  // because ignorePlayer' side effects are triggered
578  // right below for Being::IGNORE_SPEECH_FLOAT.
579  if ((playerRelations.checkPermissionSilently(sender_name,
580  PlayerRelation::SPEECH_LOG) != 0u) && (chatWindow != nullptr))
581  {
582  allow = chatWindow->resortChatLog(
583  removeColors(sender_name).append(" : ").append(chatMsg),
588  }
589 
590  if (allow &&
591  being != nullptr &&
592  playerRelations.hasPermission(sender_name,
594  {
595  being->setSpeech(chatMsg);
596  }
597  BLOCK_END("ChatRecv::processBeingChat")
598 }
599 
601 {
602  const int result = msg.readUInt8("flag");
603  switch (result)
604  {
605  case 0:
606  {
608  chatWindow->joinRoom(true);
609  ChatObject *const obj = new ChatObject;
610  obj->ownerId = localPlayer->getId();
611  obj->chatId = 0;
612  obj->maxUsers = 1000;
613  obj->currentUsers = 1;
614  obj->type = 1;
615  obj->title = mChatRoom;
616  obj->update();
617  localPlayer->setChat(obj);
618  break;
619  }
620  case 1:
622  break;
623  case 2:
625  break;
626  default:
627  UNIMPLEMENTEDPACKETFIELD(result);
628  break;
629  }
630  mChatRoom.clear();
631 }
632 
634 {
635  const int chatId = msg.readInt32("chat id");
636  if (actorManager == nullptr)
637  return;
638  actorManager->removeRoom(chatId);
639 }
640 
642 {
643  const int result = msg.readUInt8("flag");
644  switch (result)
645  {
646  case 0:
648  break;
649  case 1:
651  break;
652  case 2:
654  break;
655  case 3:
656  break;
657  case 4:
659  break;
660  case 5:
662  break;
663  case 6:
665  break;
666  case 7:
668  break;
669  default:
670  UNIMPLEMENTEDPACKETFIELD(result);
671  break;
672  }
673 }
674 
676 {
677  msg.readInt16("users");
678  const std::string name = msg.readString(24, "name");
679  if (localChatTab == nullptr)
680  return;
682 }
683 
685 {
686  const int sz = msg.readInt16("len") - 17;
687  const BeingId ownerId = msg.readBeingId("owner id");
688  const int chatId = msg.readInt32("chat id");
689  const uint16_t limit = msg.readInt16("limit");
690  msg.readInt16("users");
691  const uint8_t type = msg.readUInt8("type");
692  const std::string &title = msg.readString(sz, "title");
693  ChatObject *const chat = localPlayer->getChat();
694  if ((chat != nullptr) && chat->chatId == chatId)
695  {
696  chat->ownerId = ownerId;
697  chat->maxUsers = limit;
698  chat->type = type;
699  if (chat->title != title)
700  {
701  chat->title = title;
702  if (actorManager != nullptr)
703  actorManager->updateRoom(chat);
704  if (chatWindow != nullptr)
705  chatWindow->joinRoom(true);
706  }
707  }
708 }
709 
711 {
712  const int role = msg.readInt32("role");
713  const std::string name = msg.readString(24, "name");
714  switch (role)
715  {
716  case 0:
718  break;
719  case 1:
720  // dont show normal role
721  break;
722  default:
724  break;
725  }
726 }
727 
729 {
731  msg.readInt16("item id");
732 }
733 
735 {
737  msg.readInt32("exo");
738 }
739 
741 {
743 }
744 
746 {
747  const int result = msg.readInt32("type");
748  switch (result)
749  {
750  case 0:
752  break;
753  case 5:
754  break;
755  default:
756  UNIMPLEMENTEDPACKETFIELD(result);
757  break;
758  }
759 }
760 
762 {
763  const int result = msg.readUInt8("type");
764  const std::string name = msg.readString(24, "gm name");
765 
766  switch (result)
767  {
768  case 0:
770  break;
771  case 1:
773  break;
774  default:
775  UNIMPLEMENTEDPACKETFIELD(result);
776  break;
777  }
778 }
779 
781 {
782  msg.readBeingId("being id");
783  const std::string message = msg.readString(80, "message");
784  localChatTab->chatLog(message,
788 }
789 
791 {
793  const int sz = msg.readInt16("len") - 24 - 8;
794  msg.readBeingId("account id");
795  msg.readString(24, "nick");
796  msg.readString(sz, "message");
797 }
798 
800 {
801  const int sz = msg.readInt16("len") - 8;
802  msg.readBeingId("being id");
803  const std::string message = msg.readString(sz, "message");
804  localChatTab->chatLog(message,
808 }
809 
810 } // namespace EAthena
void processGmChat(Net::MessageIn &msg)
Definition: chatrecv.cpp:291
ChatWindow * chatWindow
Definition: chatwindow.cpp:89
void processColorChat(Net::MessageIn &msg)
Definition: chatrecv.cpp:207
void processWhisperResponse(Net::MessageIn &msg)
Definition: chatrecv.cpp:351
unsigned char readUInt8(const char *const str)
Definition: messagein.cpp:98
#define _(s)
Definition: gettext.h:34
void processChatRoomRoleChange(Net::MessageIn &msg)
Definition: chatrecv.cpp:710
void processChatContinue(std::string chatMsg, const ChatMsgTypeT own)
Definition: chatrecv.cpp:263
static const unsigned int WHISPER
void processMannerMessage(Net::MessageIn &msg)
Definition: chatrecv.cpp:745
void processGmChat2(Net::MessageIn &msg)
Definition: chatrecv.cpp:311
BeingId readBeingId(const char *const str)
Definition: messagein.cpp:211
void processChatSilence(Net::MessageIn &msg)
Definition: chatrecv.cpp:761
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:675
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:641
#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:475
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:387
int16_t readInt16(const char *const str)
Definition: messagein.cpp:125
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:378
std::string readRawString(int length, const char *const dstr)
Definition: messagein.cpp:382
LocalPlayer * localPlayer
void processBattleChatMessage(Net::MessageIn &msg)
Definition: chatrecv.cpp:790
uint16_t currentUsers
Definition: chatobject.h:48
void processChatTalkieBox(Net::MessageIn &msg)
Definition: chatrecv.cpp:780
void processMVPNoItem(Net::MessageIn &msg)
Definition: chatrecv.cpp:740
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:247
void processMVPExp(Net::MessageIn &msg)
Definition: chatrecv.cpp:734
unsigned int getVersion() const
Definition: messagein.h:131
void processChatRoomCreateAck(Net::MessageIn &msg)
Definition: chatrecv.cpp:600
const std::string & getName() const
Definition: being.h:231
std::string empty
Definition: podict.cpp:25
void processChatRoomSettings(Net::MessageIn &msg)
Definition: chatrecv.cpp:684
void processWhisperResponseContinue(Net::MessageIn &msg, const uint8_t type)
Definition: chatrecv.cpp:80
void processChatRoomLeave(Net::MessageIn &msg)
Definition: chatrecv.cpp:439
const std::string GENERAL_CHANNEL
Definition: chat.h:28
void processChatRoomDestroy(Net::MessageIn &msg)
Definition: chatrecv.cpp:633
void addGlobalMessage(const std::string &line)
std::string title
Definition: chatobject.h:50
void setRoomName(const std::string &name)
Definition: playerinfo.cpp:634
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:355
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:728
ChatMsgType ::T ChatMsgTypeT
Definition: chatmsgtype.h:40
int32_t readInt32(const char *const str)
Definition: messagein.cpp:169
BeingId ownerId
Definition: chatobject.h:45
void processChat(Net::MessageIn &msg)
Definition: chatrecv.cpp:108
void processScriptMessage(Net::MessageIn &msg)
Definition: chatrecv.cpp:799
void setChat(ChatObject *const obj)
Definition: being.cpp:5322
void processWhisperContinue(const std::string &nick, std::string chatMsg)
Definition: chatrecv.cpp:506
Definition: being.h:93
void processFormatMessageSkill(Net::MessageIn &msg)
Definition: chatrecv.cpp:197
PlayerRelationsManager playerRelations
void processWhisper(Net::MessageIn &msg)
Definition: chatrecv.cpp:331
void processChatRoomJoinAck(Net::MessageIn &msg)
Definition: chatrecv.cpp:406
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:538
#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