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 +++++++++++++++++++ src/net/ea/playerrecv.h | 1 + src/net/eathena/packetsin.inc | 2 +- src/net/eathena/playerrecv.cpp | 15 --------------- src/net/eathena/playerrecv.h | 1 - 5 files changed, 21 insertions(+), 17 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 diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index b1691a82e..bba0e64e7 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -792,7 +792,7 @@ if (serverVersion > 0) packet(SMSG_BEING_ATTRS, 0x0b0a, -1, &BeingRecv::processBeingAttrs, 0); packet(SMSG_NPC_AREA, 0x0b0b, -1, &NpcRecv::processArea, 0); packet(SMSG_ONLINE_LIST, 0x0b10, -1, &PlayerRecv::processOnlineList, 0); - packet(SMSG_PLAYER_CLIENT_COMMAND, 0x0b16, -1, &PlayerRecv::processPlayerClientCommand, 0); + packet(SMSG_PLAYER_CLIENT_COMMAND, 0x0b16, -1, &Ea::PlayerRecv::processPlayerClientCommand, 0); packet(SMSG_BEING_CHANGE_LOOKS_CARDS, 0x0b17, 19, &BeingRecv::processBeingChangeLookCards, 0); packet(SMSG_ITEM_VISIBLE2, 0x0b18, 28, &ItemRecv::processItemVisible2, 0); packet(SMSG_ITEM_DROPPED2, 0x0b19, 28, &ItemRecv::processItemDropped2, 0); diff --git a/src/net/eathena/playerrecv.cpp b/src/net/eathena/playerrecv.cpp index e46eceab9..9db414edb 100644 --- a/src/net/eathena/playerrecv.cpp +++ b/src/net/eathena/playerrecv.cpp @@ -365,21 +365,6 @@ void PlayerRecv::processPlayerRankPoints(Net::MessageIn &msg) msg.readInt32("fame"); } -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); -} - void PlayerRecv::processOnlineList(Net::MessageIn &msg) { if (!whoIsOnline) diff --git a/src/net/eathena/playerrecv.h b/src/net/eathena/playerrecv.h index e6ef1f776..22cb57822 100644 --- a/src/net/eathena/playerrecv.h +++ b/src/net/eathena/playerrecv.h @@ -49,7 +49,6 @@ namespace EAthena void processPlayerEquipTickAck(Net::MessageIn &msg); void processPlayerAutoShadowSpellList(Net::MessageIn &msg); void processPlayerRankPoints(Net::MessageIn &msg); - void processPlayerClientCommand(Net::MessageIn &msg); void processOnlineList(Net::MessageIn &msg); void processDressRoomOpen(Net::MessageIn &msg); } // namespace PlayerRecv -- cgit v1.2.3-70-g09d2