OregonCore  revision fb2a440-git
Your Favourite TBC server
TicketMgr.h
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore Project. See AUTHORS file for Copyright information
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef _TICKETMGR_H
19 #define _TICKETMGR_H
20 
21 #include "Policies/Singleton.h"
22 #include "Database/DatabaseEnv.h"
23 #include "Utilities/Util.h"
24 #include "Config/Config.h"
25 #include <map>
26 
28 {
29  GMTICKET_OPENEDBYGM_STATUS_NOT_OPENED = 0, // ticket has never been opened by a gm
30  GMTICKET_OPENEDBYGM_STATUS_OPENED = 1, // ticket has been opened by a gm
31 };
32 
33 struct GM_Ticket
34 {
37  std::string name;
38  float pos_x;
39  float pos_y;
40  float pos_z;
42  std::string message;
47  std::string comment;
48  bool escalated;
49  bool viewed;
50 };
51 
52 // Map Typedef
53 typedef std::list<GM_Ticket*> GmTicketList;
54 
55 class TicketMgr
56 {
57  public:
59  {
60  InitTicketID(); //constructor
61  }
62  ~TicketMgr() {} //destructor
63 
64  // Object Holder
66 
67  void AddGMTicket(GM_Ticket* ticket, bool startup);
68  void DeleteAllRemovedGMTickets();
69  void DeleteGMTicketPermanently(uint64 ticketGuid);
70  void LoadGMTickets();
71  void LoadGMSurveys();
72  void RemoveGMTicketByPlayer(uint64 playerGuid, uint64 GMguid);
73  void RemoveGMTicket(uint64 ticketGuid, uint64 GMguid);
74  void UpdateGMTicket(GM_Ticket* ticket);
75  void SaveGMTicket(GM_Ticket* ticket);
76 
77  uint64 GenerateTicketID();
78  void InitTicketID();
79  GM_Ticket* GetGMTicket(uint64 ticketGuid);
80  GM_Ticket* GetGMTicketByPlayer(uint64 playerGuid);
81  GM_Ticket* GetGMTicketByName(const char* name);
83  {
84  return ++m_GMSurveyID;
85  }
86 
87 
88  protected:
91 };
92 
93 #endif
94 #define ticketmgr Oregon::Singleton<TicketMgr>::Instance()
95 
uint64 GetNextSurveyID()
Definition: TicketMgr.h:82
bool viewed
Definition: TicketMgr.h:49
bool escalated
Definition: TicketMgr.h:48
uint64 m_ticketid
Definition: TicketMgr.h:89
float pos_z
Definition: TicketMgr.h:40
std::list< GM_Ticket * > GmTicketList
Definition: TicketMgr.h:53
uint32 map
Definition: TicketMgr.h:41
uint64 m_GMSurveyID
Definition: TicketMgr.h:90
uint64 assignedToGM
Definition: TicketMgr.h:46
uint64 timestamp
Definition: TicketMgr.h:44
std::string name
Definition: TicketMgr.h:37
std::string comment
Definition: TicketMgr.h:47
uint64 closed
Definition: TicketMgr.h:45
float pos_y
Definition: TicketMgr.h:39
uint64 playerGuid
Definition: TicketMgr.h:36
GMTicketOpenedByGMStatus
Definition: TicketMgr.h:27
GmTicketList GM_TicketList
Definition: TicketMgr.h:65
ACE_UINT64 uint64
Definition: Define.h:70
uint64 guid
Definition: TicketMgr.h:35
uint64 createtime
Definition: TicketMgr.h:43
~TicketMgr()
Definition: TicketMgr.h:62
ACE_UINT32 uint32
Definition: Define.h:71
std::string message
Definition: TicketMgr.h:42
TicketMgr()
Definition: TicketMgr.h:58
float pos_x
Definition: TicketMgr.h:38