diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-16 18:40:43 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-11-16 18:40:43 +0300 |
commit | b753348ab7153282e6cf539c627dfd1fb9896c42 (patch) | |
tree | 5f3341189b7ee51885a9fdab213cd6796989296d /src | |
parent | 81218a9140a81d165a6f03c31f580a2af63ec041 (diff) | |
download | plus-b753348ab7153282e6cf539c627dfd1fb9896c42.tar.gz plus-b753348ab7153282e6cf539c627dfd1fb9896c42.tar.bz2 plus-b753348ab7153282e6cf539c627dfd1fb9896c42.tar.xz plus-b753348ab7153282e6cf539c627dfd1fb9896c42.zip |
Add slide function in adminhandler.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/adminhandler.h | 2 | ||||
-rw-r--r-- | src/net/ea/adminhandler.cpp | 16 | ||||
-rw-r--r-- | src/net/ea/adminhandler.h | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h index 328290ea8..ea3acb695 100644 --- a/src/net/adminhandler.h +++ b/src/net/adminhandler.h @@ -70,6 +70,8 @@ class AdminHandler notfinal virtual void warp(const std::string &map, const int x, const int y) const = 0; + virtual void slide(const int x, const int y) const = 0; + virtual void createItems(const int id, const ItemColor color, const int amount) const = 0; diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp index 6815164c4..bccd2062d 100644 --- a/src/net/ea/adminhandler.cpp +++ b/src/net/ea/adminhandler.cpp @@ -22,9 +22,12 @@ #include "net/ea/adminhandler.h" +#include "game.h" + #include "gui/chatconsts.h" #include "net/chathandler.h" +#include "net/serverfeatures.h" #include "utils/stringutils.h" @@ -76,4 +79,17 @@ void AdminHandler::createItems(const int id, GENERAL_CHANNEL); } +void AdminHandler::slide(const int x, const int y) const +{ + if (serverFeatures->haveSlide()) + { + chatHandler->talk(strprintf("@slide %d %d", x, y), + GENERAL_CHANNEL); + } + else + { + warp(Game::instance()->getCurrentMapName(), x, y); + } +} + } // namespace Ea diff --git a/src/net/ea/adminhandler.h b/src/net/ea/adminhandler.h index 9849f4e31..c73fbafde 100644 --- a/src/net/ea/adminhandler.h +++ b/src/net/ea/adminhandler.h @@ -55,6 +55,8 @@ class AdminHandler notfinal : public Net::AdminHandler void ipcheckName(const std::string &name) const override final; + void slide(const int x, const int y) const override final; + void createItems(const int id, const ItemColor color, const int amount) const override final; |