From 85f3d0b50056017c3986a139fc471ee0072edc7f Mon Sep 17 00:00:00 2001 From: Hide_D Date: Wed, 18 May 2022 00:55:43 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=82=B4=EB=B6=80=20=EC=9D=B4=EB=B2=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=A4=91=20deterministic=20seed=EB=A5=BC=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20?= =?UTF-8?q?=EB=B6=80=EB=B6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Event/Action/RegNPC.php | 12 +++++++++++- hwe/sammo/Event/Action/RegNeutralNPC.php | 11 +++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/hwe/sammo/Event/Action/RegNPC.php b/hwe/sammo/Event/Action/RegNPC.php index 8d3bc4a1..e4ac3f8a 100644 --- a/hwe/sammo/Event/Action/RegNPC.php +++ b/hwe/sammo/Event/Action/RegNPC.php @@ -3,6 +3,8 @@ namespace sammo\Event\Action; use sammo\LiteHashDRBG; use sammo\RandUtil; +use sammo\UniqueConst; +use sammo\Util; //이전 RegNPC 함수를 EventAction으로 재구성 class RegNPC extends \sammo\Event\Action{ @@ -26,7 +28,15 @@ class RegNPC extends \sammo\Event\Action{ $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( $rng, $name, diff --git a/hwe/sammo/Event/Action/RegNeutralNPC.php b/hwe/sammo/Event/Action/RegNeutralNPC.php index 1c4d51ac..64c26e74 100644 --- a/hwe/sammo/Event/Action/RegNeutralNPC.php +++ b/hwe/sammo/Event/Action/RegNeutralNPC.php @@ -26,8 +26,15 @@ class RegNeutralNPC extends \sammo\Event\Action{ $char = '', $text = '' ){ - - $rng = new RandUtil(new LiteHashDRBG(bin2hex(random_bytes(16)))); + $rng = new RandUtil(new LiteHashDRBG(Util::simpleSerialize( + UniqueConst::$hiddenSeed, + 'RegNeutralNPC', + $name, + $nationID, + $leadership, + $strength, + $intel, + ))); $this->npc=(new \sammo\Scenario\GeneralBuilder( $rng, $name,