TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TalentChatLink Class Reference

#include <ChatLink.h>

Public Member Functions

 TalentChatLink ()
 
virtual bool Initialize (std::istringstream &iss) override
 

Private Attributes

uint32 _talentId
 
int32 _rankId
 

Additional Inherited Members

Constructor & Destructor Documentation

TalentChatLink::TalentChatLink ( )
inline
137 : SpellChatLink(), _talentId(0), _rankId(0) { }

Member Function Documentation

bool TalentChatLink::Initialize ( std::istringstream &  iss)
overridevirtual

Reimplemented from SpellChatLink.

485 {
487  return false;
488  // Read talent entry
489  if (!ReadUInt32(iss, _talentId))
490  {
491  TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading talent entry", iss.str().c_str());
492  return false;
493  }
494  // Validate talent
495  TalentEntry const* talentInfo = sTalentStore.LookupEntry(_talentId);
496  if (!talentInfo)
497  {
498  TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): got invalid talent id %u in |talent command", iss.str().c_str(), _talentId);
499  return false;
500  }
501  // Validate talent's spell
502  _spell = sSpellMgr->GetSpellInfo(talentInfo->SpellID);
503  if (!_spell)
504  {
505  TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |trade command", iss.str().c_str(), talentInfo->SpellID);
506  return false;
507  }
508  // Delimiter
509  if (!CheckDelimiter(iss, DELIMITER, "talent"))
510  return false;
511  // Rank
512  if (!ReadInt32(iss, _rankId))
513  {
514  TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading talent rank", iss.str().c_str());
515  return false;
516  }
517  return true;
518 }
#define TC_LOG_TRACE(filterType__,...)
Definition: Log.h:195
#define sSpellMgr
Definition: SpellMgr.h:756
DBCStorage< TalentEntry > sTalentStore(Talentfmt)
Definition: SharedDefines.h:4320
Definition: DBCStructure.h:1255
uint32 SpellID
Definition: DBCStructure.h:1261

+ Here is the call graph for this function:

Member Data Documentation

int32 TalentChatLink::_rankId
private
uint32 TalentChatLink::_talentId
private

The documentation for this class was generated from the following files: