44 #include "utils/timer.h"
57 mSentInfoRequest(false),
58 mSentNameRequest(false),
136 if (
guild !=
nullptr)
137 guild->getNames(names);
181 if (
guild !=
nullptr)
183 guild->setServerGuild(
false);
189 std::string name = *it;
190 const size_t sz = name.size();
193 const int status = atoi(name.substr(sz - 1).c_str());
195 name = name.substr(0, sz - 1);
202 if ((status & 2) != 0)
247 if (
guild ==
nullptr)
250 guild->setServerGuild(
false);
266 if (
msg.size() > 4 &&
msg[0] ==
'#' &&
msg[1] ==
'#')
269 const bool haveNick = (
msg.find(
": ") != std::string::npos);
274 if (
guild ==
nullptr)
278 if (
msg[0] ==
'#' &&
msg[1] ==
'#')
295 if (
guild ==
nullptr)
299 if (
msg[0] ==
'#' &&
msg[1] ==
'#')
315 if (
guild ==
nullptr)
318 const size_t pos =
msg.find(
"! (");
319 if (pos == std::string::npos)
333 if (
guild ==
nullptr)
335 size_t pos =
msg.find(
"Access Level: ");
336 if (pos == std::string::npos)
343 pos =
msg.find(
", Guild:");
344 if (pos == std::string::npos)
347 const int level = atoi(
msg.substr(0, pos).c_str());
353 msg =
msg.substr(pos + strlen(
", Guild:"));
354 pos =
msg.find(
", No. Of Online Players: ");
355 if (pos == std::string::npos)
374 if (
msg.empty() ||
msg[
msg.size() - 1] !=
'#')
384 if (
msg.empty() ||
msg[
msg.size() - 1] !=
'#')
390 else if (
msg ==
"You are currently not in a guild. For more information "
391 "or to discuss the possibility of adding you own guild "
392 "please contact Jero.")
399 "this invitation please reply \"yes\" and if not then \"no\" ."))
409 if (
guild ==
nullptr)
413 if (
msg[0] ==
'#' &&
msg[1] ==
'#')
432 else if (
msg ==
"You have been removed from the Guild" ||
433 msg ==
"You have left the Guild")
438 if (
guild ==
nullptr)
446 const size_t pos =
msg.find(
": ", 0);
447 if (pos != std::string::npos)
449 const std::string sender_name =
msg.substr(0, pos);
450 if (
guild->getMember(sender_name) ==
nullptr)
459 msg.erase(0, pos + 2);
460 if (
msg.size() > 3 &&
msg[0] ==
'#' &&
msg[1] ==
'#')
506 if (
guild !=
nullptr)
522 if (
guild ==
nullptr)
524 guild->removeFromMembers();
525 guild->clearMembers();
ActorManager * actorManager
Net::ChatHandler * chatHandler
void updatePlayerColors() const
Being * findBeingByName(const std::string &name, const ActorTypeT type) const
void updatePlayerGuild() const
void setOnline(const bool online)
void setGender(const GenderT g)
void setGuildName(const std::string &name)
void addGuild(Guild *const guild)
const std::string & getName() const
void chatLog(std::string line, ChatMsgTypeT own, const IgnoreRecord ignoreRecord, const TryRemoveColors tryRemoveColors)
void showOnline(const std::string &nick, const Online online)
void loadFromLogFile(const std::string &name)
std::string getValue(const std::string &key, const std::string &deflt) const
bool getBoolValue(const std::string &key) const
void setValue(const std::string &key, const std::string &value)
bool process(std::string msg)
static bool mEnableGuildBot
static void inviteResponse(const bool response)
void createTab(Guild *const guild)
static void notice(const std::string &msg)
void chat(const std::string &msg)
static void send(const std::string &msg)
bool processGuildMessage(const std::string &msg)
static void kick(const std::string &msg)
static void invite(const std::string &msg)
static void getNames(StringVect &names)
static Guild * createGuild()
void setPos(const int pos)
static Guild * getGuild(const int16_t id)
virtual void privateMessage(const std::string &recipient, const std::string &text) const =0
void updateGuildCounter(const int online, const int total)
void showGuildInvite(const std::string &guildName, const int guildId, const std::string &inviterName)
bool removeTab(Guild *const guild)
Configuration serverConfig
GuildManager * guildManager
static const int requestTimeout
const bool IgnoreRecord_false
#define fromInt(val, name)
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 notify(const unsigned int message)
bool limitPackets(const PacketTypeT type)
SocialWindow * socialWindow
void splitToStringVector(StringVect &tokens, const std::string &text, const char separator)
bool findCutFirst(std::string &str1, const std::string &str2)
bool findCutLast(std::string &str1, const std::string &str2)
StringVect::const_iterator StringVectCIter
std::vector< std::string > StringVect
const bool TryRemoveColors_true