104 _playerGuid = ObjectGuid::Create<HighGuid::Player>(fields[++idx].GetUInt64());
116 else if (closedBy < 0)
125 _assignedTo = ObjectGuid::Create<HighGuid::Player>(assignedTo);
161 std::stringstream ss;
195 _playerGuid = ObjectGuid::Create<HighGuid::Player>(fields[++idx].GetUInt64());
208 if (reportLineIndex != -1)
214 else if (closedBy < 0)
223 _assignedTo = ObjectGuid::Create<HighGuid::Player>(assignedTo);
230 _chatLog.
Lines.emplace_back(fields[0].GetInt64(), fields[1].GetStringView());
293 std::stringstream ss;
323 _playerGuid = ObjectGuid::Create<HighGuid::Player>(fields[++idx].GetUInt64());
335 else if (closedBy < 0)
344 _assignedTo = ObjectGuid::Create<HighGuid::Player>(assignedTo);
380 std::stringstream ss;
397SupportMgr::SupportMgr() : _supportSystemStatus(false), _ticketSystemStatus(false), _bugSystemStatus(false), _complaintSystemStatus(false), _suggestionSystemStatus(false),
398_lastBugId(0), _lastComplaintId(0), _lastSuggestionId(0), _lastChange(0),
399_openBugTicketCount(0), _openComplaintTicketCount(0), _openSuggestionTicketCount(0) { }
455 if (c.second->GetPlayerGuid() == playerGuid)
494 TC_LOG_INFO(
"server.loading",
">> Loaded 0 GM bugs. DB table `gm_bug` is empty!");
501 Field* fields = result->Fetch();
514 }
while (result->NextRow());
534 TC_LOG_INFO(
"server.loading",
">> Loaded 0 GM complaints. DB table `gm_complaint` is empty!");
543 Field* fields = result->Fetch();
562 Field* chatLineFields = chatLogResult->Fetch();
564 }
while (chatLogResult->NextRow());
569 }
while (result->NextRow());
589 TC_LOG_INFO(
"server.loading",
">> Loaded 0 GM suggestions. DB table `gm_suggestion` is empty!");
596 Field* fields = result->Fetch();
609 }
while (result->NextRow());
644 if (
BugTicket* ticket = GetTicket<BugTicket>(ticketId))
646 ticket->DeleteFromDB();
657 ticket->DeleteFromDB();
668 ticket->DeleteFromDB();
677 if (
BugTicket* ticket = GetTicket<BugTicket>(ticketId))
679 ticket->SetClosedBy(closedBy);
691 ticket->SetClosedBy(closedBy);
703 ticket->SetClosedBy(closedBy);
756 if (!itr->second->IsClosed())
757 handler.
SendSysMessage(itr->second->FormatViewMessageString(handler).c_str());
765 if (!itr->second->IsClosed())
766 handler.
SendSysMessage(itr->second->FormatViewMessageString(handler).c_str());
774 if (!itr->second->IsClosed())
775 handler.
SendSysMessage(itr->second->FormatViewMessageString(handler).c_str());
783 if (itr->second->IsClosed())
784 handler.
SendSysMessage(itr->second->FormatViewMessageString(handler).c_str());
792 if (itr->second->IsClosed())
793 handler.
SendSysMessage(itr->second->FormatViewMessageString(handler).c_str());
801 if (itr->second->IsClosed())
802 handler.
SendSysMessage(itr->second->FormatViewMessageString(handler).c_str());
@ CHAR_DEL_ALL_GM_COMPLAINTS
@ CHAR_DEL_ALL_GM_COMPLAINT_CHATLOGS
@ CHAR_SEL_GM_SUGGESTIONS
@ CHAR_DEL_ALL_GM_SUGGESTIONS
@ CHAR_INS_GM_COMPLAINT_CHATLINE
@ CHAR_SEL_GM_COMPLAINT_CHATLINES
@ CHAR_DEL_GM_COMPLAINT_CHATLOG
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
std::shared_ptr< PreparedResultSet > PreparedQueryResult
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
@ LANG_COMMAND_TICKETLISTGUID
@ LANG_COMMAND_TICKETSHOWLIST
@ LANG_COMMAND_TICKETCLOSED
@ LANG_COMMAND_TICKETDELETED
@ LANG_COMMAND_TICKETLISTCOMMENT
@ LANG_COMMAND_TICKETLISTASSIGNEDTO
@ LANG_COMMAND_TICKETLISTAGECREATE
@ LANG_COMMAND_TICKETLISTUNASSIGNED
@ LANG_COMMAND_TICKETSHOWCLOSEDLIST
@ LANG_COMMAND_TICKETLISTMESSAGE
@ LANG_COMMAND_TICKETLISTNAME
#define TC_LOG_INFO(filterType__, message__,...)
std::map< uint32, ComplaintTicket * > ComplaintTicketList
@ InappropriateCommunication
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
std::string secsToTimeString(uint64 timeInSecs, TimeFormat timeFormat, bool hoursOnly)
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
ObjectGuid const & GetGUID() const
void SaveToDB() const override
void DeleteFromDB() override
std::string FormatViewMessageString(ChatHandler &handler, bool detailed=false) const override
void LoadFromDB(Field *fields) override
static std::string PGetParseString(std::string_view fmt, Args &&... args) noexcept
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
void LoadChatLineFromDB(Field *fields)
ReportMajorCategory _majorCategory
void DeleteFromDB() override
void LoadFromDB(Field *fields) override
ReportMinorCategory _minorCategoryFlags
void SaveToDB() const override
ObjectGuid _targetCharacterGuid
std::string FormatViewMessageString(ChatHandler &handler, bool detailed=false) const override
Class used to access individual fields of database query result.
float GetFloat() const noexcept
uint64 GetUInt64() const noexcept
uint32 GetUInt32() const noexcept
uint16 GetUInt16() const noexcept
int32 GetInt32() const noexcept
std::string GetString() const noexcept
int64 GetInt64() const noexcept
LowType GetCounter() const
static ObjectGuid const Empty
void SetRawValue(std::span< uint8 const > rawBytes)
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, TeleportToOptions options=TELE_TO_NONE, Optional< uint32 > instanceId={}, uint32 teleportSpellId=0)
void setUInt16(uint8 index, uint16 value)
void setString(uint8 index, std::string &&value)
void setUInt32(uint8 index, uint32 value)
void setInt64(uint8 index, int64 value)
void setFloat(uint8 index, float value)
void setUInt64(uint8 index, uint64 value)
void setInt32(uint8 index, int32 value)
void LoadFromDB(Field *fields) override
void SaveToDB() const override
void DeleteFromDB() override
std::string FormatViewMessageString(ChatHandler &handler, bool detailed=false) const override
uint32 _openBugTicketCount
uint32 _openSuggestionTicketCount
ComplaintTicketList GetComplaintsByPlayerGuid(ObjectGuid playerGuid) const
ComplaintTicketList _complaintTicketList
static SupportMgr * instance()
SuggestionTicketList _suggestionTicketList
void SetBugSystemStatus(bool status)
void LoadComplaintTickets()
void SetSuggestionSystemStatus(bool status)
void SetTicketSystemStatus(bool status)
uint32 _openComplaintTicketCount
void SetSupportSystemStatus(bool status)
void AddTicket(BugTicket *ticket)
void LoadSuggestionTickets()
void SetComplaintSystemStatus(bool status)
BugTicketList _bugTicketList
Player * GetAssignedPlayer() const
void TeleportTo(Player *player) const
virtual std::string FormatViewMessageString(ChatHandler &handler, bool detailed=false) const =0
Player * GetPlayer() const
std::string GetPlayerName() const
std::string GetAssignedToName() const
@ CONFIG_SUPPORT_COMPLAINTS_ENABLED
@ CONFIG_SUPPORT_BUGS_ENABLED
@ CONFIG_SUPPORT_SUGGESTIONS_ENABLED
@ CONFIG_SUPPORT_TICKETS_ENABLED
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
constexpr void SetOrientation(float orientation)
constexpr float GetPositionX() const
constexpr float GetPositionY() const
constexpr float GetOrientation() const
constexpr float GetPositionZ() const
Optional< uint32 > ReportLineIndex
Array< SupportTicketChatLine, 255 > Lines