From d9ae86e09977082791d5b24e304eabc5456ab4cf Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Wed, 29 Aug 2007 08:43:50 +0000 Subject: Completed handler for admin commands, so that they can also touch local players. --- src/game-server/command.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/game-server/command.cpp') diff --git a/src/game-server/command.cpp b/src/game-server/command.cpp index d4327c3..9420743 100644 --- a/src/game-server/command.cpp +++ b/src/game-server/command.cpp @@ -25,6 +25,7 @@ #include "defines.h" #include "game-server/character.hpp" +#include "game-server/gamehandler.hpp" #include "game-server/inventory.hpp" #include "game-server/item.hpp" #include "game-server/itemmanager.hpp" @@ -269,8 +270,19 @@ void runCommand(Character *ch, std::string const &text) } else { - // TODO: explicitly named character. - return; + GameClient *c = gameHandler->getClientByNameSlow(arg); + if (!c) + { + /* TODO: forward command to other game servers through + account server, in case the player is elsewhere. */ + return; + } + if (c->status != CLIENT_CONNECTED) + { + // No suitable character. + return; + } + args[i] = (intptr_t)c->character; } break; -- cgit