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

#include <SupportMgr.h>

Public Member Functions

 BugTicket ()
 
 BugTicket (Player *player)
 
 ~BugTicket ()
 
std::string constGetNote () const
 
void SetFacing (float facing)
 
void SetNote (std::string const &note)
 
void LoadFromDB (Field *fields) override
 
void SaveToDB () const override
 
void DeleteFromDB () override
 
std::string FormatViewMessageString (ChatHandler &handler, bool detailed=false) const override
 
- Public Member Functions inherited from Ticket
 Ticket ()
 
 Ticket (Player *player)
 
virtual ~Ticket ()
 
bool IsClosed () const
 
bool IsFromPlayer (ObjectGuid guid) const
 
bool IsAssigned () const
 
bool IsAssignedTo (ObjectGuid guid) const
 
bool IsAssignedNotTo (ObjectGuid guid) const
 
uint32 GetId () const
 
ObjectGuid GetPlayerGuid () const
 
PlayerGetPlayer () const
 
std::string GetPlayerName () const
 
PlayerGetAssignedPlayer () const
 
ObjectGuid GetAssignedToGUID () const
 
std::string GetAssignedToName () const
 
std::string constGetComment () const
 
virtual void SetAssignedTo (ObjectGuid guid, bool=false)
 
virtual void SetUnassigned ()
 
void SetClosedBy (ObjectGuid value)
 
void SetComment (std::string const &comment)
 
void SetPosition (uint32 mapId, G3D::Vector3 &pos)
 
void TeleportTo (Player *player) const
 
virtual std::string FormatViewMessageString (ChatHandler &handler, const char *szClosedName, const char *szAssignedToName, const char *szUnassignedName, const char *szDeletedName) const
 

Private Attributes

float _facing
 
std::string _note
 

Additional Inherited Members

- Protected Attributes inherited from Ticket
uint32 _id
 
ObjectGuid _playerGuid
 
uint16 _mapId
 
G3D::Vector3 _pos
 
uint64 _createTime
 
ObjectGuid _closedBy
 
ObjectGuid _assignedTo
 
std::string _comment
 

Constructor & Destructor Documentation

BugTicket::BugTicket ( )
54 : _facing(0.0f) { }
float _facing
Definition: SupportMgr.h:139
BugTicket::BugTicket ( Player player)
56  : Ticket(player), _facing(0.0f)
57 {
58  _id = sSupportMgr->GenerateBugId();
59 }
uint32 _id
Definition: SupportMgr.h:109
float _facing
Definition: SupportMgr.h:139
Ticket()
Definition: SupportMgr.cpp:24
#define sSupportMgr
Definition: SupportMgr.h:296
BugTicket::~BugTicket ( )
61 { }

Member Function Documentation

void BugTicket::DeleteFromDB ( )
overridevirtual

Implements Ticket.

113 {
115  stmt->setUInt32(0, _id);
117 }
void Execute(const char *sql)
Definition: DatabaseWorkerPool.h:87
uint32 _id
Definition: SupportMgr.h:109
Definition: PreparedStatement.h:74
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
Definition: CharacterDatabase.h:302

+ Here is the call graph for this function:

std::string BugTicket::FormatViewMessageString ( ChatHandler handler,
bool  detailed = false 
) const
overridevirtual

Implements Ticket.

120 {
121  time_t curTime = time(nullptr);
122 
123  std::stringstream ss;
126  ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTAGECREATE, (secsToTimeString(curTime - _createTime, true, false)).c_str());
127 
128  if (!_assignedTo.IsEmpty())
130 
131  if (detailed)
132  {
133  ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTMESSAGE, _note.c_str());
134  if (!_comment.empty())
136  }
137  return ss.str();
138 }
Definition: Language.h:1054
uint32 _id
Definition: SupportMgr.h:109
std::string secsToTimeString(uint64 timeInSecs, bool shortText, bool hoursOnly)
Definition: Util.cpp:109
std::string PGetParseString(uint32 entry, Args &&...args) const
Definition: Chat.h:84
ObjectGuid _assignedTo
Definition: SupportMgr.h:115
Definition: Language.h:1058
std::string GetPlayerName() const
Definition: SupportMgr.h:69
uint64 _createTime
Definition: SupportMgr.h:113
Definition: Language.h:1060
std::string _comment
Definition: SupportMgr.h:116
Definition: Language.h:1057
std::string _note
Definition: SupportMgr.h:140
Definition: Language.h:1055
Definition: Language.h:1053
bool IsEmpty() const
Definition: ObjectGuid.h:242
std::string GetAssignedToName() const
Definition: SupportMgr.h:79

+ Here is the call graph for this function:

std::string const& BugTicket::GetNote ( ) const
inline
126 { return _note; }
std::string _note
Definition: SupportMgr.h:140
void BugTicket::LoadFromDB ( Field fields)
overridevirtual

Implements Ticket.

