season 반영 안된것 마저 추가
This commit is contained in:
+30
-15
@@ -5,26 +5,34 @@ include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$session = Session::getInstance()->setReadOnly();
|
||||
$seasonIdx = Util::getReq('seasonIdx', 'int', UniqueConst::$seasonIdx);
|
||||
$scenarioIdx = Util::getReq('scenarioIdx', 'int', null);
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
increaseRefresh("명예의전당", 1);
|
||||
|
||||
$scenarioList= [];
|
||||
foreach($db->query('SELECT scenario_name as name, count(scenario) as cnt, scenario from ng_games group by scenario order by scenario asc') as $scenarioInfo){
|
||||
$scenarioList[$scenarioInfo['scenario']] = $scenarioInfo;
|
||||
}
|
||||
|
||||
|
||||
$scenarioList = (function(){
|
||||
$db = DB::db();
|
||||
$scenarioList= [];
|
||||
foreach($db->query('SELECT season, scenario_name as name, count(scenario) as cnt, scenario from ng_games group by season, scenario order by season desc, scenario asc') as $scenarioInfo){
|
||||
$seasonIdx = $scenarioInfo['season'];
|
||||
$scenarioIdx = $scenarioInfo['scenario'];
|
||||
if(!key_exists($seasonIdx, $scenarioList)){
|
||||
$scenarioList[$seasonIdx] = [];
|
||||
}
|
||||
$scenarioList[$seasonIdx][$scenarioIdx] = $scenarioInfo;
|
||||
}
|
||||
return $scenarioList;
|
||||
})();
|
||||
|
||||
if($scenarioIdx !== null || key_exists($scenarioIdx, $scenarioList)){
|
||||
$searchScenarioName = $scenarioList[$scenarioIdx]['name'];
|
||||
$searchFilter = $db->sqleval('scenario = %i', $scenarioIdx);
|
||||
$searchScenarioName = $scenarioList[$seasonIdx][$scenarioIdx]['name'];
|
||||
$searchFilter = $db->sqleval('season = %i AND scenario = %i', $seasonIdx, $scenarioIdx);
|
||||
}
|
||||
else{
|
||||
$searchScenarioName = '* 모두 *';
|
||||
$searchFilter = $db->sqleval(true);
|
||||
$searchFilter = $db->sqleval('season = %i', $seasonIdx);
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -53,12 +61,19 @@ else{
|
||||
<tr><td>명 예 의 전 당<br><?=closeButton()?></td></tr>
|
||||
<tr><td>
|
||||
시나리오 검색 : <select id="by_scenario" name="by_scenario">
|
||||
<option value="" <?=$scenarioIdx?"selected='selected'":''?>>* 종합 *</option>
|
||||
<?php foreach($scenarioList as $info): ?>
|
||||
<option
|
||||
value="<?=$info['scenario']?>"
|
||||
<?=($info['scenario']===$scenarioIdx)?"selected='selected'":''?>
|
||||
><?=$info['name']?>(<?=$info['cnt']?>회)</option>
|
||||
<?php foreach($scenarioList as $iterSeasonIdx=>$subScenarioList): ?>
|
||||
<option
|
||||
data-season="<?=$iterSeasonIdx?>"
|
||||
value=""
|
||||
<?=($iterSeasonIdx == $seasonIdx && $scenarioIdx === null)?"selected='selected'":''?>
|
||||
>* 시즌 : <?=$iterSeasonIdx?> 종합 *</option>
|
||||
<?php foreach($subScenarioList as $info): ?>
|
||||
<option
|
||||
data-season="<?=$iterSeasonIdx?>"
|
||||
value="<?=$info['scenario']?>"
|
||||
<?=($iterSeasonIdx == $seasonIdx && $info['scenario']===$scenarioIdx)?"selected='selected'":''?>
|
||||
><?=$info['name']?>(<?=$info['cnt']?>회)</option>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
?>
|
||||
</select>
|
||||
|
||||
@@ -1473,6 +1473,7 @@ function CheckHall($no) {
|
||||
|
||||
$db->insertIgnore('ng_hall', [
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
'season'=>UniqueConst::$seasonIdx,
|
||||
'scenario'=>$scenarioIdx,
|
||||
'general_no'=>$no,
|
||||
'type'=>$idx,
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
jQuery(function($){
|
||||
$('#by_scenario').change(function(){
|
||||
var scenarioIdx = $(this).val();
|
||||
$.redirect('a_hallOfFame.php', {scenarioIdx:scenarioIdx}, 'get');
|
||||
var $this = $(this);
|
||||
var scenarioIdx = $this.val();
|
||||
var seasonIdx = $(this).find('option:selected').data('season');
|
||||
|
||||
|
||||
$.redirect('a_hallOfFame.php', {scenarioIdx:scenarioIdx, seasonIdx:seasonIdx}, 'get');
|
||||
})
|
||||
//$.redirect("processing.php",{ commandtype: commandtype, turn: turn}, 'post');
|
||||
});
|
||||
@@ -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,12 +123,15 @@ class ResetHelper{
|
||||
}
|
||||
}
|
||||
|
||||
(KVStorage::getStorage($db, 'game_env'))->resetValues();
|
||||
(KVStorage::getStorage($db, 'nation_env'))->resetValues();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$gameStor->resetValues();
|
||||
$gameStor->next_season_idx = $seasonIdx;
|
||||
|
||||
return [
|
||||
'result'=>true,
|
||||
'serverID'=>$serverID
|
||||
'serverID'=>$serverID,
|
||||
'seasonIdx'=>$seasonIdx
|
||||
];
|
||||
}
|
||||
|
||||
@@ -154,6 +168,7 @@ class ResetHelper{
|
||||
}
|
||||
|
||||
$serverID = $clearResult['serverID'];
|
||||
$seasonIdx = $clearResult['seasonIdx'];
|
||||
|
||||
$scenarioObj = new Scenario($scenario, false);
|
||||
$scenarioObj->buildConf();
|
||||
@@ -275,6 +290,7 @@ class ResetHelper{
|
||||
'date'=>$turntime,
|
||||
'winner_nation'=>null,
|
||||
'map'=>$scenarioObj->getMapTheme(),
|
||||
'season'=>$seasonIdx,
|
||||
'scenario'=>$scenario,
|
||||
'scenario_name'=>$scenarioObj->getTitle(),
|
||||
'env'=>Json::encode($env)
|
||||
|
||||
+3
-1
@@ -332,6 +332,7 @@ ENGINE=InnoDB;
|
||||
CREATE TABLE IF NOT EXISTS `ng_hall` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`server_id` CHAR(20) NOT NULL,
|
||||
`season` INT(11) NOT NULL,
|
||||
`scenario` INT(11) NOT NULL,
|
||||
`general_no` INT(11) NOT NULL,
|
||||
`type` INT(11) NOT NULL,
|
||||
@@ -342,7 +343,7 @@ CREATE TABLE IF NOT EXISTS `ng_hall` (
|
||||
UNIQUE INDEX `server_general` (`server_id`, `type`, `general_no`),
|
||||
UNIQUE INDEX `owner` (`owner`, `server_id`, `type`),
|
||||
INDEX `server_show` (`server_id`, `type`, `value`),
|
||||
INDEX `scenario` (`scenario`, `type`, `value`)
|
||||
INDEX `scenario` (`season`, `scenario`, `type`, `value`)
|
||||
)
|
||||
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPRESSED;
|
||||
|
||||
@@ -357,6 +358,7 @@ CREATE TABLE IF NOT EXISTS `ng_games` (
|
||||
`date` DATETIME NOT NULL,
|
||||
`winner_nation` INT(11) NULL DEFAULT NULL,
|
||||
`map` VARCHAR(50) NULL DEFAULT NULL,
|
||||
`season` INT(11) NOT NULL,
|
||||
`scenario` INT(11) NOT NULL,
|
||||
`scenario_name` TEXT NOT NULL,
|
||||
`env` TEXT NOT NULL COMMENT 'json',
|
||||
|
||||
Reference in New Issue
Block a user