blob: 56eaac4623f8b38de97149c85016800b407bb296 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "WorldSession.h"
#include "Common.h"
#include "DatabaseEnv.h"
#include "SupportMgr.h"
#include "TicketPackets.h"
void WorldSession::HandleGMTicketGetCaseStatusOpcode(WorldPackets::Ticket::GMTicketGetCaseStatus& /*packet*/)
{
// TODO: Implement GmCase and handle this packet properly
WorldPackets::Ticket::GMTicketCaseStatus status;
SendPacket(status.Write());
}
void WorldSession::HandleGMTicketSystemStatusOpcode(WorldPackets::Ticket::GMTicketGetSystemStatus& /*packet*/)
{
// Note: This only disables the ticket UI at client side and is not fully reliable
// Note: This disables the whole customer support UI after trying to send a ticket in disabled state (MessageBox: "GM Help Tickets are currently unavaiable."). UI remains disabled until the character relogs.
WorldPackets::Ticket::GMTicketSystemStatus response;
response.Status = sSupportMgr->GetSupportSystemStatus() ? GMTICKET_QUEUE_STATUS_ENABLED : GMTICKET_QUEUE_STATUS_DISABLED;
SendPacket(response.Write());
}
void WorldSession::HandleSubmitUserFeedback(WorldPackets::Ticket::SubmitUserFeedback& userFeedback)
{
if (userFeedback.IsSuggestion)
{
if (!sSupportMgr->GetSuggestionSystemStatus())
return;
SuggestionTicket* ticket = new SuggestionTicket(GetPlayer());
ticket->SetPosition(userFeedback.Header.MapID, userFeedback.Header.Position);
ticket->SetFacing(userFeedback.Header.Facing);
ticket->SetNote(userFeedback.Note);
sSupportMgr->AddTicket(ticket);
}
else
{
if (!sSupportMgr->GetBugSystemStatus())
return;
BugTicket* ticket = new BugTicket(GetPlayer());
ticket->SetPosition(userFeedback.Header.MapID, userFeedback.Header.Position);
ticket->SetFacing(userFeedback.Header.Facing);
ticket->SetNote(userFeedback.Note);
sSupportMgr->AddTicket(ticket);
}
}
void WorldSession::HandleSupportTicketSubmitComplaint(WorldPackets::Ticket::SupportTicketSubmitComplaint& packet)
{
if (!sSupportMgr->GetComplaintSystemStatus())
return;
ComplaintTicket* comp = new ComplaintTicket(GetPlayer());
comp->SetPosition(packet.Header.MapID, packet.Header.Position);
comp->SetFacing(packet.Header.Facing);
comp->SetChatLog(packet.ChatLog);
comp->SetTargetCharacterGuid(packet.TargetCharacterGUID);
comp->SetReportType(ReportType(packet.ReportType));
comp->SetMajorCategory(ReportMajorCategory(packet.MajorCategory));
comp->SetMinorCategoryFlags(ReportMinorCategory(packet.MinorCategoryFlags));
comp->SetNote(packet.Note);
sSupportMgr->AddTicket(comp);
}
void WorldSession::HandleBugReportOpcode(WorldPackets::Ticket::BugReport& bugReport)
{
// Note: There is no way to trigger this with standard UI except /script ReportBug("text")
if (!sSupportMgr->GetBugSystemStatus())
return;
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BUG_REPORT);
stmt->setString(0, bugReport.Text);
stmt->setString(1, bugReport.DiagInfo);
CharacterDatabase.Execute(stmt);
}
void WorldSession::HandleComplaint(WorldPackets::Ticket::Complaint& packet)
{ // NOTE: all chat messages from this spammer are automatically ignored by the spam reporter until logout in case of chat spam.
// if it's mail spam - ALL mails from this spammer are automatically removed by client
WorldPackets::Ticket::ComplaintResult result;
result.ComplaintType = packet.ComplaintType;
result.Result = 0;
SendPacket(result.Write());
}
|