Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
TicketMgr.h
Go to the documentation of this file.
1
/*
2
* This file is part of Project SkyFire https://www.projectskyfire.org.
3
* See LICENSE.md file for Copyright information
4
*/
5
6
#ifndef SF_TICKETMGR_H
7
#define SF_TICKETMGR_H
8
9
#include <string>
10
11
#include "
ObjectMgr.h
"
12
#include "
Platform/Singleton.h
"
13
#include "
TicketInfo.h
"
14
15
typedef
std::map<uint32, BugTicket*>
BugTicketList
;
16
typedef
std::map<uint32, GmTicket*>
GmTicketList
;
17
typedef
std::map<uint32, SuggestTicket*>
SuggestTicketList
;
18
19
class
TicketMgr
20
{
21
friend
class
Skyfire::Singleton
<
TicketMgr
,
Skyfire
::NullMutex>;
22
23
private
:
24
TicketMgr
();
25
~
TicketMgr
();
26
27
public
:
28
static
TicketMgr
*
instance
()
29
{
30
static
TicketMgr
instance
;
31
return
&
instance
;
32
}
33
34
void
Initialize
();
35
36
template
<
typename
T> T*
GetTicket
(
uint32
ticketId);
37
template
<
typename
T>
uint32
GetOpenTicketCount
()
const
;
38
39
GmTicket
*
GetGmTicketByPlayerGuid
(
ObjectGuid
playerGuid)
const
40
{
41
for
(GmTicketList::const_iterator itr =
_gmTicketList
.begin(); itr !=
_gmTicketList
.end(); ++itr)
42
if
(itr->second->GetPlayerGuid() == playerGuid && !itr->second->IsClosed())
43
return
itr->second;
44
45
return
NULL;
46
}
47
48
GmTicket
*
GetTicket
(
uint32
ticketId)
49
{
50
GmTicketList::iterator itr =
_gmTicketList
.find(ticketId);
51
if
(itr !=
_gmTicketList
.end())
52
return
itr->second;
53
54
return
NULL;
55
}
56
57
GmTicket
*
GetOldestOpenTicket
()
58
{
59
for
(GmTicketList::const_iterator itr =
_gmTicketList
.begin(); itr !=
_gmTicketList
.end(); ++itr)
60
if
(itr->second && !itr->second->IsClosed() && !itr->second->IsCompleted())
61
return
itr->second;
62
63
return
NULL;
64
}
65
66
bool
GetFeedBackSystemStatus
()
const
{
return
_feedbackSystemStatus
; }
67
bool
GetGmTicketSystemStatus
()
const
{
return
_gmTicketSystemStatus
; }
68
69
uint64
GetLastChange
()
const
{
return
_lastChange
; }
70
71
void
SetFeedBackSystemStatus
(
bool
status) {
_feedbackSystemStatus
= status; }
72
void
SetGmTicketSystemStatus
(
bool
status) {
_gmTicketSystemStatus
= status; }
73
74
void
LoadGmTickets
();
75
void
LoadBugTickets
();
76
void
LoadSuggestTickets
();
77
void
LoadSurveys
();
78
79
void
AddTicket
(
GmTicket
* ticket);
80
void
AddTicket
(
BugTicket
* ticket);
81
void
AddTicket
(
SuggestTicket
* ticket);
82
83
template
<
typename
T>
void
RemoveTicket
(
uint32
ticketId);
84
template
<
typename
T>
void
CloseTicket
(
uint32
ticketId,
int64
closedBy);
85
template
<
typename
T>
void
ResetTickets
();
86
template
<
typename
T>
void
ShowList
(
ChatHandler
& handler)
const
;
87
template
<
typename
T>
void
ShowList
(
ChatHandler
& handler,
bool
onlineOnly)
const
;
88
template
<
typename
T>
void
ShowClosedList
(
ChatHandler
& handler)
const
;
89
90
void
ShowGmEscalatedList
(
ChatHandler
& handler)
const
;
91
void
SendGmTicket
(
WorldSession
* session,
GmTicket
* ticket)
const
;
92
void
SendGmTicketUpdate
(
Opcodes
opcode,
GMTicketResponse
response,
Player
* player)
const
;
93
void
SendGmResponsee
(
WorldSession
* session,
GmTicket
* ticket)
const
;
94
void
UpdateLastChange
() {
_lastChange
=
uint64
(time(NULL)); }
95
96
uint32
GenerateGmTicketId
() {
return
++
_lastGmTicketId
; }
97
uint32
GenerateBugId
() {
return
++
_lastBugId
; }
98
uint32
GenerateSuggestId
() {
return
++
_lastSuggestId
; }
99
uint32
GetNextSurveyID
() {
return
++
_lastSurveyId
; }
100
101
private
:
102
bool
_feedbackSystemStatus
;
103
bool
_gmTicketSystemStatus
;
104
GmTicketList
_gmTicketList
;
105
BugTicketList
_bugTicketList
;
106
SuggestTicketList
_suggestTicketList
;
107
uint32
_lastGmTicketId
;
108
uint32
_lastSurveyId
;
109
uint32
_lastBugId
;
110
uint32
_lastSuggestId
;
111
uint64
_lastChange
;
112
uint32
_openGmTicketCount
;
113
uint32
_openBugTicketCount
;
114
uint32
_openSuggestTicketCount
;
115
};
116
117
#define sTicketMgr Skyfire::Singleton<TicketMgr, Skyfire::NullMutex>::instance()
118
119
#endif
// SF_TICKETMGR_H
uint32
std::uint32_t uint32
Definition
Define.h:77
uint64
std::uint64_t uint64
Definition
Define.h:76
int64
std::int64_t int64
Definition
Define.h:72
ObjectMgr.h
Singleton.h
TicketInfo.h
GMTicketResponse
GMTicketResponse
Definition
TicketInfo.h:27
SuggestTicketList
std::map< uint32, SuggestTicket * > SuggestTicketList
Definition
TicketMgr.h:17
GmTicketList
std::map< uint32, GmTicket * > GmTicketList
Definition
TicketMgr.h:16
BugTicketList
std::map< uint32, BugTicket * > BugTicketList
Definition
TicketMgr.h:15
BugTicket
Definition
TicketInfo.h:169
ChatHandler
Definition
Chat.h:41
GmTicket
Definition
TicketInfo.h:123
Player
Definition
Player.h:1289
Skyfire::Singleton
Definition
Singleton.h:15
SuggestTicket
Definition
TicketInfo.h:193
TicketMgr::TicketMgr
TicketMgr()
Definition
TicketMgr.cpp:20
TicketMgr::GenerateGmTicketId
uint32 GenerateGmTicketId()
Definition
TicketMgr.h:96
TicketMgr::SendGmResponsee
void SendGmResponsee(WorldSession *session, GmTicket *ticket) const
Definition
TicketMgr.cpp:461
TicketMgr::_suggestTicketList
SuggestTicketList _suggestTicketList
Definition
TicketMgr.h:106
TicketMgr::_gmTicketList
GmTicketList _gmTicketList
Definition
TicketMgr.h:104
TicketMgr::GetGmTicketByPlayerGuid
GmTicket * GetGmTicketByPlayerGuid(ObjectGuid playerGuid) const
Definition
TicketMgr.h:39
TicketMgr::_gmTicketSystemStatus
bool _gmTicketSystemStatus
Definition
TicketMgr.h:103
TicketMgr::GetOldestOpenTicket
GmTicket * GetOldestOpenTicket()
Definition
TicketMgr.h:57
TicketMgr::_lastSuggestId
uint32 _lastSuggestId
Definition
TicketMgr.h:110
TicketMgr::LoadSuggestTickets
void LoadSuggestTickets()
Definition
TicketMgr.cpp:124
TicketMgr::_feedbackSystemStatus
bool _feedbackSystemStatus
Definition
TicketMgr.h:102
TicketMgr::GenerateBugId
uint32 GenerateBugId()
Definition
TicketMgr.h:97
TicketMgr::SetGmTicketSystemStatus
void SetGmTicketSystemStatus(bool status)
Definition
TicketMgr.h:72
TicketMgr::SendGmTicketUpdate
void SendGmTicketUpdate(Opcodes opcode, GMTicketResponse response, Player *player) const
Definition
TicketMgr.cpp:483
TicketMgr::LoadSurveys
void LoadSurveys()
Definition
TicketMgr.cpp:165
TicketMgr::_openGmTicketCount
uint32 _openGmTicketCount
Definition
TicketMgr.h:112
TicketMgr::LoadBugTickets
void LoadBugTickets()
Definition
TicketMgr.cpp:83
TicketMgr::ShowClosedList
void ShowClosedList(ChatHandler &handler) const
TicketMgr::AddTicket
void AddTicket(GmTicket *ticket)
Definition
TicketMgr.cpp:178
TicketMgr::CloseTicket
void CloseTicket(uint32 ticketId, int64 closedBy)
TicketMgr::_bugTicketList
BugTicketList _bugTicketList
Definition
TicketMgr.h:105
TicketMgr::GetOpenTicketCount
uint32 GetOpenTicketCount() const
TicketMgr::_lastBugId
uint32 _lastBugId
Definition
TicketMgr.h:109
TicketMgr::_lastSurveyId
uint32 _lastSurveyId
Definition
TicketMgr.h:108
TicketMgr::GetTicket
T * GetTicket(uint32 ticketId)
TicketMgr::instance
static TicketMgr * instance()
Definition
TicketMgr.h:28
TicketMgr::GetNextSurveyID
uint32 GetNextSurveyID()
Definition
TicketMgr.h:99
TicketMgr::UpdateLastChange
void UpdateLastChange()
Definition
TicketMgr.h:94
TicketMgr::GetTicket
GmTicket * GetTicket(uint32 ticketId)
Definition
TicketMgr.h:48
TicketMgr::_lastChange
uint64 _lastChange
Definition
TicketMgr.h:111
TicketMgr::ShowGmEscalatedList
void ShowGmEscalatedList(ChatHandler &handler) const
Definition
TicketMgr.cpp:415
TicketMgr::Initialize
void Initialize()
Definition
TicketMgr.cpp:36
TicketMgr::ShowList
void ShowList(ChatHandler &handler, bool onlineOnly) const
TicketMgr::GetLastChange
uint64 GetLastChange() const
Definition
TicketMgr.h:69
TicketMgr::SendGmTicket
void SendGmTicket(WorldSession *session, GmTicket *ticket) const
@ response Packets
Definition
TicketMgr.cpp:425
TicketMgr::_openSuggestTicketCount
uint32 _openSuggestTicketCount
Definition
TicketMgr.h:114
TicketMgr::SetFeedBackSystemStatus
void SetFeedBackSystemStatus(bool status)
Definition
TicketMgr.h:71
TicketMgr::_lastGmTicketId
uint32 _lastGmTicketId
Definition
TicketMgr.h:107
TicketMgr::GenerateSuggestId
uint32 GenerateSuggestId()
Definition
TicketMgr.h:98
TicketMgr::_openBugTicketCount
uint32 _openBugTicketCount
Definition
TicketMgr.h:113
TicketMgr::LoadGmTickets
void LoadGmTickets()
Definition
TicketMgr.cpp:42
TicketMgr::GetGmTicketSystemStatus
bool GetGmTicketSystemStatus() const
Definition
TicketMgr.h:67
TicketMgr::ResetTickets
void ResetTickets()
TicketMgr::GetFeedBackSystemStatus
bool GetFeedBackSystemStatus() const
Definition
TicketMgr.h:66
TicketMgr::RemoveTicket
void RemoveTicket(uint32 ticketId)
TicketMgr::ShowList
void ShowList(ChatHandler &handler) const
WorldSession
Player session in the World.
Definition
WorldSession.h:254
Opcodes
Opcodes
List of Opcodes.
Definition
Opcodes.h:21
Skyfire
Definition
AuthPatchTransfer.h:12
ObjectGuid
Definition
ByteBuffer.h:66
src
server
game
Tickets
TicketMgr.h
Generated on
for Project SkyFire Core by
1.17.0