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

#include <ChatLink.h>

Public Member Functions

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

Private Attributes

int32 _minSkillLevel
 
int32 _maxSkillLevel
 
uint32 _guid
 
std::string _base64
 

Additional Inherited Members

Constructor & Destructor Documentation

TradeChatLink::TradeChatLink ( )
inline

Member Function Documentation

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

Reimplemented from SpellChatLink.

433 {
435  return false;
436  // Spell Id
437  uint32 spellId = 0;
438  if (!ReadUInt32(iss, spellId))
439  {
440  TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement entry", iss.str().c_str());
441  return false;
442  }
443  // Validate spell
444  _spell = sSpellMgr->GetSpellInfo(spellId);
445  if (!_spell)
446  {
447  TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |trade command", iss.str().c_str(), spellId);
448  return false;
449  }
450  // Check delimiter
451  if (!CheckDelimiter(iss, DELIMITER, "trade"))
452  return false;
453  // Minimum talent level
454  if (!ReadInt32(iss, _minSkillLevel))
455  {
456  TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading minimum talent level", iss.str().c_str());
457  return false;
458  }
459  // Check delimiter
460  if (!CheckDelimiter(iss, DELIMITER, "trade"))
461  return false;
462  // Maximum talent level
463  if (!ReadInt32(iss, _maxSkillLevel))
464  {
465  TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading maximum talent level", iss.str().c_str());
466  return false;
467  }
468  // Check delimiter
469  if (!CheckDelimiter(iss, DELIMITER, "trade"))
470  return false;
471  // Something hexadecimal
472  if (!ReadHex(iss, _guid, 0))
473  {
474  TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement's owner guid", iss.str().c_str());
475  return false;
476  }
477  // Skip base64 encoded stuff
478  _base64 = ReadSkip(iss, PIPE_CHAR);
479  return true;
480 }
#define TC_LOG_TRACE(filterType__,...)
Definition: Log.h:195
#define sSpellMgr
Definition: SpellMgr.h:756
uint32_t uint32
Definition: Define.h:150
Definition: SharedDefines.h:4319

+ Here is the call graph for this function:

Member Data Documentation

std::string TradeChatLink::_base64
private
uint32 TradeChatLink::_guid
private
int32 TradeChatLink::_maxSkillLevel
private
int32 TradeChatLink::_minSkillLevel
private

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