summaryrefslogtreecommitdiff
path: root/src/commandhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r--src/commandhandler.cpp120
1 files changed, 6 insertions, 114 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp
index dc962a17d..189485461 100644
--- a/src/commandhandler.cpp
+++ b/src/commandhandler.cpp
@@ -87,221 +87,113 @@ void CommandHandler::handleCommand(const std::string &command, ChatTab *tab)
args = trim(args);
if (command == "closeall")
- {
handleCloseAll(args, tab);
- }
else if (type == "ignoreall")
- {
handleIgnoreAll(args, tab);
- }
else if (type == "help") // Do help before tabs so they can't override it
- {
handleHelp(args, tab);
- }
else if (type == "announce")
- {
handleAnnounce(args, tab);
- }
else if (type == "where")
- {
handleWhere(args, tab);
- }
else if (type == "who")
- {
handleWho(args, tab);
- }
else if (type == "msg" || type == "whisper" || type == "w")
- {
handleMsg(args, tab);
- }
else if (type == "query" || type == "q")
- {
handleQuery(args, tab);
- }
else if (type == "ignore")
- {
handleIgnore(args, tab);
- }
else if (type == "unignore")
- {
handleUnignore(args, tab);
- }
else if (type == "friend" || type == "befriend")
- {
handleFriend(args, tab);
- }
else if (type == "disregard")
- {
handleDisregard(args, tab);
- }
else if (type == "neutral")
- {
handleNeutral(args, tab);
- }
else if (type == "erase")
- {
handleErase(args, tab);
- }
else if (type == "join")
- {
handleJoin(args, tab);
- }
else if (type == "list")
- {
handleListChannels(args, tab);
- }
else if (type == "clear")
- {
handleClear(args, tab);
- }
else if (type == "createparty")
- {
handleCreateParty(args, tab);
- }
else if (type == "createguild")
- {
handleCreateGuild(args, tab);
- }
else if (type == "party")
- {
handleParty(args, tab);
- }
else if (type == "me")
- {
handleMe(args, tab);
- }
else if (type == "toggle")
- {
handleToggle(args, tab);
- }
else if (type == "present")
- {
handlePresent(args, tab);
- }
else if (type == "quit")
- {
handleQuit(args, tab);
- }
else if (type == "all")
- {
handleShowAll(args, tab);
- }
else if (type == "move")
- {
handleMove(args, tab);
- }
else if (type == "target")
- {
handleTarget(args, tab);
- }
else if (type == "outfit")
- {
handleOutfit(args, tab);
- }
else if (type == "emote")
- {
handleEmote(args, tab);
- }
else if (type == "away")
- {
handleAway(args, tab);
- }
else if (type == "follow")
- {
handleFollow(args, tab);
- }
else if (type == "heal")
- {
handleHeal(args, tab);
- }
else if (type == "navigate")
- {
handleNavigate(args, tab);
- }
else if (type == "imitation")
- {
handleImitation(args, tab);
- }
else if (type == "mail")
- {
handleMail(args, tab);
- }
else if (type == "trade")
- {
handleTrade(args, tab);
- }
else if (type == "priceload")
- {
handlePriceLoad(args, tab);
- }
else if (type == "pricesave")
- {
handlePriceSave(args, tab);
- }
else if (type == "cacheinfo")
- {
handleCacheInfo(args, tab);
- }
else if (type == "disconnect")
- {
handleDisconnect(args, tab);
- }
else if (type == "undress")
- {
handleUndress(args, tab);
- }
else if (type == "attack")
- {
handleAttack(args, tab);
- }
else if (type == "dirs")
- {
handleDirs(args, tab);
- }
else if (type == "info")
- {
handleInfo(args, tab);
- }
else if (type == "wait")
- {
handleWait(args, tab);
- }
else if (type == "uptime")
- {
handleUptime(args, tab);
- }
else if (type == "addpriorityattack")
- {
handleAddPriorityAttack(args, tab);
- }
else if (type == "addattack")
- {
handleAddAttack(args, tab);
- }
else if (type == "removeattack" || type == "removeignoreattack")
- {
handleRemoveAttack(args, tab);
- }
else if (type == "addignoreattack")
- {
handleAddIgnoreAttack(args, tab);
- }
else if (type == "dump")
- {
handleDump(args, tab);
- }
else if (tab->handleCommand(type, args))
- {
- // Nothing to do
- }
+ ;
else if (type == "hack")
- {
handleHack(args, tab);
- }
else
- {
tab->chatLog(_("Unknown command."));
- }
}
char CommandHandler::parseBoolean(const std::string &value)
@@ -355,8 +247,8 @@ void CommandHandler::handleWho(const std::string &args A_UNUSED,
void CommandHandler::handleMsg(const std::string &args, ChatTab *tab)
{
- std::string recvnick = "";
- std::string msg = "";
+ std::string recvnick("");
+ std::string msg("");
if (args.substr(0, 1) == "\"")
{
@@ -397,7 +289,7 @@ void CommandHandler::handleMsg(const std::string &args, ChatTab *tab)
if (tempNick.compare(playerName) == 0 || args.empty())
return;
- chatWindow->whisper(recvnick, msg, BY_PLAYER);
+ chatWindow->addWhisper(recvnick, msg, BY_PLAYER);
}
else
tab->chatLog(_("Cannot send empty whispers!"), BY_SERVER);
@@ -851,11 +743,11 @@ void CommandHandler::handleHeal(const std::string &args, ChatTab *tab A_UNUSED)
Being *being = actorSpriteManager->findBeingByName(
args, Being::PLAYER);
if (being)
- actorSpriteManager->heal(player_node, being);
+ actorSpriteManager->heal(being);
}
else
{
- actorSpriteManager->heal(player_node, player_node);
+ actorSpriteManager->heal(player_node);
}
}