UniqueConst와 game_env에 seasonIdx 추가
This commit is contained in:
@@ -5,6 +5,7 @@ include "lib.php";
|
|||||||
include "func.php";
|
include "func.php";
|
||||||
|
|
||||||
$session = Session::getInstance()->setReadOnly();
|
$session = Session::getInstance()->setReadOnly();
|
||||||
|
$seasonIdx = Util::getReq('seasonIdx', 'int', null);
|
||||||
$scenarioIdx = Util::getReq('scenarioIdx', 'int', null);
|
$scenarioIdx = Util::getReq('scenarioIdx', 'int', null);
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace sammo;
|
|||||||
class UniqueConst{
|
class UniqueConst{
|
||||||
public static $serverID = '_tK_serverID_';
|
public static $serverID = '_tK_serverID_';
|
||||||
public static $serverName = '_tK_serverName_';
|
public static $serverName = '_tK_serverName_';
|
||||||
|
public static $seasonIdx = '_tK_seasonIdx_';
|
||||||
|
|
||||||
private function __construct(){}
|
private function __construct(){}
|
||||||
|
|
||||||
|
|||||||
@@ -81,11 +81,22 @@ class ResetHelper{
|
|||||||
mkdir($servRoot.'/logs/'.$serverID, 0755);
|
mkdir($servRoot.'/logs/'.$serverID, 0755);
|
||||||
mkdir($servRoot.'/data/'.$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(
|
$result = Util::generateFileUsingSimpleTemplate(
|
||||||
$servRoot.'/d_setting/UniqueConst.orig.php',
|
$servRoot.'/d_setting/UniqueConst.orig.php',
|
||||||
$servRoot.'/d_setting/UniqueConst.php',[
|
$servRoot.'/d_setting/UniqueConst.php',[
|
||||||
'serverID'=>$serverID,
|
'serverID'=>$serverID,
|
||||||
'serverName'=>AppConf::getList()[$prefix]->getKorName(),
|
'serverName'=>AppConf::getList()[$prefix]->getKorName(),
|
||||||
|
'seasonIdx'=>$seasonIdx
|
||||||
], true
|
], 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 [
|
return [
|
||||||
'result'=>true,
|
'result'=>true,
|
||||||
'serverID'=>$serverID
|
'serverID'=>$serverID,
|
||||||
|
'seasonIdx'=>$seasonIdx
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user