diff --git a/hwe/a_hallOfFame.php b/hwe/a_hallOfFame.php index b0f8cb23..120f7ecc 100644 --- a/hwe/a_hallOfFame.php +++ b/hwe/a_hallOfFame.php @@ -5,6 +5,7 @@ include "lib.php"; include "func.php"; $session = Session::getInstance()->setReadOnly(); +$seasonIdx = Util::getReq('seasonIdx', 'int', null); $scenarioIdx = Util::getReq('scenarioIdx', 'int', null); $db = DB::db(); diff --git a/hwe/d_setting/UniqueConst.orig.php b/hwe/d_setting/UniqueConst.orig.php index 29dd6dbe..6627a649 100644 --- a/hwe/d_setting/UniqueConst.orig.php +++ b/hwe/d_setting/UniqueConst.orig.php @@ -4,6 +4,7 @@ namespace sammo; class UniqueConst{ public static $serverID = '_tK_serverID_'; public static $serverName = '_tK_serverName_'; + public static $seasonIdx = '_tK_seasonIdx_'; private function __construct(){} diff --git a/hwe/sammo/ResetHelper.php b/hwe/sammo/ResetHelper.php index bf1bf6ef..6525da22 100644 --- a/hwe/sammo/ResetHelper.php +++ b/hwe/sammo/ResetHelper.php @@ -81,11 +81,22 @@ class ResetHelper{ mkdir($servRoot.'/logs/'.$serverID, 0755); mkdir($servRoot.'/data/'.$serverID, 0755); + $seasonIdx = 1; + if($db->queryFirstField('SHOW TABLES LIKE %s', 'storage') !== null){ + $gameStor = KVStorage::getStorage($db, 'game_env'); + $nextSeasonIdx = $gameStor->next_season_idx; + if($nextSeasonIdx !== null){ + $seasonIdx = $nextSeasonIdx; + } + $gameStor->resetCache(); + } + $result = Util::generateFileUsingSimpleTemplate( $servRoot.'/d_setting/UniqueConst.orig.php', $servRoot.'/d_setting/UniqueConst.php',[ 'serverID'=>$serverID, 'serverName'=>AppConf::getList()[$prefix]->getKorName(), + 'seasonIdx'=>$seasonIdx ], true ); @@ -112,11 +123,14 @@ class ResetHelper{ } } - (KVStorage::getStorage($db, 'game_env'))->resetValues(); + $gameStor = KVStorage::getStorage($db, 'game_env'); + $gameStor->resetValues(); + $gameStor->next_season_idx = $seasonIdx; return [ 'result'=>true, - 'serverID'=>$serverID + 'serverID'=>$serverID, + 'seasonIdx'=>$seasonIdx ]; }