fix: 내부 이벤트 중 deterministic seed를 사용하지 않는 부분 수정

This commit is contained in:
2022-05-18 00:55:43 +09:00
parent 27811f4891
commit 85f3d0b500
2 changed files with 20 additions and 3 deletions
+11 -1
View File
@@ -3,6 +3,8 @@ namespace sammo\Event\Action;
use sammo\LiteHashDRBG; use sammo\LiteHashDRBG;
use sammo\RandUtil; use sammo\RandUtil;
use sammo\UniqueConst;
use sammo\Util;
//이전 RegNPC 함수를 EventAction으로 재구성 //이전 RegNPC 함수를 EventAction으로 재구성
class RegNPC extends \sammo\Event\Action{ class RegNPC extends \sammo\Event\Action{
@@ -26,7 +28,15 @@ class RegNPC extends \sammo\Event\Action{
$text = '' $text = ''
){ ){
$rng = new RandUtil(new LiteHashDRBG(bin2hex(random_bytes(16)))); $rng = new RandUtil(new LiteHashDRBG(Util::simpleSerialize(
UniqueConst::$hiddenSeed,
'RegNPC',
$name,
$nationID,
$leadership,
$strength,
$intel,
)));
$this->npc=(new \sammo\Scenario\GeneralBuilder( $this->npc=(new \sammo\Scenario\GeneralBuilder(
$rng, $rng,
$name, $name,
+9 -2
View File
@@ -26,8 +26,15 @@ class RegNeutralNPC extends \sammo\Event\Action{
$char = '', $char = '',
$text = '' $text = ''
){ ){
$rng = new RandUtil(new LiteHashDRBG(Util::simpleSerialize(
$rng = new RandUtil(new LiteHashDRBG(bin2hex(random_bytes(16)))); UniqueConst::$hiddenSeed,
'RegNeutralNPC',
$name,
$nationID,
$leadership,
$strength,
$intel,
)));
$this->npc=(new \sammo\Scenario\GeneralBuilder( $this->npc=(new \sammo\Scenario\GeneralBuilder(
$rng, $rng,
$name, $name,