Skip to content

Commit

Permalink
feat: record category rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisAMJ committed Jan 21, 2025
1 parent ab3b355 commit 60f6595
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Features/Speedrun/SpeedrunTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,16 @@ static void recordDemoResult() {
}
}

// category rules
appendI32(1, data); // in case we want to change this later
auto rules = SpeedrunTimer::GetCategoryRules();
appendI32(rules.size(), data);
for (auto ruleName : rules) {
auto rule = SpeedrunTimer::GetRule(ruleName);
appendStr(ruleName, data);
appendStr(rule->Describe(), data);
}

engine->demorecorder->RecordData(data.data(), data.size());
}

Expand All @@ -604,12 +614,12 @@ void SpeedrunTimer::Stop(std::string segName) {
networkManager.NotifySpeedrunFinished(false);
}

Event::Trigger<Event::SPEEDRUN_FINISH>({});

if (engine->demorecorder->isRecordingDemo) {
recordDemoResult();
}

Event::Trigger<Event::SPEEDRUN_FINISH>({});

Scheduler::InHostTicks(DEMO_AUTOSTOP_DELAY, [=]() {
if (!engine->demorecorder->isRecordingDemo) return; // manual stop before autostop
switch (sar_speedrun_autostop.GetInt()) {
Expand Down

0 comments on commit 60f6595

Please sign in to comment.