summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-25 23:04:04 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-25 23:04:04 +0300
commit3711139801743b0bcc20384e35903a4581fe6b7a (patch)
treea5724d505ae2cf297229832e994849d02278c9ae
parentee82a8e3ca61d176e52078f8326d92e2220af2d0 (diff)
downloadmv-3711139801743b0bcc20384e35903a4581fe6b7a.tar.gz
mv-3711139801743b0bcc20384e35903a4581fe6b7a.tar.bz2
mv-3711139801743b0bcc20384e35903a4581fe6b7a.tar.xz
mv-3711139801743b0bcc20384e35903a4581fe6b7a.zip
Add chat command for check player ip.
-rw-r--r--src/actions/commands.cpp9
-rw-r--r--src/actions/commands.h1
-rw-r--r--src/dyetool/actions/commands.cpp1
-rw-r--r--src/enums/input/inputaction.h1
-rw-r--r--src/gui/popups/popupmenu.cpp6
-rw-r--r--src/input/inputactionmap.h6
6 files changed, 19 insertions, 5 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 81f40697b..53c1f4fd0 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -1456,6 +1456,15 @@ impHandler(commandRecallPc)
return true;
}
+impHandler(commandIpCheck)
+{
+ const std::string args = event.args;
+ if (args.empty())
+ return false;
+ adminHandler->ipcheckName(args);
+ return true;
+}
+
impHandler(commandKiller)
{
adminHandler->killer(event.args);
diff --git a/src/actions/commands.h b/src/actions/commands.h
index 24860b8f2..5d6e7ce58 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -125,6 +125,7 @@ namespace Actions
decHandler(commandGotoNpc);
decHandler(commandGotoPc);
decHandler(commandRecallPc);
+ decHandler(commandIpCheck);
decHandler(commandKiller);
decHandler(commandKillable);
decHandler(commandHeal);
diff --git a/src/dyetool/actions/commands.cpp b/src/dyetool/actions/commands.cpp
index e458d494e..9c998f23a 100644
--- a/src/dyetool/actions/commands.cpp
+++ b/src/dyetool/actions/commands.cpp
@@ -125,6 +125,7 @@ impHandlerVoid(commandRandomWarp)
impHandlerVoid(commandGotoNpc)
impHandlerVoid(commandGotoPc)
impHandlerVoid(commandRecallPc)
+impHandlerVoid(commandIpCheck)
impHandlerVoid(commandKiller)
impHandlerVoid(commandKillable)
impHandlerVoid(commandHeal)
diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h
index 21749b296..101041992 100644
--- a/src/enums/input/inputaction.h
+++ b/src/enums/input/inputaction.h
@@ -699,6 +699,7 @@ enumStart(InputAction)
CLIPBOARD_COPY,
COMMAND_GOTO_PC,
COMMAND_RECALL_PC,
+ COMMAND_IP_CHECK,
TOTAL
}
enumEnd(InputAction);
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index da729206c..6c359b5ff 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -1253,10 +1253,6 @@ void PopupMenu::handleLink(const std::string &link,
if (mTextField)
mTextField->handlePaste();
}
- else if (link == "ipcheck" && !mName.empty())
- {
- adminHandler->ipcheckName(mName);
- }
else if (link == "gm" && !mName.empty())
{
showGMPopup(mName);
@@ -2800,7 +2796,7 @@ void PopupMenu::showPlayerGMCommands(const std::string &name)
{
// TRANSLATORS: popup menu item
// TRANSLATORS: check player ip
- mBrowserBox->addRow("ipcheck", _("Check ip"));
+ mBrowserBox->addRow("/ipcheck 'NAME'", _("Check ip"));
}
// TRANSLATORS: popup menu item
// TRANSLATORS: go to player position
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 203d3067d..d593011b0 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -5684,6 +5684,12 @@ static const InputActionData inputActionData
"recall|recallpc",
UseArgs_true,
Protected_true},
+ {"keyCommandIpCheck",
+ defaultAction(&Actions::commandIpCheck),
+ InputCondition::INGAME,
+ "ipcheck|checkip",
+ UseArgs_true,
+ Protected_true},
};
#undef defaultAction