버그 수정
This commit is contained in:
@@ -19,8 +19,8 @@ if (!$gameStor->isunited) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($db->queryFirstColumn(
|
foreach ($db->queryFirstColumn(
|
||||||
'SELECT no FROM general WHERE npc != 0 and age >= %i',
|
'SELECT no FROM general WHERE npc < 2 and age >= %i',
|
||||||
GameConst::$retirementYear
|
40
|
||||||
) as $generalNo) {
|
) as $generalNo) {
|
||||||
CheckHall($generalNo);
|
CheckHall($generalNo);
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-24
@@ -84,27 +84,27 @@ else{
|
|||||||
<div style="margin:auto;width:1100px;">
|
<div style="margin:auto;width:1100px;">
|
||||||
<?php
|
<?php
|
||||||
$types = [
|
$types = [
|
||||||
["명 성", 'int'],
|
'experience'=>['명 성', 'int'],
|
||||||
["계 급", 'int'],
|
'dedication'=>['계 급', 'int'],
|
||||||
["계 략 성 공", 'int'],
|
'firenum'=>['계 략 성 공', 'int'],
|
||||||
["전 투 횟 수", 'int'],
|
'warnum'=>['전 투 횟 수', 'int'],
|
||||||
["승 리", 'int'],
|
'killnum'=>['승 리', 'int'],
|
||||||
["승 률", 'percent'],
|
'winrate'=>['승 률', 'percent'],
|
||||||
["사 살", 'int'],
|
'killcrew'=>['사 살', 'int'],
|
||||||
["살 상 률", 'percent'],
|
'killrate'=>['살 상 률', 'percent'],
|
||||||
["보 병 숙 련 도", 'int'],
|
'dex1'=>['보 병 숙 련 도', 'int'],
|
||||||
["궁 병 숙 련 도", 'int'],
|
'dex2'=>['궁 병 숙 련 도', 'int'],
|
||||||
["기 병 숙 련 도", 'int'],
|
'dex3'=>['기 병 숙 련 도', 'int'],
|
||||||
["귀 병 숙 련 도", 'int'],
|
'dex4'=>['귀 병 숙 련 도', 'int'],
|
||||||
["차 병 숙 련 도", 'int'],
|
'dex5'=>['차 병 숙 련 도', 'int'],
|
||||||
["전 력 전 승 률", 'percent'],
|
'ttrate'=>['전 력 전 승 률', 'percent'],
|
||||||
["통 솔 전 승 률", 'percent'],
|
'tlrate'=>['통 솔 전 승 률', 'percent'],
|
||||||
["일 기 토 승 률", 'percent'],
|
'tsrate'=>['일 기 토 승 률', 'percent'],
|
||||||
["설 전 승 률", 'percent'],
|
'tirate'=>['설 전 승 률', 'percent'],
|
||||||
["베 팅 투 자 액", 'int'],
|
'betgold'=>['베 팅 투 자 액', 'int'],
|
||||||
["베 팅 당 첨", 'int'],
|
'betwin'=>['베 팅 당 첨', 'int'],
|
||||||
["베 팅 수 익 금", 'int'],
|
'betwingold'=>['베 팅 수 익 금', 'int'],
|
||||||
["베 팅 수 익 률", 'percent'],
|
'betrate'=>['베 팅 수 익 률', 'percent'],
|
||||||
];
|
];
|
||||||
|
|
||||||
$templates = new \League\Plates\Engine('templates');
|
$templates = new \League\Plates\Engine('templates');
|
||||||
@@ -114,8 +114,8 @@ foreach(RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID,
|
|||||||
$ownerNameList[$ownerID] = $ownerName;
|
$ownerNameList[$ownerID] = $ownerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($types as $idx=>[$typeName, $typeValue]) {
|
foreach($types as $typeName=>[$typeDescribe, $typeValue]) {
|
||||||
$hallResult = $db->query('SELECT * FROM ng_hall WHERE `type`=%i AND %? ORDER BY `value` DESC LIMIT 10', $idx, $searchFilter);
|
$hallResult = $db->query('SELECT * FROM hall WHERE `type`=%i AND %? ORDER BY `value` DESC LIMIT 10', $typeName, $searchFilter);
|
||||||
|
|
||||||
$hallResult = array_map(function($general)use($typeValue, $ownerNameList){
|
$hallResult = array_map(function($general)use($typeValue, $ownerNameList){
|
||||||
$aux = Json::decode($general['aux']);
|
$aux = Json::decode($general['aux']);
|
||||||
@@ -160,7 +160,7 @@ foreach($types as $idx=>[$typeName, $typeValue]) {
|
|||||||
}, $hallResult);
|
}, $hallResult);
|
||||||
|
|
||||||
echo $templates->render('hallOfFrame', [
|
echo $templates->render('hallOfFrame', [
|
||||||
'typeName'=>$typeName,
|
'typeName'=>$typeDescribe,
|
||||||
'generals'=>$hallResult
|
'generals'=>$hallResult
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-8
@@ -1361,7 +1361,7 @@ function CheckHall($no)
|
|||||||
["betwin", 'rank'],
|
["betwin", 'rank'],
|
||||||
["betwingold", 'rank'],
|
["betwingold", 'rank'],
|
||||||
["betrate", 'calc'],
|
["betrate", 'calc'],
|
||||||
]; //XXX: 순서가 DB에 박혀있다 ㅜㅜ
|
];
|
||||||
|
|
||||||
$generalObj = General::createGeneralObjFromDB($no, null, 2);
|
$generalObj = General::createGeneralObjFromDB($no, null, 2);
|
||||||
|
|
||||||
@@ -1420,7 +1420,7 @@ function CheckHall($no)
|
|||||||
$ownerName = RootDB::db()->queryFirstField('SELECT name FROM member WHERE no = %i', $generalObj->getVar('owner'));
|
$ownerName = RootDB::db()->queryFirstField('SELECT name FROM member WHERE no = %i', $generalObj->getVar('owner'));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($types as $idx => [$typeName, $valueType]) {
|
foreach ($types as [$typeName, $valueType]) {
|
||||||
|
|
||||||
if ($valueType === 'natural') {
|
if ($valueType === 'natural') {
|
||||||
$value = $generalObj->getVar($typeName);
|
$value = $generalObj->getVar($typeName);
|
||||||
@@ -1476,12 +1476,12 @@ function CheckHall($no)
|
|||||||
];
|
];
|
||||||
$jsonAux = Json::encode($aux);
|
$jsonAux = Json::encode($aux);
|
||||||
|
|
||||||
$db->insertIgnore('ng_hall', [
|
$db->insertIgnore('hall', [
|
||||||
'server_id' => UniqueConst::$serverID,
|
'server_id' => UniqueConst::$serverID,
|
||||||
'season' => UniqueConst::$seasonIdx,
|
'season' => UniqueConst::$seasonIdx,
|
||||||
'scenario' => $scenarioIdx,
|
'scenario' => $scenarioIdx,
|
||||||
'general_no' => $no,
|
'general_no' => $no,
|
||||||
'type' => $idx,
|
'type' => $typeName,
|
||||||
'value' => $value,
|
'value' => $value,
|
||||||
'owner' => $generalObj->getVar('owner'),
|
'owner' => $generalObj->getVar('owner'),
|
||||||
'aux' => $jsonAux
|
'aux' => $jsonAux
|
||||||
@@ -1489,16 +1489,16 @@ function CheckHall($no)
|
|||||||
|
|
||||||
if ($db->affectedRows() == 0) {
|
if ($db->affectedRows() == 0) {
|
||||||
$db->update(
|
$db->update(
|
||||||
'ng_hall',
|
'hall',
|
||||||
[
|
[
|
||||||
'value' => $value,
|
'value' => $value,
|
||||||
'aux' => $jsonAux
|
'aux' => $jsonAux
|
||||||
],
|
],
|
||||||
'server_id = %s AND scenario = %i AND general_no = %i AND type = %i AND value < %d',
|
'server_id = %s AND scenario = %i AND general_no = %i AND type = %s AND value < %d',
|
||||||
UniqueConst::$serverID,
|
UniqueConst::$serverID,
|
||||||
$scenarioIdx,
|
$scenarioIdx,
|
||||||
$no,
|
$no,
|
||||||
$idx,
|
$typeName,
|
||||||
$value
|
$value
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1650,7 +1650,7 @@ function deleteNation(General $lord, bool $applyDB):array
|
|||||||
$nationID,
|
$nationID,
|
||||||
$lordID
|
$lordID
|
||||||
),
|
),
|
||||||
['gold', 'rice', 'experience', 'explevel', 'dedication', 'dedlevel'], 1
|
['npc', 'gold', 'rice', 'experience', 'explevel', 'dedication', 'dedlevel', 'aux'], 1
|
||||||
);
|
);
|
||||||
$oldNationGeneralList[$lordID] = $lord;
|
$oldNationGeneralList[$lordID] = $lord;
|
||||||
|
|
||||||
|
|||||||
@@ -1016,7 +1016,7 @@ function checkEmperior()
|
|||||||
return "{$arr['name']}【{$number}】";
|
return "{$arr['name']}【{$number}】";
|
||||||
}, $eagles));
|
}, $eagles));
|
||||||
|
|
||||||
$rawGeneralList = $db->query('SELECT no, name, npc, owner FROM general WHERE nation=%i ORDER BY dedication DESC');
|
$rawGeneralList = $db->query('SELECT no, name, npc, owner FROM general WHERE nation=%i ORDER BY dedication DESC', $nationID);
|
||||||
foreach ($rawGeneralList as $rawGeneral) {
|
foreach ($rawGeneralList as $rawGeneral) {
|
||||||
$generalLogger = new ActionLogger($rawGeneral['no'], $nationID, $admin['year'], $admin['month']);
|
$generalLogger = new ActionLogger($rawGeneral['no'], $nationID, $admin['year'], $admin['month']);
|
||||||
$generalLogger->pushGeneralActionLog("<D><b>{$nation['name']}</b></>{$josaYi} 전토를 통일하였습니다.", ActionLogger::YEAR_MONTH);
|
$generalLogger->pushGeneralActionLog("<D><b>{$nation['name']}</b></>{$josaYi} 전토를 통일하였습니다.", ActionLogger::YEAR_MONTH);
|
||||||
|
|||||||
+1
-3
@@ -558,9 +558,7 @@ function ConquerCity(array $admin, General $general, array $city) {
|
|||||||
$cmd = buildGeneralCommandClass('che_임관', $oldGeneral, $admin, [
|
$cmd = buildGeneralCommandClass('che_임관', $oldGeneral, $admin, [
|
||||||
'destNationID'=>$attackerNationID
|
'destNationID'=>$attackerNationID
|
||||||
]);
|
]);
|
||||||
if($cmd->hasFullConditionMet()){
|
_setGeneralCommand($cmd, [0]);
|
||||||
_setGeneralCommand($cmd, [0]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,13 +23,14 @@ class che_견고 extends \sammo\BaseSpecial{
|
|||||||
|
|
||||||
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new che_부상무효($unit, BaseWarUnitTrigger::TYPE_NONE)
|
new che_부상무효($unit, BaseWarUnitTrigger::TYPE_NONE),
|
||||||
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '저격불가')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '필살불가', '위압불가', '격노불가', '계략약화')
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '필살불가', '위압불가', '격노불가', '계략약화', '저격불가')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class che_국기변경 extends Command\NationCommand
|
|||||||
ConstraintHelper::OccupiedCity(),
|
ConstraintHelper::OccupiedCity(),
|
||||||
ConstraintHelper::BeChief(),
|
ConstraintHelper::BeChief(),
|
||||||
ConstraintHelper::SuppliedCity(),
|
ConstraintHelper::SuppliedCity(),
|
||||||
ConstraintHelper::ReqNationAuxValue("can_{$actionName}", null, '>', 0, '더이상 변경이 불가능합니다.')
|
ConstraintHelper::ReqNationAuxValue("can_{$actionName}", 0, '>', 0, '더이상 변경이 불가능합니다.')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ class che_국기변경 extends Command\NationCommand
|
|||||||
ConstraintHelper::OccupiedCity(),
|
ConstraintHelper::OccupiedCity(),
|
||||||
ConstraintHelper::BeChief(),
|
ConstraintHelper::BeChief(),
|
||||||
ConstraintHelper::SuppliedCity(),
|
ConstraintHelper::SuppliedCity(),
|
||||||
ConstraintHelper::ReqNationAuxValue("can_{$actionName}", null, '>', 0, '더이상 변경이 불가능합니다.')
|
ConstraintHelper::ReqNationAuxValue("can_{$actionName}", 0, '>', 0, '더이상 변경이 불가능합니다.')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ use \sammo\DB;
|
|||||||
use \sammo\GameConst;
|
use \sammo\GameConst;
|
||||||
use \sammo\Util;
|
use \sammo\Util;
|
||||||
use \sammo\KVStorage;
|
use \sammo\KVStorage;
|
||||||
|
use \sammo\Json;
|
||||||
use function \sammo\getNationChiefLevel;
|
use function \sammo\getNationChiefLevel;
|
||||||
|
|
||||||
class Nation{
|
class Nation{
|
||||||
@@ -86,6 +87,14 @@ class Nation{
|
|||||||
$nationStor = KVStorage::getStorage($db, $this->id, 'nation_env');
|
$nationStor = KVStorage::getStorage($db, $this->id, 'nation_env');
|
||||||
$otherNations = $db->queryFirstColumn('SELECT nation FROM nation');
|
$otherNations = $db->queryFirstColumn('SELECT nation FROM nation');
|
||||||
|
|
||||||
|
$aux = [
|
||||||
|
'can_국기변경'=>1
|
||||||
|
];
|
||||||
|
|
||||||
|
if($this->nationLevel==7){
|
||||||
|
$aux['can_국호변경']=1;
|
||||||
|
}
|
||||||
|
|
||||||
$db->insert('nation', [
|
$db->insert('nation', [
|
||||||
'nation'=>$this->id,
|
'nation'=>$this->id,
|
||||||
'name'=>$this->name,
|
'name'=>$this->name,
|
||||||
@@ -103,6 +112,7 @@ class Nation{
|
|||||||
'tech'=>$this->tech,
|
'tech'=>$this->tech,
|
||||||
'level'=>$this->nationLevel,
|
'level'=>$this->nationLevel,
|
||||||
'type'=>$type,
|
'type'=>$type,
|
||||||
|
'aux'=>Json::encode($aux),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if($cities){
|
if($cities){
|
||||||
|
|||||||
+3
-3
@@ -267,13 +267,13 @@ ENGINE=Aria;
|
|||||||
## 명전 테이블
|
## 명전 테이블
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `ng_hall` (
|
CREATE TABLE IF NOT EXISTS `hall` (
|
||||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||||
`server_id` CHAR(20) NOT NULL,
|
`server_id` CHAR(20) NOT NULL,
|
||||||
`season` INT(11) NOT NULL,
|
`season` INT(11) NOT NULL,
|
||||||
`scenario` INT(11) NOT NULL,
|
`scenario` INT(11) NOT NULL,
|
||||||
`general_no` INT(11) NOT NULL,
|
`general_no` INT(11) NOT NULL,
|
||||||
`type` INT(11) NOT NULL,
|
`type` VARCHAR(20) NOT NULL,
|
||||||
`value` DOUBLE NOT NULL,
|
`value` DOUBLE NOT NULL,
|
||||||
`owner` INT(11) NULL DEFAULT NULL,
|
`owner` INT(11) NULL DEFAULT NULL,
|
||||||
`aux` LONGTEXT NOT NULL DEFAULT '{}' CHECK (json_valid(`aux`)),
|
`aux` LONGTEXT NOT NULL DEFAULT '{}' CHECK (json_valid(`aux`)),
|
||||||
@@ -283,7 +283,7 @@ CREATE TABLE IF NOT EXISTS `ng_hall` (
|
|||||||
INDEX `server_show` (`server_id`, `type`, `value`),
|
INDEX `server_show` (`server_id`, `type`, `value`),
|
||||||
INDEX `scenario` (`season`, `scenario`, `type`, `value`)
|
INDEX `scenario` (`season`, `scenario`, `type`, `value`)
|
||||||
)
|
)
|
||||||
ENGINE=Aria DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPRESSED;
|
ENGINE=Aria DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user