test(compare): trace deterministic monthly seed progression
This commit is contained in:
@@ -371,6 +371,34 @@ class WarUnitGeneral extends WarUnit
|
||||
|
||||
function applyDB(\MeekroDB $db): bool
|
||||
{
|
||||
$traceGeneralIds = getenv('REF_AI_TRACE_GENERAL_IDS');
|
||||
if (
|
||||
PHP_SAPI === 'cli'
|
||||
&& getenv('REF_DETERMINISTIC_INSTALL_ENABLED') === '1'
|
||||
&& is_string($traceGeneralIds)
|
||||
&& in_array((string) $this->getGeneral()->getID(), explode(',', $traceGeneralIds), true)
|
||||
) {
|
||||
$general = $this->getGeneral();
|
||||
fwrite(STDOUT, 'AI_GENERAL_PRE_APPLY_TRACE ' . Json::encode([
|
||||
'engine' => 'ref-war',
|
||||
'generalId' => $general->getID(),
|
||||
'stats' => [
|
||||
'leadership' => $general->getVar('leadership'),
|
||||
'strength' => $general->getVar('strength'),
|
||||
'intelligence' => $general->getVar('intel'),
|
||||
],
|
||||
'meta' => [
|
||||
'leadership_exp' => $general->getVar('leadership_exp'),
|
||||
'strength_exp' => $general->getVar('strength_exp'),
|
||||
'intel_exp' => $general->getVar('intel_exp'),
|
||||
'dex1' => $general->getVar('dex1'),
|
||||
'dex2' => $general->getVar('dex2'),
|
||||
'dex3' => $general->getVar('dex3'),
|
||||
'dex4' => $general->getVar('dex4'),
|
||||
'dex5' => $general->getVar('dex5'),
|
||||
],
|
||||
]) . "\n");
|
||||
}
|
||||
$affected = $this->getGeneral()->applyDB($db);
|
||||
$this->getLogger()->flush();
|
||||
return $affected;
|
||||
|
||||
Reference in New Issue
Block a user