diff options
| author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-29 08:43:50 +0000 |
|---|---|---|
| committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-29 08:43:50 +0000 |
| commit | d9ae86e09977082791d5b24e304eabc5456ab4cf (patch) | |
| tree | 655700119e723d637144b57de6f177d331dc4bb6 /src/game-server/command.cpp | |
| parent | a8dc1f23ab7eff1f6c4e59d11446e80ad6780d33 (diff) | |
| download | manaserv-d9ae86e09977082791d5b24e304eabc5456ab4cf.tar.gz manaserv-d9ae86e09977082791d5b24e304eabc5456ab4cf.tar.xz manaserv-d9ae86e09977082791d5b24e304eabc5456ab4cf.zip | |
Completed handler for admin commands, so that they can also touch local players.
Diffstat (limited to 'src/game-server/command.cpp')
| -rw-r--r-- | src/game-server/command.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
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; |
