From 0d9eabcaa0ad131488019d764de85448f92dfc68 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 28 Apr 2019 01:54:44 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- f_install/templates/RootDB.orig.php | 2 +- hwe/d_setting/DB.orig.php | 2 +- hwe/func_command.php | 12 ++++++------ hwe/sammo/Command/General/che_거병.php | 5 ++++- hwe/sammo/ResetHelper.php | 4 +++- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/f_install/templates/RootDB.orig.php b/f_install/templates/RootDB.orig.php index f41fbd15..64c69998 100644 --- a/f_install/templates/RootDB.orig.php +++ b/f_install/templates/RootDB.orig.php @@ -30,7 +30,7 @@ class RootDB self::$uDB = new \MeekroDB(self::$host, self::$user, self::$password, self::$dbName, self::$port, self::$encoding); self::$uDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true; - self::$uDB->error_handler= function(){}; + self::$uDB->error_handler= false; self::$uDB->throw_exception_on_error = true; self::$uDB->throw_exception_on_nonsql_error = true; } diff --git a/hwe/d_setting/DB.orig.php b/hwe/d_setting/DB.orig.php index 6ca56027..bc53afa8 100644 --- a/hwe/d_setting/DB.orig.php +++ b/hwe/d_setting/DB.orig.php @@ -28,7 +28,7 @@ class DB{ self::$uDB = new \MeekroDB(self::$host,self::$user,self::$password,self::$dbName,self::$port,self::$encoding); self::$uDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true; - self::$uDB->error_handler= function(){}; + self::$uDB->error_handler= false; self::$uDB->throw_exception_on_error = true; self::$uDB->throw_exception_on_nonsql_error = true; } diff --git a/hwe/func_command.php b/hwe/func_command.php index 03633271..824139cc 100644 --- a/hwe/func_command.php +++ b/hwe/func_command.php @@ -44,7 +44,7 @@ function pushGeneralCommand(int $generalID, int $turnCnt=1){ 'turn_idx'=>$db->sqleval('turn_idx - %i', GameConst::$maxTurn), 'action'=>'휴식', 'arg'=>'{}' - ], 'general_id=%i AND turn_idx >= %i', $generalID, GameConst::$maxTurn); + ], 'general_id=%i AND turn_idx >= %i ORDER BY turn_idx ASC', $generalID, GameConst::$maxTurn); } function pullGeneralCommand(int $generalID, int $turnCnt=1){ @@ -67,7 +67,7 @@ function pullGeneralCommand(int $generalID, int $turnCnt=1){ ], 'general_id=%i AND turn_idx < %i', $generalID, $turnCnt); $db->update('general_turn', [ 'turn_idx'=>$db->sqleval('turn_idx - %i', $turnCnt) - ], 'general_id=%i', $generalID); + ], 'general_id=%i ORDER BY turn_idx ASC', $generalID); } function pushNationCommand(int $nationID, int $level, int $turnCnt=1){ @@ -89,14 +89,14 @@ function pushNationCommand(int $nationID, int $level, int $turnCnt=1){ $db = DB::db(); - $db->update('general_turn', [ + $db->update('nation_turn', [ 'turn_idx'=>$db->sqleval('turn_idx + %i', $turnCnt) ], 'nation_id=%i AND level=%i', $nationID, $level); - $db->update('general_turn', [ + $db->update('nation_turn', [ 'turn_idx'=>$db->sqleval('turn_idx - %i', GameConst::$maxChiefTurn), 'action'=>'휴식', 'arg'=>'{}' - ], 'nation_id=%i AND level=%i AND turn_idx >= %i', $nationID, $level, GameConst::$maxChiefTurn); + ], 'nation_id=%i AND level=%i AND turn_idx >= %i ORDER BY turn_idx ASC', $nationID, $level, GameConst::$maxChiefTurn); } function pullNationCommand(int $nationID, int $level, int $turnCnt=1){ @@ -125,7 +125,7 @@ function pullNationCommand(int $nationID, int $level, int $turnCnt=1){ ], 'nation_id=%i AND level=%i AND turn_idx < %i', $nationID, $level, $turnCnt); $db->update('nation_turn', [ 'turn_idx'=>$db->sqleval('turn_idx - %i', $turnCnt) - ], 'nation_id=%i AND level=%i', $nationID, $level); + ], 'nation_id=%i AND level=%i ORDER BY turn_idx ASC', $nationID, $level); } function _setGeneralCommand(int $generalID, array $turnList, string $command, ?array $arg = null) { diff --git a/hwe/sammo/Command/General/che_거병.php b/hwe/sammo/Command/General/che_거병.php index 214cd827..93bbee21 100644 --- a/hwe/sammo/Command/General/che_거병.php +++ b/hwe/sammo/Command/General/che_거병.php @@ -119,7 +119,10 @@ class che_거병 extends Command\GeneralCommand{ 'term'=>0, ]; } - $db->insert('diplomacy', $diplomacyInit); + if($diplomacyInit){ + $db->insert('diplomacy', $diplomacyInit); + } + $turnRows = []; diff --git a/hwe/sammo/ResetHelper.php b/hwe/sammo/ResetHelper.php index 4f91139b..8afdefd4 100644 --- a/hwe/sammo/ResetHelper.php +++ b/hwe/sammo/ResetHelper.php @@ -113,6 +113,7 @@ class ResetHelper{ } (KVStorage::getStorage($db, 'game_env'))->resetValues(); + (KVStorage::getStorage($db, 'nation_env'))->resetValues(); return [ 'result'=>true, @@ -238,7 +239,8 @@ class ResetHelper{ 'extended_general'=>$extend, 'fiction'=>$fiction, 'tnmt_trig'=>$tournament_trig, - 'prev_winner'=>$prevWinner + 'prev_winner'=>$prevWinner, + 'tournament'=>0, ]; foreach(RootDB::db()->query('SELECT `no`, `name`, `picture`, `imgsvr` FROM member WHERE grade >= 5') as $admin){