diff options
author | megamage <none@none> | 2009-05-17 10:57:55 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-05-17 10:57:55 -0500 |
commit | 3569f949d7ea0cd5c0acb6a5caf29b8990847071 (patch) | |
tree | afcf983debdebf69e307864c3372ff53435dd350 /src/game/Chat.h | |
parent | d2ef2c0500e86bc966b2d71bbd00acea0e924e41 (diff) |
[7839] Rafactoring player targeting code in chat command and related cleanups/improvments.
* New extractOptFirstArg function for easy get 2 args in case option playe name as first arg.
* New extractPlayerTarget function for get player pointer/guid/name for online/offline player base at provided name
or if not provided by current seelction with error cases processing.
* Property apply mute/unmute in case use different character name from loggined currently for account.
* .reset commands can be used from console now
* .repairitems comamnd can be used from console now but only to online player.
Author: VladimirMangos
--HG--
branch : trunk
Diffstat (limited to 'src/game/Chat.h')
-rw-r--r-- | src/game/Chat.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/game/Chat.h b/src/game/Chat.h index 97570d2f250..fe0e197ee4b 100644 --- a/src/game/Chat.h +++ b/src/game/Chat.h @@ -560,11 +560,16 @@ class ChatHandler char* extractKeyFromLink(char* text, char const* linkType, char** something1 = NULL); char* extractKeyFromLink(char* text, char const* const* linkTypes, int* found_idx, char** something1 = NULL); + // if args have single value then it return in arg2 and arg1 == NULL + void extractOptFirstArg(char* args, char** arg1, char** arg2); + uint32 extractSpellIdFromLink(char* text); uint64 extractGuidFromLink(char* text); GameTele const* extractGameTeleFromLink(char* text); bool GetPlayerGroupAndGUIDByName(const char* cname, Player* &plr, Group* &group, uint64 &guid, bool offline = false); std::string extractPlayerNameFromLink(char* text); + // select by arg (name/link) or in-game selection online/offline player + bool extractPlayerTarget(char* args, Player** player, uint64* player_guid = NULL, std::string* player_name = NULL); std::string playerLink(std::string const& name) const { return m_session ? "|cffffffff|Hplayer:"+name+"|h["+name+"]|h|r" : name; } virtual std::string GetNameLink() const { return GetNameLink(m_session->GetPlayer()); } |