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

#include <ChatLink.h>

Public Member Functions

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

Private Attributes

uint32 _slotId
 
GlyphPropertiesEntry const_glyph
 

Additional Inherited Members

Constructor & Destructor Documentation

GlyphChatLink::GlyphChatLink ( )
inline
157 : SpellChatLink(), _slotId(0), _glyph(NULL) { }
arena_t NULL
Definition: jemalloc_internal.h:624

Member Function Documentation

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

Reimplemented from SpellChatLink.

546 {
548  return false;
549  // Slot
550  if (!ReadUInt32(iss, _slotId))
551  {
552  TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading slot id", iss.str().c_str());
553  return false;
554  }
555  // Check delimiter
556  if (!CheckDelimiter(iss, DELIMITER, "glyph"))
557  return false;
558  // Glyph Id
559  uint32 glyphId = 0;
560  if (!ReadUInt32(iss, glyphId))
561  {
562  TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading glyph entry", iss.str().c_str());
563  return false;
564  }
565  // Validate glyph
566  _glyph = sGlyphPropertiesStore.LookupEntry(glyphId);
567  if (!_glyph)
568  {
569  TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): got invalid glyph id %u in |glyph command", iss.str().c_str(), glyphId);
570  return false;
571  }
572  // Validate glyph's spell
573  _spell = sSpellMgr->GetSpellInfo(_glyph->SpellID);
574  if (!_spell)
575  {
576  TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |glyph command", iss.str().c_str(), _glyph->SpellID);
577  return false;
578  }
579  return true;
580 }
#define TC_LOG_TRACE(filterType__,...)
Definition: Log.h:195
uint32 SpellID
Definition: DBCStructure.h:512
#define sSpellMgr
Definition: SpellMgr.h:756
uint32_t uint32
Definition: Define.h:150
DBCStorage< GlyphPropertiesEntry > sGlyphPropertiesStore(GlyphPropertiesfmt)
Definition: SharedDefines.h:4324

+ Here is the call graph for this function:

Member Data Documentation

GlyphPropertiesEntry const* GlyphChatLink::_glyph
private
uint32 GlyphChatLink::_slotId
private

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