버그 1차 수정

This commit is contained in:
2018-11-26 00:03:11 +09:00
parent 130d079c90
commit 0813f48fce
21 changed files with 71 additions and 34 deletions
+7 -2
View File
@@ -80,10 +80,15 @@ case "쌀지급":
processRiceIncome(); processRiceIncome();
break; break;
case "락걸기": case "락걸기":
$db->update('plock', ['plock'=>1], true); $db->update('plock', [
'plock'=>1,
'locktime'=>TimeUtil::now(true)
], true);
break; break;
case "락풀기": case "락풀기":
$db->update('plock', ['plock'=>0], true); $db->update('plock', [
'plock'=>0
], true);
break; break;
} }
+4 -1
View File
@@ -1548,7 +1548,10 @@ function checkTurn() {
if($gameStor->isunited == 2) { if($gameStor->isunited == 2) {
$db->update('plock', ['plock'=>1], true); $db->update('plock', [
'plock'=>1,
'locktime'=>TimeUtil::now(true)
], true);
return; return;
} }
$gameStor->cacheAll(); $gameStor->cacheAll();
@@ -3,6 +3,7 @@ namespace sammo\ActionNationType;
use \sammo\iAction; use \sammo\iAction;
use \sammo\General; use \sammo\General;
use \sammo\GeneralTrigger; use \sammo\GeneralTrigger;
use \sammo\GeneralTriggerCaller;
class che_의술_청낭서 extends \sammo\BaseItem{ class che_의술_청낭서 extends \sammo\BaseItem{
@@ -2,6 +2,8 @@
namespace sammo\ActionNationType; namespace sammo\ActionNationType;
use \sammo\iAction; use \sammo\iAction;
use \sammo\General; use \sammo\General;
use \sammo\GeneralTrigger;
use \sammo\GeneralTriggerCaller;
class che_의술_태평청령 extends \sammo\BaseItem{ class che_의술_태평청령 extends \sammo\BaseItem{
@@ -3,6 +3,7 @@ namespace sammo\ActionNationType;
use \sammo\iAction; use \sammo\iAction;
use \sammo\General; use \sammo\General;
use \sammo\GeneralTrigger; use \sammo\GeneralTrigger;
use \sammo\GeneralTriggerCaller;
class che_치료_도소연명 extends \sammo\BaseItem{ class che_치료_도소연명 extends \sammo\BaseItem{
@@ -3,6 +3,7 @@ namespace sammo\ActionNationType;
use \sammo\iAction; use \sammo\iAction;
use \sammo\General; use \sammo\General;
use \sammo\GeneralTrigger; use \sammo\GeneralTrigger;
use \sammo\GeneralTriggerCaller;
class che_치료_무후행군 extends \sammo\BaseItem{ class che_치료_무후행군 extends \sammo\BaseItem{
@@ -3,6 +3,7 @@ namespace sammo\ActionNationType;
use \sammo\iAction; use \sammo\iAction;
use \sammo\General; use \sammo\General;
use \sammo\GeneralTrigger; use \sammo\GeneralTrigger;
use \sammo\GeneralTriggerCaller;
class che_치료_오석산 extends \sammo\BaseItem{ class che_치료_오석산 extends \sammo\BaseItem{
@@ -3,6 +3,7 @@ namespace sammo\ActionNationType;
use \sammo\iAction; use \sammo\iAction;
use \sammo\General; use \sammo\General;
use \sammo\GeneralTrigger; use \sammo\GeneralTrigger;
use \sammo\GeneralTriggerCaller;
class che_치료_정력견혈 extends \sammo\BaseItem{ class che_치료_정력견혈 extends \sammo\BaseItem{
@@ -3,6 +3,7 @@ namespace sammo\ActionNationType;
use \sammo\iAction; use \sammo\iAction;
use \sammo\General; use \sammo\General;
use \sammo\GeneralTrigger; use \sammo\GeneralTrigger;
use \sammo\GeneralTriggerCaller;
class che_치료_칠엽청점 extends \sammo\BaseItem{ class che_치료_칠엽청점 extends \sammo\BaseItem{
@@ -3,6 +3,7 @@ namespace sammo\ActionNationType;
use \sammo\iAction; use \sammo\iAction;
use \sammo\General; use \sammo\General;
use \sammo\GeneralTrigger; use \sammo\GeneralTrigger;
use \sammo\GeneralTriggerCaller;
class che_치료_환약 extends \sammo\BaseItem{ class che_치료_환약 extends \sammo\BaseItem{
@@ -0,0 +1,18 @@
<?php
namespace sammo\ActionSpecialDomestic;
use \sammo\iAction;
use \sammo\General;
use \sammo\SpecialityConst;
class che_거상 implements iAction{
use \sammo\DefaultAction;
static $id = 999;
static $name = '거상';
static $info = '<비활성화>';
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
static $selectWeight = 0;
static $type = [];
}
@@ -4,7 +4,7 @@ use \sammo\iAction;
use \sammo\General; use \sammo\General;
use \sammo\SpecialityConst; use \sammo\SpecialityConst;
class che_통찰 implements iAction{ class che_인덕 implements iAction{
use \sammo\DefaultAction; use \sammo\DefaultAction;
static $id = 20; static $id = 20;
+1 -1
View File
@@ -4,7 +4,7 @@ use \sammo\iAction;
use \sammo\General; use \sammo\General;
use \sammo\SpecialityConst; use \sammo\SpecialityConst;
class che_신중 implements iAction{ class che_반계 implements iAction{
use \sammo\DefaultAction; use \sammo\DefaultAction;
static $id = 45; static $id = 45;
+4 -2
View File
@@ -1,9 +1,11 @@
<?php <?php
namespace sammo\ActionSpecialWar; namespace sammo\ActionSpecialWar;
use \sammo\iAction;
use sammo\BaseGeneralTrigger; use sammo\BaseGeneralTrigger;
use sammo\SpecialityConst; use sammo\SpecialityConst;
use sammo\GeneralTriggerCaller; use \sammo\General;
use sammo\GeneralTrigger; use \sammo\GeneralTrigger;
use \sammo\GeneralTriggerCaller;
class che_의술 implements iAction{ class che_의술 implements iAction{
use \sammo\DefaultAction; use \sammo\DefaultAction;
+7 -2
View File
@@ -422,6 +422,11 @@ class General implements iAction{
return $value; return $value;
} }
public function onCalcStat(General $general, string $stat, $value){
//xxx: $general?
return $value;
}
public function onCalcStrategic(string $turnType, string $varType, $value){ public function onCalcStrategic(string $turnType, string $varType, $value){
foreach(array_merge([ foreach(array_merge([
$this->nationType, $this->nationType,
@@ -477,7 +482,7 @@ class General implements iAction{
} }
return [$att, $def]; return [$att, $def];
} }
public function getBattleInitSkillTriggerList(WarUnit $unit):array{ public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
$caller = new WarUnitTriggerCaller(); $caller = new WarUnitTriggerCaller();
foreach(array_merge([ foreach(array_merge([
$this->nationType, $this->nationType,
@@ -498,7 +503,7 @@ class General implements iAction{
} }
return $caller; return $caller;
} }
public function getBattlePhaseSkillTriggerList(WarUnit $unit):array{ public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
$caller = new WarUnitTriggerCaller(); $caller = new WarUnitTriggerCaller();
foreach(array_merge([ foreach(array_merge([
$this->nationType, $this->nationType,
+2 -1
View File
@@ -161,7 +161,8 @@ class ResetHelper{
$db = DB::db(); $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
$db->insert('plock', [ $db->insert('plock', [
'plock'=>1 'plock'=>1,
'locktime'=>TimeUtil::now(true)
]); ]);
CityConst::build(); CityConst::build();
+3 -9
View File
@@ -112,7 +112,7 @@ class NPC{
$this->charDomestic = SpecialityConst::pickSpecialDomestic($general); $this->charDomestic = SpecialityConst::pickSpecialDomestic($general);
} }
} }
else if($char !== null){ else if($char === null){
} }
else{ else{
//TODO: 내특, 전특 구분 필요 //TODO: 내특, 전특 구분 필요
@@ -121,9 +121,9 @@ class NPC{
$domesticClass = \sammo\getGeneralSpecialDomesticClass($char); $domesticClass = \sammo\getGeneralSpecialDomesticClass($char);
$this->charDomestic = Util::getClassName($domesticClass); $this->charDomestic = Util::getClassName($domesticClass);
} }
catch (Exception $e) { catch (\Exception $e) {
$warClass = \sammo\getGeneralSpecialWarClass($char); $warClass = \sammo\getGeneralSpecialWarClass($char);
$this->charWar = Util::getClassName($domesticClass); $this->charWar = Util::getClassName($warClass);
} }
} }
} }
@@ -230,12 +230,6 @@ class NPC{
if($duplicateCnt > 1){ if($duplicateCnt > 1){
$name = "{$name}($duplicateCnt}"; $name = "{$name}($duplicateCnt}";
} }
$this->realName = $name;
$query = "select no from general where name like '{$name}%'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
$count++;
$this->realName = $name; $this->realName = $name;
+3 -3
View File
@@ -380,7 +380,7 @@
[0, "큐어 하트", null, 0, null, 93, 90, 95, 0, 160, 300, null, "위압"], [0, "큐어 하트", null, 0, null, 93, 90, 95, 0, 160, 300, null, "위압"],
[0, "큐어 다이아몬드", null, 0, null, 86, 88, 90, 0, 160, 300, null, null], [0, "큐어 다이아몬드", null, 0, null, 86, 88, 90, 0, 160, 300, null, null],
[0, "큐어 로제타", null, 0, null, 80, 80, 85, 0, 160, 300, null, "상재"], [0, "큐어 로제타", null, 0, null, 80, 80, 85, 0, 160, 300, null, "상재"],
[0, "큐어소드", null, 0, null, 79, 87, 82, 0, 160, 300, null, "사"], [0, "큐어소드", null, 0, null, 79, 87, 82, 0, 160, 300, null, "사"],
[0, "큐어에이스", null, 0, null, 75, 83, 77, 0, 160, 300, null, null], [0, "큐어에이스", null, 0, null, 75, 83, 77, 0, 160, 300, null, null],
[0, "하세가와스바루", null, 0, null, 86, 77, 80, 0, 160, 300, null, null, "정말 초등학생은 최고야!!"], [0, "하세가와스바루", null, 0, null, 86, 77, 80, 0, 160, 300, null, null, "정말 초등학생은 최고야!!"],
[0, "토모카", null, 0, null, 70, 64, 82, 0, 160, 300, null, null, "잘부탁 드려요 하세가와 코치님!"], [0, "토모카", null, 0, null, 70, 64, 82, 0, 160, 300, null, null, "잘부탁 드려요 하세가와 코치님!"],
@@ -425,14 +425,14 @@
[0, "노기소노코", null, 0, null, 81, 81, 78, 0, 160, 300, null, null], [0, "노기소노코", null, 0, null, 81, 81, 78, 0, 160, 300, null, null],
[0, "미노와긴", null, 0, null, 83, 87, 67, 0, 160, 300, null, null], [0, "미노와긴", null, 0, null, 83, 87, 67, 0, 160, 300, null, null],
[0, "아키선생님", null, 0, null, 85, 39, 88, 0, 160, 300, null, "귀모"], [0, "아키선생님", null, 0, null, 85, 39, 88, 0, 160, 300, null, "귀모"],
[0, "신수", null, 0, null, 97, 69, 99, 0, 160, 300, null, "집"], [0, "신수", null, 0, null, 97, 69, 99, 0, 160, 300, null, "집"],
[0, "노기와카바", null, 0, null, 87, 85, 79, 0, 160, 300, null, null], [0, "노기와카바", null, 0, null, 87, 85, 79, 0, 160, 300, null, null],
[0, "우에사토히나타", null, 0, null, 80, 19, 85, 0, 160, 300, null, "귀모"], [0, "우에사토히나타", null, 0, null, 80, 19, 85, 0, 160, 300, null, "귀모"],
[0, "이요지마안즈", null, 0, null, 76, 88, 86, 0, 160, 295, null, "저격"], [0, "이요지마안즈", null, 0, null, 76, 88, 86, 0, 160, 295, null, "저격"],
[0, "도이타마코", null, 0, null, 72, 89, 37, 0, 160, 300, null, "견고"], [0, "도이타마코", null, 0, null, 72, 89, 37, 0, 160, 300, null, "견고"],
[0, "코오리치카게", null, 0, null, 67, 90, 83, 0, 160, 300, null, null], [0, "코오리치카게", null, 0, null, 67, 90, 83, 0, 160, 300, null, null],
[0, "타카시마유우나", null, 0, null, 72, 88, 75, 0, 160, 300, null, null, "군짱, 그러면 안되."], [0, "타카시마유우나", null, 0, null, 72, 88, 75, 0, 160, 300, null, null, "군짱, 그러면 안되."],
[0, "우타노", null, 0, null, 71, 83, 67, 0, 160, 300, null, "농업"], [0, "우타노", null, 0, null, 71, 83, 67, 0, 160, 300, null, "경작"],
[0, "후지모리미토", null, 0, null, 70, 15, 81, 0, 160, 300, null, null], [0, "후지모리미토", null, 0, null, 70, 15, 81, 0, 160, 300, null, null],
[0, "키리토", null, 0, null, 85, 91, 80, 0, 160, 300, null, "무쌍", "스타…버스트!!!...스트림!!!!!"], [0, "키리토", null, 0, null, 85, 91, 80, 0, 160, 300, null, "무쌍", "스타…버스트!!!...스트림!!!!!"],
[0, "아스나", null, 0, null, 94, 89, 87, 0, 160, 300, null, "무쌍", "내…이름…어떻게 안거야??"], [0, "아스나", null, 0, null, 94, 89, 87, 0, 160, 300, null, "무쌍", "내…이름…어떻게 안거야??"],
+5 -5
View File
@@ -1,9 +1,9 @@
# #
DROP TABLE IF EXISTS general; DROP TABLE IF EXISTS general;
DROP TABLE IF EXISTS `general_turn`;
# #
DROP TABLE IF EXISTS nation; DROP TABLE IF EXISTS nation;
DROP TABLE IF EXISTS `nation_turn`;
# #
DROP TABLE IF EXISTS city; DROP TABLE IF EXISTS city;
@@ -41,6 +41,8 @@ DROP TABLE IF EXISTS world_history;
# ( ?) # ( ?)
DROP TABLE IF EXISTS general_public_record; DROP TABLE IF EXISTS general_public_record;
DROP TABLE IF EXISTS select_npc_token;
DROP TABLE IF EXISTS reserved_open; DROP TABLE IF EXISTS reserved_open;
CREATE TABLE `reserved_open` ( CREATE TABLE `reserved_open` (
`id` INT(11) NOT NULL AUTO_INCREMENT, `id` INT(11) NOT NULL AUTO_INCREMENT,
@@ -50,6 +52,4 @@ CREATE TABLE `reserved_open` (
INDEX `date` (`date`) INDEX `date` (`date`)
) )
DEFAULT CHARSET=utf8mb4 DEFAULT CHARSET=utf8mb4
ENGINE=MyISAM; ENGINE=MyISAM;
DROP TABLE IF EXISTS select_npc_token;
+2 -2
View File
@@ -74,7 +74,7 @@ CREATE TABLE `general` (
`personal` INT(2) NULL DEFAULT '0', `personal` INT(2) NULL DEFAULT '0',
`special` VARCHAR(20) NOT NULL DEFAULT 'None', `special` VARCHAR(20) NOT NULL DEFAULT 'None',
`specage` INT(2) NULL DEFAULT '0', `specage` INT(2) NULL DEFAULT '0',
`special2` INT(2) NULL DEFAULT '0', `special2` VARCHAR(20) NOT NULL DEFAULT 'None',
`specage2` INT(2) NULL DEFAULT '0', `specage2` INT(2) NULL DEFAULT '0',
`mode` INT(1) NULL DEFAULT '2', `mode` INT(1) NULL DEFAULT '2',
`tnmt` INT(1) NULL DEFAULT '1', `tnmt` INT(1) NULL DEFAULT '1',
@@ -146,7 +146,7 @@ CREATE TABLE `general_turn` (
UNIQUE INDEX `general_id` (`general_id`, `turn_idx`), UNIQUE INDEX `general_id` (`general_id`, `turn_idx`),
INDEX `action` (`action`, `turn_idx`, `general_id`) INDEX `action` (`action`, `turn_idx`, `general_id`)
) )
COLLATE=utf8mb4 DEFAULT CHARSET=utf8mb4
ENGINE=MyISAM ENGINE=MyISAM
; ;
+5 -5
View File
@@ -58,7 +58,7 @@ class TimeUtil
return $obj->format('Y-m-d H:i:s.u'); return $obj->format('Y-m-d H:i:s.u');
} }
public static function secondsToDateTime(float $fullSeconds, bool $isDateTimeImmutable=false): \DateTime{ public static function secondsToDateTime(float $fullSeconds, bool $isDateTimeImmutable=false): \DateTimeInterface{
$seconds = floor($fullSeconds); $seconds = floor($fullSeconds);
$fraction = $fullSeconds - $seconds; $fraction = $fullSeconds - $seconds;
@@ -77,15 +77,15 @@ class TimeUtil
} }
public static function secondsToDateInterval(float $fullSeconds): \DateInterval{ public static function secondsToDateInterval(float $fullSeconds): \DateInterval{
$dateBase = new \DateTime("@0"); $d0 = new \DateTime("@0");
return static::secondsToDateTime($fullSeconds)->diff($d0); return static::secondsToDateTime($fullSeconds, true)->diff($d0);
} }
public static function DateTimeToSeconds(\DateTimeInterface $dateTime): float{ public static function DateTimeToSeconds(\DateTimeInterface $dateTime): float{
$dateBase = new \DateTimeImmutable("@0"); $d0 = new \DateTimeImmutable("@0");
return static::DateIntervalToSeconds($dateTime->diff($dateBase)); return static::DateIntervalToSeconds($dateTime->diff($d0));
} }
public static function DateIntervalToSeconds(\DateInterval $interval): float{ public static function DateIntervalToSeconds(\DateInterval $interval): float{