From 1a7dbe5947e107a8041056d36203c3d748302e82 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 14 Apr 2016 17:44:24 +0300 Subject: Move function PlayerRecv::processPlayerClientCommand into ea namespace. --- src/net/ea/playerrecv.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/net/ea/playerrecv.cpp') 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 -- cgit v1.2.3-70-g09d2