summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-07-11 20:49:20 +0300
committerAndrei Karas <akaras@inbox.ru>2013-07-11 20:52:50 +0300
commite36c735ce6569cd9c0e668632e59bcbe3280d507 (patch)
treeeb8fa3f8800d95bcd0c6b3c1ea314567f56debb4 /src/net
parentffd452cd1ee7d252355c259ca2bae1d40c0e97e9 (diff)
downloadplus-e36c735ce6569cd9c0e668632e59bcbe3280d507.tar.gz
plus-e36c735ce6569cd9c0e668632e59bcbe3280d507.tar.bz2
plus-e36c735ce6569cd9c0e668632e59bcbe3280d507.tar.xz
plus-e36c735ce6569cd9c0e668632e59bcbe3280d507.zip
Add chat command for gms for creating items.
New command: /createitems It will open creation window.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/adminhandler.h3
-rw-r--r--src/net/ea/adminhandler.cpp16
-rw-r--r--src/net/ea/adminhandler.h3
3 files changed, 22 insertions, 0 deletions
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h
index eca8ef4d0..7178aacae 100644
--- a/src/net/adminhandler.h
+++ b/src/net/adminhandler.h
@@ -58,6 +58,9 @@ class AdminHandler
virtual void warp(const std::string &map,
const int x, const int y) const = 0;
+
+ virtual void createItems(const int id, const int color,
+ const int amount) = 0;
};
} // namespace Net
diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp
index 0d2245330..9e1956edd 100644
--- a/src/net/ea/adminhandler.cpp
+++ b/src/net/ea/adminhandler.cpp
@@ -28,6 +28,8 @@
#include "debug.h"
+extern int serverVersion;
+
namespace Ea
{
@@ -70,4 +72,18 @@ void AdminHandler::warp(const std::string &map, const int x, const int y) const
"@warp %s %d %d", map.c_str(), x, y), GENERAL_CHANNEL);
}
+void AdminHandler::createItems(const int id, const int color, const int amount)
+{
+ if (serverVersion < 1)
+ {
+ Net::getChatHandler()->talk(strprintf("@item %d %d",
+ id, amount), GENERAL_CHANNEL);
+ }
+ else
+ {
+ Net::getChatHandler()->talk(strprintf("@item %d %d %d",
+ id, color, amount), GENERAL_CHANNEL);
+ }
+}
+
} // namespace Ea
diff --git a/src/net/ea/adminhandler.h b/src/net/ea/adminhandler.h
index 7112bb75d..fb0ddfd0c 100644
--- a/src/net/ea/adminhandler.h
+++ b/src/net/ea/adminhandler.h
@@ -55,6 +55,9 @@ class AdminHandler : public Net::AdminHandler
virtual void warp(const std::string &map,
const int x, const int y) const override;
+
+ void createItems(const int id, const int color,
+ const int amount);
};
} // namespace Ea