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