Add ReportManager Script Trigger Support

This commit is contained in:
AconiteX
2021-06-16 18:36:23 -04:00
parent 62edbcf662
commit 9d985491e8
3 changed files with 18 additions and 4 deletions
@@ -18,6 +18,10 @@
#include "sharedFoundation/FormattedString.h"
#include "sharedGame/ProsePackage.h"
#include "sharedGame/ProsePackageParticipant.h"
#include "serverScript/GameScriptObject.h"
#include "serverScript/ScriptDictionary.h"
#include "serverScript/ScriptFunctionTable.h"
#include "serverScript/ScriptParameters.h"
#include "sharedLog/Log.h"
#include "sharedNetworkMessages/ChatAvatarId.h"
#include "sharedNetworkMessages/ChatOnRequestLog.h"
@@ -331,10 +335,18 @@ void ReportManager::handleMessage(ChatOnRequestLog const &chatOnRequestLog)
report.append(reportData.m_clientData);
}
if (!reportData.m_reportLogChannel.empty())
LOGU("CustomerService", (reportData.m_reportLogChannel.c_str()), report);
else
LOGU("CustomerService", ("Report:"), report);
//if (!reportData.m_reportLogChannel.empty())
// LOGU("CustomerService", (reportData.m_reportLogChannel.c_str()), report);
//else
// LOGU("CustomerService", ("Report:"), report);
if(reportingCreatureObject->getScriptObject())
{
ScriptParams p;
p.addParam(reportData.m_harassingNetworkId);
p.addParam(report);
IGNORE_RETURN(reportingCreatureObject->getScriptObject()->trigAllScripts(Scripting::TRIG_ON_PLAYER_REPORTED_CHAT, p));
}
// System message for success
@@ -330,6 +330,7 @@ static const Scripting::ScriptFuncTable ScriptFuncList[] =
{Scripting::TRIG_ENTER_REGION, "OnEnterRegion", "ss"},
{Scripting::TRIG_EXIT_REGION, "OnExitRegion", "ss"},
{Scripting::TRIG_ON_PLAYER_REPORTED_CHAT, "OnPlayerReportedChat", "Ou"},
//----------------------------------------------------------------------
{Scripting::TRIG_VENDOR_ITEM_COUNT_REPLY, "OnVendorItemCountReply", "ii"},
@@ -480,6 +480,7 @@ enum TrigId
TRIG_ON_ABANDON_PLAYER_QUEST = 302,
TRIG_ON_GCW_SCORE_CATEGORY_PERCENTILE_CHANGE = 303,
TRIG_WAYPOINT_WARP = 304,
TRIG_ON_PLAYER_REPORTED_CHAT = 305,
TRIG_LAST_TRIGGER
};