summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/actions.cpp22
-rw-r--r--src/actions/actions.h1
2 files changed, 23 insertions, 0 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index e689db941..bd8431b31 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -66,6 +66,7 @@
#include "render/normalopenglgraphics.h"
#endif
+#include "net/adminhandler.h"
#include "net/beinghandler.h"
#include "net/buysellhandler.h"
#include "net/chathandler.h"
@@ -1509,4 +1510,25 @@ impHandler(unprotectItem)
return true;
}
+impHandler(kick)
+{
+ if (!localPlayer || !actorManager)
+ return false;
+
+ Being *target = nullptr;
+ std::string args = event.args;
+ if (!args.empty())
+ {
+ if (args[0] != ':')
+ target = actorManager->findNearestByName(args);
+ else
+ target = actorManager->findBeing(atoi(args.substr(1).c_str()));
+ }
+ if (!target)
+ target = localPlayer->getTarget();
+ if (target)
+ adminHandler->kick(target->getId());
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/actions.h b/src/actions/actions.h
index cbd7489f3..922d32d12 100644
--- a/src/actions/actions.h
+++ b/src/actions/actions.h
@@ -103,6 +103,7 @@ namespace Actions
decHandler(storageToInv);
decHandler(protectItem);
decHandler(unprotectItem);
+ decHandler(kick);
} // namespace Actions
#undef decHandler