63 const int chatMsgLength =
msg.readInt16(
"len") - 4;
64 if (chatMsgLength <= 0)
75 const size_t pos = chatMsg.find(
" : ", 0);
87 const std::string senseStr(
"You sense the following: ");
88 if ((
actorManager !=
nullptr) && (chatMsg.find(senseStr) == 0U))
91 chatMsg.substr(senseStr.size()));
94 if (pos == std::string::npos &&
112 if (pos != std::string::npos)
113 chatMsg.erase(0, pos + 3);
128 const int chatMsgLength =
msg.readInt16(
"len") - 4;
129 if (chatMsgLength <= 0)
138 std::string chatMsg =
msg.readRawString(chatMsgLength,
"message");
143 msg.readRawString(chatMsgLength,
"message");
151 const int chatMsgLength =
msg.readInt16(
"len") - 28;
152 std::string nick =
msg.readString(24,
"nick");
154 if (chatMsgLength <= 0)
167 const uint8_t type =
msg.readUInt8(
"response");
175 if (chatMsg.find(
"\302\202G") == 0 || chatMsg.find(
"\302\202A") == 0)
181 if (chatMsg.find(
"\302\202!") == 0)
182 chatMsg = chatMsg.substr(2);
184 if (nick !=
"Server")
201 if (chatMsg.find(
"!selllist ") == 0)
214 else if (chatMsg.find(
"!buylist ") == 0)
227 else if (chatMsg.find(
"!buyitem ") == 0)
241 else if (chatMsg.find(
"!sellitem ") == 0)
255 else if (chatMsg.length() > 3
256 && chatMsg.find(
"\302\202") == 0)
258 chatMsg = chatMsg.erase(0, 2);
263 _(
"Detected spam from: %s"),
275 if (chatMsg.find(
"B1") == 0 || chatMsg.find(
"S1") == 0)
296 (chatMsg.find(
"!selllist") != 0 &&
297 chatMsg.find(
"!buylist") != 0)))
310 chatMsg = chatMsg.substr(5);
311 const size_t pos = chatMsg.find(
": ", 0);
312 if (pos == std::string::npos)
322 chatMsg.substr(pos + 2));
342 const int chatMsgLength =
msg.readInt16(
"len") - 8;
343 const BeingId beingId =
msg.readBeingId(
"being id");
346 if (chatMsgLength <= 0)
352 std::string chatMsg =
msg.readRawString(chatMsgLength,
"message");
357 const size_t pos = chatMsg.find(
" : ", 0);
358 std::string sender_name = ((pos == std::string::npos)
359 ?
"" : chatMsg.substr(0, pos));
364 if (being !=
nullptr)
365 sender_name = being->
getName();
366 if (sender_name.empty())
371 sender_name.append(
" ").append(name);
374 else if ((being !=
nullptr) &&
375 sender_name != being->
getName() &&
379 sender_name = being->
getName();
383 chatMsg.erase(0, pos + 3);
397 removeColors(sender_name).append(
" : ").append(chatMsg),
405 (being !=
nullptr) &&
416 const int sz =
msg.readInt16(
"len") - 5;
417 msg.readUInt8(
"message type");
418 const std::string message =
msg.readString(sz,
"message");
ActorManager * actorManager
Being * findBeing(const BeingId id) const
void parseLevels(std::string levels) const
std::string getSeenPlayerById(const BeingId id) const
const std::string & getName() const
void setSpeech(const std::string &text)
ActorTypeT getType() const
void chatLog(std::string line, ChatMsgTypeT own, const IgnoreRecord ignoreRecord, const TryRemoveColors tryRemoveColors)
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)
void addGlobalMessage(const std::string &line)
bool getBoolValue(const std::string &key) const
static bool getEnableGuildBot()
bool processGuildMessage(const std::string &msg)
virtual bool haveIncompleteChatMessages() const =0
bool hasPermission(const Being *const being, const unsigned int flags) const
unsigned int checkPermissionSilently(const std::string &player_name, const unsigned int flags) const
void giveList(const std::string &nick, const int mode)
static void showList(const std::string &nick, std::string data)
void processRequest(const std::string &nick, std::string data, const int mode)
const std::string GENERAL_CHANNEL
GuildManager * guildManager
const bool IgnoreRecord_false
LocalPlayer * localPlayer
bool msg(InputEvent &event)
std::string trim(std::string const &str)
std::string toString(T const &value)
converts any type to a string
void processChatContinue(std::string chatMsg, const ChatMsgTypeT own)
void processWhisperContinue(const std::string &nick, std::string chatMsg)
void processWhisperResponseContinue(Net::MessageIn &msg, const uint8_t type)
void processWhisperContinue(const std::string &nick, std::string chatMsg)
void processChatContinue(std::string chatMsg)
void processScriptMessage(Net::MessageIn &msg)
void processBeingChat(Net::MessageIn &msg)
void processGmChat(Net::MessageIn &msg)
void processChat(Net::MessageIn &msg)
std::string mShopRequestName
void processWhisper(Net::MessageIn &msg)
void processWhisperResponse(Net::MessageIn &msg)
Net::ServerFeatures * serverFeatures
#define BLOCK_START(name)
PlayerRelationsManager playerRelations
std::string removeColors(std::string msg)
std::string strprintf(const char *const format,...)
bool strStartWith(const std::string &str1, const std::string &str2)
static const unsigned int SPEECH_FLOAT
static const unsigned int SPEECH_LOG
static const unsigned int WHISPER
static const unsigned int TRADE
const bool TryRemoveColors_true