#include "TicketMgr.h"
◆ TicketMgr()
bool _status
Definition TicketMgr.h:253
uint32 _lastTicketId
Definition TicketMgr.h:254
uint32 _openTicketCount
Definition TicketMgr.h:256
uint32 _lastSurveyId
Definition TicketMgr.h:255
uint64 _lastChange
Definition TicketMgr.h:257
Seconds GetGameTime()
Definition GameTime.cpp:38
◆ ~TicketMgr()
TicketMgr::~TicketMgr |
( |
| ) |
|
|
private |
268{
270 delete itr->second;
271}
GmTicketList _ticketList
Definition TicketMgr.h:251
References _ticketList.
◆ _RemoveTicket()
void TicketMgr::_RemoveTicket |
( |
uint32 |
ticketId, |
|
|
int64 |
source = -1 , |
|
|
bool |
permanently = false |
|
) |
| |
|
protected |
◆ AddTicket()
void TicketMgr::AddTicket |
( |
GmTicket * |
ticket | ) |
|
◆ CloseTicket()
373{
375 {
377 ticket->SetClosedBy(source);
378 if (source)
380 ticket->SaveToDB(trans);
381
383 }
384}
Definition TicketMgr.h:88
GmTicket * GetTicket(uint32 ticketId)
Definition TicketMgr.h:197
References _openTicketCount, GetTicket(), and sScriptMgr.
◆ GenerateTicketId()
uint32 TicketMgr::GenerateTicketId |
( |
| ) |
|
|
inline |
◆ GetLastChange()
uint64 TicketMgr::GetLastChange |
( |
| ) |
const |
|
inline |
◆ GetNextSurveyID()
uint32 TicketMgr::GetNextSurveyID |
( |
| ) |
|
|
inline |
◆ GetOldestOpenTicket()
GmTicket * TicketMgr::GetOldestOpenTicket |
( |
| ) |
|
|
inline |
216 {
218 if (itr->second && !itr->second->IsClosed() && !itr->second->IsCompleted())
219 return itr->second;
220
221 return nullptr;
222 }
References _ticketList.
◆ GetOpenTicketCount()
uint32 TicketMgr::GetOpenTicketCount |
( |
| ) |
const |
|
inline |
◆ GetStatus()
bool TicketMgr::GetStatus |
( |
| ) |
const |
|
inline |
◆ GetTicket()
◆ GetTicketByPlayer()
207 {
209 if (itr->second && itr->second->IsFromPlayer(playerGuid) && !itr->second->IsClosed())
210 return itr->second;
211
212 return nullptr;
213 }
References _ticketList.
◆ Initialize()
void TicketMgr::Initialize |
( |
| ) |
|
@ CONFIG_ALLOW_TICKETS
Definition IWorld.h:132
void SetStatus(bool status)
Definition TicketMgr.h:230
#define sWorld
Definition World.h:363
References CONFIG_ALLOW_TICKETS, SetStatus(), and sWorld.
◆ instance()
274{
277}
Definition TicketMgr.h:186
static TicketMgr * instance()
Definition TicketMgr.cpp:273
References instance().
Referenced by instance().
◆ LoadSurveys()
void TicketMgr::LoadSurveys |
( |
| ) |
|
349{
350
352
356
359}
std::shared_ptr< ResultSet > QueryResult
Definition DatabaseEnvFwd.h:27
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition DatabaseEnv.cpp:21
std::uint32_t uint32
Definition Define.h:107
#define LOG_INFO(filterType__,...)
Definition Log.h:165
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition Timer.h:131
uint32 getMSTime()
Definition Timer.h:103
References _lastSurveyId, CharacterDatabase, getMSTime(), GetMSTimeDiffToNow(), and LOG_INFO.
◆ LoadTickets()
void TicketMgr::LoadTickets |
( |
| ) |
|
303{
305
307 delete itr->second;
309
312
315 if (!result)
316 {
317 LOG_WARN(
"server.loading",
">> Loaded 0 GM tickets. DB table `gm_ticket` is empty!");
318
319 return;
320 }
321
323 do
324 {
325 Field* fields = result->Fetch();
328 {
329 delete ticket;
330 continue;
331 }
334
335
339
341 ++count;
342 } while (result->NextRow());
343
346}
@ CHAR_SEL_GM_TICKETS
Definition CharacterDatabase.h:262
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition DatabaseEnvFwd.h:45
#define LOG_WARN(filterType__,...)
Definition Log.h:161
Class used to access individual fields of database query result.
Definition Field.h:98
bool LoadFromDB(Field *fields)
Definition TicketMgr.cpp:50
Definition PreparedStatement.h:157
References _lastTicketId, _openTicketCount, _ticketList, CHAR_SEL_GM_TICKETS, CharacterDatabase, GmTicket::GetId(), getMSTime(), GetMSTimeDiffToNow(), GmTicket::IsClosed(), GmTicket::LoadFromDB(), LOG_INFO, and LOG_WARN.
◆ RemoveTicket()
void TicketMgr::RemoveTicket |
( |
uint32 |
ticketId | ) |
|
◆ ResetTickets()
void TicketMgr::ResetTickets |
( |
| ) |
|
◆ ResolveAndCloseTicket()
397{
399 {
401 ticket->SetClosedBy(source);
402 ticket->SetResolvedBy(source);
403 if (source)
405 ticket->SaveToDB(trans);
406
408 }
409}
References _openTicketCount, GetTicket(), and sScriptMgr.
◆ SendTicket()
◆ SetStatus()
void TicketMgr::SetStatus |
( |
bool |
status | ) |
|
|
inline |
◆ ShowClosedList()
void TicketMgr::ShowClosedList |
( |
ChatHandler & |
handler | ) |
const |
◆ ShowEscalatedList()
void TicketMgr::ShowEscalatedList |
( |
ChatHandler & |
handler | ) |
const |
◆ ShowList()
void TicketMgr::ShowList |
( |
ChatHandler & |
handler, |
|
|
bool |
onlineOnly |
|
) |
| const |
◆ UpdateLastChange()
void TicketMgr::UpdateLastChange |
( |
GmTicket * |
ticket | ) |
|
◆ _lastChange
◆ _lastSurveyId
uint32 TicketMgr::_lastSurveyId |
|
protected |
◆ _lastTicketId
uint32 TicketMgr::_lastTicketId |
|
protected |
◆ _openTicketCount
uint32 TicketMgr::_openTicketCount |
|
protected |
◆ _status
◆ _ticketList
Referenced by AddTicket(), GetOldestOpenTicket(), GetTicket(), GetTicketByPlayer(), LoadTickets(), RemoveTicket(), ResetTickets(), ShowClosedList(), ShowEscalatedList(), ShowList(), and ~TicketMgr().
The documentation for this class was generated from the following files: