39 #include "gui/viewport.h"
78 #include "resources/map/map.h"
89 #ifdef HAVE_MALLOC_TRIM
100 std::string args =
event.args;
103 if (event.
tab ==
nullptr ||
106 return std::string();
110 if (whisper->
getNick().empty())
113 event.tab->
chatLog(
_(
"Please specify a name."),
117 return std::string();
126 const std::string &str1,
127 const std::string &str2)
129 if (event.
tab !=
nullptr)
134 event.tab->chatLog(str1,
142 event.tab->chatLog(str2,
152 const std::string &relationText)
154 std::string args =
getNick(event);
160 if (event.
tab !=
nullptr)
163 event.tab->chatLog(
strprintf(
_(
"Player already %s!"),
164 relationText.c_str()),
179 strprintf(
_(
"Player successfully %s!"), relationText.c_str()),
181 strprintf(
_(
"Player could not be %s!"), relationText.c_str()));
202 std::string args =
getNick(event);
213 if (event.tab !=
nullptr)
216 event.tab->chatLog(
_(
"Player wasn't ignored!"),
227 _(
"Player no longer ignored!"),
229 _(
"Player could not be unignored!"));
235 std::string args =
getNick(event);
241 if (event.tab !=
nullptr)
244 event.tab->chatLog(
_(
"Player already erased!"),
256 _(
"Player no longer erased!"),
258 _(
"Player could not be erased!"));
302 const std::string nick =
getNick(event);
305 if (being ==
nullptr)
318 if (event.args.empty())
341 if (floorItem !=
nullptr)
390 if (target !=
nullptr)
399 if (!event.args.empty())
401 const std::string op =
event.args.substr(0, 1);
461 if (!event.args.empty())
465 else if (event.tab !=
nullptr &&
473 if (being !=
nullptr)
505 const std::string args =
event.args;
511 if (being !=
nullptr)
518 if (
party !=
nullptr)
561 if (!event.args.empty())
565 else if (event.tab !=
nullptr &&
619 if (event.tab ==
nullptr ||
630 if (
guild !=
nullptr)
680 if (event.args.empty())
725 if (event.tab !=
nullptr)
727 std::string url1 =
event.args;
729 url1 =
"http://" + url1;
730 std::string str(
strprintf(
"[@@%s |%s@@]",
731 url1.c_str(), event.args.c_str()));
740 std::string
url =
event.args;
749 const size_t idx =
event.args.find(
' ');
752 if (idx == std::string::npos)
758 name =
event.args.substr(0, idx);
759 params =
event.args.substr(idx + 1);
767 if (event.tab !=
nullptr)
769 event.tab->setAllowHighlight(
true);
781 if (event.tab !=
nullptr)
783 event.tab->setAllowHighlight(
false);
795 if (event.tab !=
nullptr)
797 event.tab->setRemoveNames(
false);
809 if (event.tab !=
nullptr)
811 event.tab->setRemoveNames(
true);
823 if (event.tab !=
nullptr)
825 event.tab->setNoAway(
true);
837 if (event.tab !=
nullptr)
839 event.tab->setNoAway(
false);
893 int cnt = atoi(event.args.c_str());
896 const int half = cnt / 2;
907 for (
int x = x1;
x < x2;
x ++)
909 for (
int y = y1;
y < y2;
y ++)
917 std::string args =
getNick(event);
931 std::string args =
getNick(event);
945 const std::string args =
event.args;
992 if (
guild !=
nullptr)
1020 std::string args =
event.args;
1061 atoi(event.args.c_str())));
1069 if ((
chatHandler ==
nullptr) || event.args.empty())
1079 const std::string args =
event.args;
1083 if (chat ==
nullptr)
1127 const std::string args =
event.args;
1132 const std::string str =
strprintf(
_(
"Config value: %s"),
1140 const std::string args =
event.args;
1145 const std::string str =
strprintf(
_(
"Server config value: %s"),
1181 const int sz =
CAST_S32(vect.size());
1184 const int skillId = atoi(vect[0].c_str());
1189 level = atoi(vect[1].c_str());
1221 const std::string args =
event.args;
1238 if ((dialog !=
nullptr) &&
parse2Int(event.args,
x,
y))
1249 const std::string args =
event.args;
1273 if (event.args.empty())
1312 const std::string args =
event.args;
1321 const std::string args =
event.args;
1330 const std::string args =
event.args;
1339 const std::string args =
event.args;
1348 const std::string args =
event.args;
1399 const std::string args =
event.args;
1408 const std::string args =
event.args;
1417 const std::string args =
event.args;
1426 const std::string args =
event.args;
1435 const std::string args =
event.args;
1444 const std::string args =
event.args;
1453 const std::string args =
event.args;
1480 const std::string args =
event.args;
1489 const std::string args =
event.args;
1498 const std::string args =
event.args;
1507 const std::string args =
event.args;
1540 const std::string args =
event.args;
1561 const std::string args =
event.args;
1576 const std::string args =
event.args;
1585 const std::string args =
event.args;
1594 const std::string args =
event.args;
1601 if (pars.size() != 3)
1605 atoi(pars[1].c_str()),
1606 atoi(pars[2].c_str()));
1612 const std::string args =
event.args;
1621 const std::string args =
event.args;
1630 const std::string args =
event.args;
1639 const std::string args =
event.args;
1654 const std::string args =
event.args;
1665 const std::string args =
event.args;
1683 const std::string nick =
getNick(event);
1686 if (being ==
nullptr)
1694 const std::string args =
event.args;
1698 atoi(args.c_str()));
1699 if (
skill ==
nullptr)
1707 const std::string args =
event.args;
1711 atoi(args.c_str()));
1712 if (
skill ==
nullptr)
1734 const std::string args =
event.args;
1738 atoi(args.c_str()));
1739 if (
skill ==
nullptr)
1747 const std::string args =
event.args;
1751 atoi(args.c_str()));
1752 if (
skill ==
nullptr)
1798 const std::string args =
event.args;
1805 tab->
chatLog(
_(
"Item sharing enabled."),
1812 tab->
chatLog(
_(
"Item sharing disabled."),
1819 tab->
chatLog(
_(
"Item sharing not possible."),
1826 tab->
chatLog(
_(
"Item sharing unknown."),
1874 const std::string args =
event.args;
1881 tab->
chatLog(
_(
"Experience sharing enabled."),
1888 tab->
chatLog(
_(
"Experience sharing disabled."),
1895 tab->
chatLog(
_(
"Experience sharing not possible."),
1902 tab->
chatLog(
_(
"Experience sharing unknown."),
1950 const std::string args =
event.args;
1957 tab->
chatLog(
_(
"Auto item sharing enabled."),
1964 tab->
chatLog(
_(
"Auto item sharing disabled."),
1971 tab->
chatLog(
_(
"Auto item sharing not possible."),
1978 tab->
chatLog(
_(
"Auto item sharing unknown."),
2036 const std::string args =
event.args;
2040 std::list<std::string> mobs
2042 std::list<std::string>::iterator it = mobs.begin();
2043 std::list<std::string>::iterator it2 = it;
2044 while (it != mobs.end())
2049 mobs.splice(it2, mobs, it);
2069 const std::string args =
event.args;
2074 std::list<std::string> mobs
2076 std::list<std::string>::iterator it = mobs.begin();
2077 std::list<std::string>::iterator it2 = it;
2078 while (it != mobs.end())
2083 if (it2 == mobs.end())
2086 mobs.splice(it, mobs, it2);
2106 const std::string args =
event.args;
2108 getPriorityAttackMobIndex(args);
2111 std::list<std::string> mobs
2113 std::list<std::string>::iterator it = mobs.begin();
2114 std::list<std::string>::iterator it2 = it;
2115 while (it != mobs.end())
2120 mobs.splice(it2, mobs, it);
2140 const std::string args =
event.args;
2146 std::list<std::string> mobs
2148 std::list<std::string>::iterator it = mobs.begin();
2149 std::list<std::string>::iterator it2 = it;
2150 while (it != mobs.end())
2155 if (it2 == mobs.end())
2158 mobs.splice(it, mobs, it2);
2176 const std::string args =
event.args;
2183 atoi(args.c_str()));
2184 if (
skill ==
nullptr)
2204 skill->toDataStr());
2212 #ifdef HAVE_MALLOC_TRIM
#define impHandler0(name)
ActorManager * actorManager
Net::AdminHandler * adminHandler
const bool AutoTarget_true
Net::ChatHandler * chatHandler
std::string textToMe(const std::string &str)
void outStringNormal(ChatTab *const tab, const std::string &str, const std::string &def)
int getPriorityAttackMobIndex(const std::string &name) const
std::list< std::string > getAttackMobs() const
bool isInAttackList(const std::string &name) const
void setAttackMobs(const std::list< std::string > &mobs)
static Being * cloneBeing(const Being *const srcBeing, const int dx, const int dy, const int id)
Being * findBeingByName(const std::string &name, const ActorTypeT type) const
bool checkDefaultPickup() const
void addAttackMob(const std::string &name)
void destroy(ActorSprite *const actor)
bool isInPriorityAttackList(const std::string &name) const
void addIgnorePickupItem(const std::string &name)
void addIgnoreAttackMob(const std::string &name)
void addBlock(const BeingId id)
void removeAttackMob(const std::string &name)
int getPriorityAttackMobsSize() const
void rebuildPriorityAttackMobs()
void addPickupItem(const std::string &name)
int getAttackMobsSize() const
FloorItem * findItem(const BeingId id) const
Being * findNearestByName(const std::string &name, const ActorTypeT &type) const
std::list< std::string > getPriorityAttackMobs() const
void removePickupItem(const std::string &name)
void addPriorityAttackMob(const std::string &name)
int getAttackMobIndex(const std::string &name) const
void setPriorityAttackMobs(const std::list< std::string > &mobs)
const Map * getMap() const
std::string getMap() const
const Guild * getGuild(const std::string &guildName) const
const std::string & getName() const
ChatTabTypeT getType() const
void chatLog(std::string line, ChatMsgTypeT own, const IgnoreRecord ignoreRecord, const TryRemoveColors tryRemoveColors)
void addItemText(const std::string &item)
void addInputText(const std::string &text, const bool space)
bool getBoolValue(const std::string &key) const
std::string getStringValue(const std::string &key) const
void setValue(const std::string &key, const std::string &value)
unsigned char getEmote(const size_t index) const
static void setQuickDropCounter(const int n)
void moveItemToCraft(const int craftSlot)
size_t getFreeIndex() const
void setItemData(const size_t index, const std::string &data)
void setItem(const size_t index)
void setTarget(Being *const target)
Being * getTarget() const
void waitFor(const std::string &nick)
void setFollow(const std::string &player)
bool navigateTo(const int x, const int y)
void setImitate(const std::string &player)
void setDestination(const int x, const int y)
void setTestParticle(const std::string &fileName, const bool updateHash)
void setAway(const std::string &message) const
static bool emote(const uint8_t emotion)
static void setPseudoAway(const std::string &message)
void updateStatus() const
static void createMail(const std::string &to)
virtual void mobSpawnSearch(const std::string &name) const =0
virtual void disguise(const std::string &name) const =0
virtual void playerGmCommands(const std::string &name) const =0
virtual void whoDrops(const std::string &name) const =0
virtual void showStorageList(const std::string &name) const =0
virtual void heal(const std::string &name) const =0
virtual void recallName(const std::string &name) const =0
virtual void changePartyLeader(const std::string &name) const =0
virtual void breakGuild(const std::string &name) const =0
virtual void gotoName(const std::string &name) const =0
virtual void partyRecall(const std::string &name) const =0
virtual void loadPosition(const std::string &name) const =0
virtual void showLevel(const std::string &name) const =0
virtual void hide(const bool hide) const =0
virtual void nuke(const std::string &name) const =0
virtual void killable(const std::string &name) const =0
virtual void spawnClone(const std::string &name) const =0
virtual void locatePlayer(const std::string &name) const =0
virtual void jail(const std::string &name) const =0
virtual void playerCharGmCommands(const std::string &name) const =0
virtual void slide(const int x, const int y) const =0
virtual void immortal(const std::string &name) const =0
virtual void spawnSlave(const std::string &name) const =0
virtual void hideNpc(const std::string &name) const =0
virtual void ipcheckName(const std::string &name) const =0
virtual void killer(const std::string &name) const =0
virtual void itemInfo(const std::string &name) const =0
virtual void showAccountInfo(const std::string &name) const =0
virtual void showInventoryList(const std::string &name) const =0
virtual void kill(const std::string &name) const =0
virtual void spawnEvilClone(const std::string &name) const =0
virtual void announce(const std::string &text) const =0
virtual void randomWarp(const std::string &name) const =0
virtual void guildRecall(const std::string &name) const =0
virtual void npcMove(const std::string &name, const int x, const int y) const =0
virtual void gotoNpc(const std::string &name) const =0
virtual void showStats(const std::string &name) const =0
virtual void showCartList(const std::string &name) const =0
virtual void spawnSlaveClone(const std::string &name) const =0
virtual void warp(const std::string &map, const int x, const int y) const =0
virtual void unjail(const std::string &name) const =0
virtual void monsterInfo(const std::string &name) const =0
virtual void spawn(const std::string &name) const =0
virtual void alive(const std::string &name) const =0
virtual void savePosition(const std::string &name) const =0
virtual void showNpc(const std::string &name) const =0
virtual void mobSearch(const std::string &name) const =0
virtual void talkRaw(const std::string &text) const =0
virtual void ignore(const std::string &nick) const =0
virtual void unIgnore(const std::string &nick) const =0
virtual void privateMessage(const std::string &recipient, const std::string &text) const =0
virtual void sendRaw(const std::string &args) const =0
virtual void createChatRoom(const std::string &title, const std::string &password, const int limit, const bool isPublic) const =0
virtual void leaveChatRoom() const =0
virtual void joinChat(const ChatObject *const chat, const std::string &password) const =0
virtual void askForChild(const Being *const being) const =0
virtual void info() const =0
virtual void leave(const int guildId) const =0
virtual void emote(const uint8_t emoteId) const =0
virtual void fire() const =0
virtual void talk(const std::string &text) const =0
virtual void setName(const std::string &name) const =0
virtual void queueCheckName(const MailQueueTypeT type, const std::string &to, const std::string &title, const std::string &body, const int64_t &money) const =0
virtual void send(const std::string &name, const std::string &title, std::string message) const =0
virtual NpcDialog * getCurrentNpcDialog() const =0
virtual void leave() const =0
virtual PartyShareT getShareExperience() const =0
virtual void setShareAutoItems(const PartyShareT share) const =0
virtual void setShareExperience(const PartyShareT share) const =0
virtual void setShareItems(const PartyShareT share) const =0
virtual PartyShareT getShareAutoItems() const =0
virtual PartyShareT getShareItems() const =0
virtual bool haveTalkPet() const =0
void copyToClipboard(const int x, const int y) const
void wearNextOutfit(const bool all)
void clearCurrentOutfit()
void wearPreviousOutfit(const bool all)
void wearOutfit(const int outfit, const bool unwearEmpty, const bool select)
std::string getOutfitString() const
RelationT getRelation(const std::string &name) const
void setRelation(const std::string &name, const RelationT relation)
void selectSkillLevel(const int skillId, const int level)
void setSkillOffsetY(const int skillId, const int offset)
void selectSkillCastType(const int skillId, const CastTypeT type)
SkillInfo * getSkill(const int id) const
static void useSkill(const int skillId, const AutoTarget autoTarget, int level, const bool withText, const std::string &text, CastTypeT castType, const int offsetX, const int offsetY)
void setSkillOffsetX(const int skillId, const int offset)
void updatePickupFilter()
void updateAttackFilter()
void moveCameraToPosition(const int x, const int y)
const std::string & getNick() const
Configuration serverConfig
const size_t SHORTCUT_AUTO_TAB
const unsigned int SHORTCUT_ITEMS
const unsigned int SHORTCUT_TABS
static const int mapTileSize
bool sendBuffer(const std::string &text)
EmoteShortcut * emoteShortcut
Net::FamilyHandler * familyHandler
Net::GuildHandler * guildHandler
Net::HomunculusHandler * homunculusHandler
const bool IgnoreRecord_false
#define fromInt(val, name)
InventoryWindow * inventoryWindow
ItemShortcut * itemShortcut[SHORTCUT_TABS]
LocalPlayer * localPlayer
Net::Mail2Handler * mail2Handler
Net::MailHandler * mailHandler
bool enableHighlight(InputEvent &event)
bool pseudoAway(InputEvent &event)
bool chatErase(InputEvent &event)
bool awayMessage(InputEvent &event)
bool addPickup(InputEvent &event)
bool commandKiller(InputEvent &event)
bool adoptChild(InputEvent &event)
bool sendMail(InputEvent &event)
bool showSkillOffsetX(InputEvent &event)
bool craft(InputEvent &event)
bool disableHighlight(InputEvent &event)
bool chatIgnore(InputEvent &event)
bool monsterInfo(InputEvent &event)
bool mobSpawnSearch(InputEvent &event)
bool guild(InputEvent &event)
bool chatNeutral(InputEvent &event)
bool commandGotoPc(InputEvent &event)
static std::string getNick(const InputEvent &event)
bool commandOutfit(InputEvent &event)
bool commandBreakGuild(InputEvent &event)
bool commandKill(InputEvent &event)
bool wait(InputEvent &event)
bool playerCharGmCommands(InputEvent &event)
bool createPublicChatRoom(InputEvent &event)
bool fireHomunculus(InputEvent &event)
bool commandShowLevel(InputEvent &event)
bool addIgnoreAttack(InputEvent &event)
bool commandHomunEmote(InputEvent &event)
bool debugSpawn(InputEvent &event)
bool commandJail(InputEvent &event)
bool commandSpawnClone(InputEvent &event)
bool moveAttackUp(InputEvent &event)
bool leaveParty(InputEvent &event)
bool moveCamera(InputEvent &event)
bool commandSpawnEvilClone(InputEvent &event)
bool chatFriend(InputEvent &event)
bool removeName(InputEvent &event)
bool commandLoadPosition(InputEvent &event)
bool selectSkillLevel(InputEvent &event)
bool commandSpawnSlave(InputEvent &event)
bool npcClipboard(InputEvent &event)
bool joinChatRoom(InputEvent &event)
bool testParticle(InputEvent &event)
bool selectSkillType(InputEvent &event)
bool partyExpShare(InputEvent &event)
bool hack(InputEvent &event)
bool commandEmote(InputEvent &event)
bool removeAttack(InputEvent &event)
bool setTarget(InputEvent &event)
bool chatAdd(InputEvent &event)
bool navigateTo(InputEvent &event)
bool commandChangePartyLeader(InputEvent &event)
bool chatNuke(InputEvent &event)
bool confGet(InputEvent &event)
bool playerGmCommands(InputEvent &event)
bool addAttack(InputEvent &event)
bool commandGuildRecall(InputEvent &event)
bool commandSpawnSlaveClone(InputEvent &event)
bool removePickup(InputEvent &event)
bool warp(InputEvent &event)
bool party(InputEvent &event)
static void changeRelation(const InputEvent &event, const RelationT relation, const std::string &relationText)
bool leaveGuild(InputEvent &event)
bool commandGotoNpc(InputEvent &event)
bool dontRemoveName(InputEvent &event)
bool commandPartyRecall(InputEvent &event)
bool chatDisregard(InputEvent &event)
bool move(InputEvent &event)
bool mobSearch(InputEvent &event)
bool itemInfo(InputEvent &event)
bool outfitToChat(InputEvent &event)
bool showSkillType(InputEvent &event)
bool commandDisguise(InputEvent &event)
bool openUrl(InputEvent &event)
bool outfitClear(InputEvent &event)
bool commandNpcShow(InputEvent &event)
bool commandKillable(InputEvent &event)
bool movePriorityAttackUp(InputEvent &event)
bool execute(InputEvent &event)
bool commandHeal(InputEvent &event)
bool movePriorityAttackDown(InputEvent &event)
bool confSet(InputEvent &event)
bool clipboardCopy(InputEvent &event)
bool partyAutoItemShare(InputEvent &event)
bool setSkillOffsetY(InputEvent &event)
bool commandShowInventory(InputEvent &event)
bool navigate(InputEvent &event)
bool leaveChatRoom(InputEvent &event)
bool whoDrops(InputEvent &event)
bool restoreCamera(InputEvent &event)
bool ignorePickup(InputEvent &event)
bool setSkillOffsetX(InputEvent &event)
bool commandRandomWarp(InputEvent &event)
bool homunEmote(InputEvent &event)
bool moveAttackDown(InputEvent &event)
bool commandUnjail(InputEvent &event)
bool addSkillShortcut(InputEvent &event)
bool enableAway(InputEvent &event)
bool chatUnignore(InputEvent &event)
bool chatBlackList(InputEvent &event)
bool serverUnIgnoreWhisper(InputEvent &event)
bool present(InputEvent &event)
bool serverIgnoreWhisper(InputEvent &event)
bool commandShowStorage(InputEvent &event)
bool homunTalk(InputEvent &event)
bool serverConfSet(InputEvent &event)
bool disableAway(InputEvent &event)
bool imitation(InputEvent &event)
bool commandShowCart(InputEvent &event)
bool commandImmortal(InputEvent &event)
bool partyItemShare(InputEvent &event)
bool url(InputEvent &event)
bool follow(InputEvent &event)
bool commandHide(InputEvent &event)
bool commandIpCheck(InputEvent &event)
bool talkRaw(InputEvent &event)
bool setDrop(InputEvent &event)
bool gm(InputEvent &event)
bool chatAnnounce(InputEvent &event)
bool commandSpawn(InputEvent &event)
bool commandNpcHide(InputEvent &event)
bool mailTo(InputEvent &event)
bool commandNuke(InputEvent &event)
bool commandSavePosition(InputEvent &event)
bool commandRecallPc(InputEvent &event)
bool setHomunculusName(InputEvent &event)
bool serverConfGet(InputEvent &event)
bool showSkillLevels(InputEvent &event)
bool addPriorityAttack(InputEvent &event)
bool locatePlayer(InputEvent &event)
bool commandShowStats(InputEvent &event)
bool commandNpcMove(InputEvent &event)
bool slide(InputEvent &event)
static void reportRelation(const InputEvent &event, const RelationT &rel, const std::string &str1, const std::string &str2)
bool commandShowAccountInfo(InputEvent &event)
bool commandAlive(InputEvent &event)
bool showSkillOffsetY(InputEvent &event)
bool printAll(InputEvent &event)
bool info(InputEvent &event)
bool chatEnemy(InputEvent &event)
bool skill(InputEvent &event)
bool trimMemory(InputEvent &event)
void runCommand(const std::string &command, const std::string ¶ms)
bool exists(const int id)
std::string getNamesStr(const std::vector< int > &parts)
ServerTypeT getNetworkType()
HomunculusInfo * getHomunculus()
Net::PartyHandler * partyHandler
Net::ServerFeatures * serverFeatures
Net::NpcHandler * npcHandler
OutfitWindow * outfitWindow
bool splitParameters(StringVect &tokens, std::string text, const std::string &separator, const char quote)
PlayerRelationsManager playerRelations
bool openBrowser(std::string url)
bool execFile(const std::string &pathName, const std::string &name, const std::string &arg1, const std::string &arg2)
ServerType ::T ServerTypeT
ShortcutWindow * itemShortcutWindow
SkillDialog * skillDialog
SocialWindow * socialWindow
void splitToIntVector(std::vector< int > &tokens, const std::string &text, const char separator)
bool parse2Int(const std::string &args, int &x, int &y)
std::string strprintf(const char *const format,...)
bool parse2Str(const std::string &args, std::string &str1, std::string &str2)
void splitToStringVector(StringVect &tokens, const std::string &text, const char separator)
bool findCutFirst(std::string &str1, const std::string &str2)
signed char parseBoolean(const std::string &value)
bool strStartWith(const std::string &str1, const std::string &str2)
std::vector< std::string > StringVect
static ChatObject * findByName(const std::string &name)
const bool TryRemoveColors_true