64 {
65  uint8 idx = 0;
66  _id = fields[ idx].GetUInt32();
67  _playerGuid = ObjectGuid::Create<HighGuid::Player>(fields[++idx].GetUInt64());
68  _note = fields[++idx].GetString();
69  _createTime = fields[++idx].GetUInt32();
70  _mapId = fields[++idx].GetUInt16();
71  _pos.x = fields[++idx].GetFloat();
72  _pos.y = fields[++idx].GetFloat();
73  _pos.z = fields[++idx].GetFloat();
74  _facing = fields[++idx].GetFloat();
75 
76  int64 closedBy = fields[++idx].GetInt64();
77  if (closedBy == 0)
79  else if (closedBy < 0)
80  _closedBy.SetRawValue(0, uint64(closedBy));
81  else
82  _closedBy = ObjectGuid::Create<HighGuid::Player>(uint64(closedBy));
83 
84  uint64 assignedTo = fields[++idx].GetUInt64();
85  if (assignedTo == 0)
87  else
88  _assignedTo = ObjectGuid::Create<HighGuid::Player>(assignedTo);
89 
90  _comment = fields[++idx].GetString();
91 }
uint32 _id
Definition: SupportMgr.h:109
float x
Definition: Vector3.h:62
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
uint64 GetUInt64() const
Definition: Field.h:184
float GetFloat() const
Definition: Field.h:222
int64_t int64
Definition: Define.h:145
ObjectGuid _closedBy
Definition: SupportMgr.h:114
int64 GetInt64() const
Definition: Field.h:203
uint64_t uint64
Definition: g3dmath.h:170
ObjectGuid _assignedTo
Definition: SupportMgr.h:115
float y
Definition: Vector3.h:62
float _facing
Definition: SupportMgr.h:139
uint64 _createTime
Definition: SupportMgr.h:113
void SetRawValue(std::vector< uint8 > const &guid)
Definition: ObjectGuid.cpp:134
uint64_t uint64
Definition: Define.h:149
uint16 _mapId
Definition: SupportMgr.h:111
ObjectGuid _playerGuid
Definition: SupportMgr.h:110
uint16 GetUInt16() const
Definition: Field.h:108
std::string _comment
Definition: SupportMgr.h:116
float z
Definition: Vector3.h:62
uint32 GetUInt32() const
Definition: Field.h:146
uint8_t uint8
Definition: Define.h:152
std::string _note
Definition: SupportMgr.h:140
std::string GetString() const
Definition: Field.h:276
G3D::Vector3 _pos
Definition: SupportMgr.h:112

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BugTicket::SaveToDB ( ) const
overridevirtual

Implements Ticket.

94 {
95  uint8 idx = 0;
97  stmt->setUInt32(idx, _id);
98  stmt->setUInt64(++idx, _playerGuid.GetCounter());
99  stmt->setString(++idx, _note);
100  stmt->setUInt16(++idx, _mapId);
101  stmt->setFloat(++idx, _pos.x);
102  stmt->setFloat(++idx, _pos.y);
103  stmt->setFloat(++idx, _pos.z);
104  stmt->setFloat(++idx, _facing);
105  stmt->setInt64(++idx, _closedBy.GetCounter());
106  stmt->setUInt64(++idx, _assignedTo.GetCounter());
107  stmt->setString(++idx, _comment);
108 
110 }
void Execute(const char *sql)
Definition: DatabaseWorkerPool.h:87
uint32 _id
Definition: SupportMgr.h:109
float x
Definition: Vector3.h:62
ObjectGuid _closedBy
Definition: SupportMgr.h:114
void setString(const uint8 index, const std::string &value)
Definition: PreparedStatement.cpp:187
Definition: CharacterDatabase.h:301
ObjectGuid _assignedTo
Definition: SupportMgr.h:115
Definition: PreparedStatement.h:74
float y
Definition: Vector3.h:62
float _facing
Definition: SupportMgr.h:139
void setUInt16(const uint8 index, const uint16 value)
Definition: PreparedStatement.cpp:106
void setInt64(const uint8 index, const int64 value)
Definition: PreparedStatement.cpp:160
uint16 _mapId
Definition: SupportMgr.h:111
ObjectGuid _playerGuid
Definition: SupportMgr.h:110
std::string _comment
Definition: SupportMgr.h:116
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
float z
Definition: Vector3.h:62
void setFloat(const uint8 index, const float value)
Definition: PreparedStatement.cpp:169
void setUInt64(const uint8 index, const uint64 value)
Definition: PreparedStatement.cpp:124
uint8_t uint8
Definition: Define.h:152
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
std::string _note
Definition: SupportMgr.h:140
G3D::Vector3 _pos
Definition: SupportMgr.h:112
LowType GetCounter() const
Definition: ObjectGuid.h:221

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BugTicket::SetFacing ( float  facing)
inline
128 { _facing = facing; }
float _facing
Definition: SupportMgr.h:139

+ Here is the caller graph for this function:

void BugTicket::SetNote ( std::string const note)
inline
129 { _note = note; }
std::string _note
Definition: SupportMgr.h:140

+ Here is the caller graph for this function:

Member Data Documentation

float BugTicket::_facing
private
std::string BugTicket::_note
private

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