diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-14 17:44:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-14 17:44:24 +0300 |
commit | 1a7dbe5947e107a8041056d36203c3d748302e82 (patch) | |
tree | bca6f3d3bc571ba0ed445f101a120c87ea0cb504 /src/net/ea | |
parent | a31b61144f7420aa7e448b72d7b45a6e6c246255 (diff) | |
download | plus-1a7dbe5947e107a8041056d36203c3d748302e82.tar.gz plus-1a7dbe5947e107a8041056d36203c3d748302e82.tar.bz2 plus-1a7dbe5947e107a8041056d36203c3d748302e82.tar.xz plus-1a7dbe5947e107a8041056d36203c3d748302e82.zip |
Move function PlayerRecv::processPlayerClientCommand into ea namespace.
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/playerrecv.cpp | 19 | ||||
-rw-r--r-- | src/net/ea/playerrecv.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/net/ea/playerrecv.cpp b/src/net/ea/playerrecv.cpp index 466c73063..384f9aa16 100644 --- a/src/net/ea/playerrecv.cpp +++ b/src/net/ea/playerrecv.cpp @@ -37,10 +37,14 @@ #include "gui/windows/statuswindow.h" +#include "input/inputmanager.h" + #include "resources/map/map.h" #include "net/playerhandler.h" +#include "utils/stringutils.h" + #include "debug.h" // Max. distance we are willing to scroll after a teleport; @@ -235,4 +239,19 @@ void PlayerRecv::processMapMask(Net::MessageIn &msg) map->setMask(mask); } +void PlayerRecv::processPlayerClientCommand(Net::MessageIn &msg) +{ + const int sz = msg.readInt16("len") - 4; + std::string command = msg.readString(sz, "command"); + std::string cmd; + std::string args; + + if (!parse2Str(command, cmd, args)) + { + cmd = command; + args.clear(); + } + inputManager.executeRemoteChatCommand(cmd, args, nullptr); +} + } // namespace Ea diff --git a/src/net/ea/playerrecv.h b/src/net/ea/playerrecv.h index 4c800d13b..e87a04ff9 100644 --- a/src/net/ea/playerrecv.h +++ b/src/net/ea/playerrecv.h @@ -41,6 +41,7 @@ namespace Ea void processPlayerStatUpdate4(Net::MessageIn &msg); void processPlayerStatUpdate6(Net::MessageIn &msg); void processPlayerArrowMessage(Net::MessageIn &msg); + void processPlayerClientCommand(Net::MessageIn &msg); void processMapMusic(Net::MessageIn &msg); void processMapMask(Net::MessageIn &msg); } // namespace PlayerRecv |