버그 수정

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