reportQuestStep (#126)

This commit is contained in:
Braylon Mooney 2024-04-21 20:59:51 -04:00 committed by GitHub
parent 00568fbbab
commit b4ac2f91d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 33 additions and 4 deletions

View File

@ -61183,7 +61183,7 @@ Address,Quality,Size,Name
0x0000007100a86ec8,O,000360,_ZN5uking10PlayReportC1ERKN4sead15FixedSafeStringILi32EEEiPNS1_4HeapE
0x0000007100a87030,O,001116,_ZN5uking10PlayReport10addMapTypeEv
0x0000007100a8748c,O,000908,_ZN5uking13reportDungeonERKN4sead14SafeStringBaseIcEES4_
0x0000007100a87818,U,001256,uking::reportQuestEvent
0x0000007100a87818,O,001256,_ZN5uking15reportQuestStepEPKN4ksys3qst5QuestEi
0x0000007100a87d00,U,002908,getQuestId
0x0000007100a8885c,U,000528,uking::reportGanonQuestFinished
0x0000007100a88a6c,U,001740,uking::reportGameOver

Can't render this file because it is too large.

View File

@ -3,11 +3,12 @@
#include "KingSystem/GameData/gdtCommonFlagsUtils.h"
#include "KingSystem/GameData/gdtManager.h"
#include "KingSystem/GameData/gdtTriggerParam.h"
#include "KingSystem/Quest/qstQuest.h"
#include "KingSystem/System/ProductReporter.h"
#include "KingSystem/System/StageInfo.h"
namespace uking {
unsigned int getQuestId(const sead::SafeString& quest_name);
void reportKorok(const sead::Vector3f& position) {
ksys::ProductReporter::getSomeBool();
s32 id = ksys::gdt::getFlag_HiddenKorok_Number();
@ -30,7 +31,6 @@ void reportKorok(const sead::Vector3f& position) {
void reportDungeon(const sead::SafeString& name, const sead::SafeString& event) {
ksys::ProductReporter::getSomeBool();
if (name.findIndex("Remains") == -1 && name.findIndex("Dungeon") == -1 &&
name.findIndex("FinalTrial") == -1)
return;
@ -52,6 +52,32 @@ void reportDungeon(const sead::SafeString& name, const sead::SafeString& event)
}
}
void reportQuestStep(const ksys::qst::Quest* quest, int step_index) {
if (quest && step_index >= 0 && step_index < quest->mSteps.size()) {
const sead::SafeString& name = quest->mName;
const sead::SafeString step_name = quest->mSteps[step_index]->name;
ksys::ProductReporter::getSomeBool();
const unsigned int quest_id = getQuestId(name);
PlayReport report(sead::SafeString("challenge"), 7,
ksys::PlayReportMgr::instance()->getReporter()->getHeap());
report.addMapType();
report.add(sead::SafeString("Id"), quest_id);
report.add(sead::SafeString("Name"), name);
report.add(sead::SafeString("Step"), step_index);
report.add(sead::SafeString("StepName"), step_name);
report.addPlayTimes();
if (ksys::PlayReportMgr::instance()) {
auto* reporter = ksys::PlayReportMgr::instance()->getReporter();
if (reporter && reporter->isEnabled())
reporter->saveReport(&report);
}
}
}
PlayReport::PlayReport(const sead::FixedSafeString<32>& event_id, s32 num_entries, sead::Heap* heap)
: ksys::PlayReport(event_id, num_entries, heap) {}

View File

@ -3,11 +3,14 @@
#include <math/seadVectorFwd.h>
#include "KingSystem/System/PlayReportMgr.h"
namespace ksys::qst {
struct Quest;
}
namespace uking {
void reportKorok(const sead::Vector3f& position);
void reportDungeon(const sead::SafeString& name, const sead::SafeString& event);
void reportQuestStep(const ksys::qst::Quest* quest, int step_index);
// TODO: More functions
class PlayReport : public ksys::PlayReport {