diff --git a/hwe/_admin8.php b/hwe/_admin8.php index a9f49525..c4297b36 100644 --- a/hwe/_admin8.php +++ b/hwe/_admin8.php @@ -73,7 +73,6 @@ $sel[$type] = "selected"; 국 가 명 상 태 기 간 - 비 고 {$dip['fixed']}"; - } - if ($dip['reserved'] != "" || $dip2['reserved'] != "") { - $note .= "
"; - } - } - if ($dip['reserved'] != "") { - if ($dip['showing'] >= $date) { - $note .= "아국측 제의: {$dip['reserved']}"; - } else { - $note .= "아국측 제의: {$dip['reserved']}"; - } - if ($dip2['reserved'] != "") { - $note .= "
"; - } - } - if ($dip2['reserved'] != "") { - if ($dip2['showing'] >= $date) { - $note .= "상대측 제의: {$dip2['reserved']}"; - } else { - $note .= "상대측 제의: {$dip2['reserved']}"; - } - } - if ($note == "") { - $note = " "; - } echo " @@ -153,7 +117,6 @@ for ($i=0; $i < $dipcount; $i++) { $nationName[$you] $state {$dip['term']} 개월 - {$note} "; } ?> diff --git a/hwe/b_dipcenter.php b/hwe/b_dipcenter.php index 64b8cbdd..8b10dd5d 100644 --- a/hwe/b_dipcenter.php +++ b/hwe/b_dipcenter.php @@ -106,19 +106,15 @@ for ($i=0; $i < $nationcount; $i++) { - - - - - "; continue; } - $query = "select state,term,fixed,reserved,showing from diplomacy where me='{$me['nation']}' and you='{$nation['nation']}'"; + $query = "select state,term from diplomacy where me='{$me['nation']}' and you='{$nation['nation']}'"; $result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), ""); $dip = MYDB_fetch_array($result2); - $query = "select reserved,showing from diplomacy where you='{$me['nation']}' and me='{$nation['nation']}'"; - $result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), ""); - $dip2 = MYDB_fetch_array($result2); //속령수 $query = "select city from city where nation='{$nation['nation']}'"; $result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), ""); @@ -144,33 +140,6 @@ for ($i=0; $i < $nationcount; $i++) { } $date = TimeUtil::now(); - $note = ""; - if ($dip['fixed'] != "") { - if ($dip['state'] == 7) { - $note .= $dip['fixed']; - } else { - $note .= "{$dip['fixed']}"; - } - if ($dip['reserved'] != "" || $dip2['reserved'] != "") { - $note .= "
"; - } - } - if ($dip['showing'] >= $date) { - if ($dip['reserved'] != "") { - $note .= "아국측 제의: ".$dip['reserved']; - if ($dip2['reserved'] != "") { - $note .= "
"; - } - } - } - if ($dip2['showing'] >= $date) { - if ($dip2['reserved'] != "") { - $note .= "상대측 제의: ".$dip2['reserved']; - } - } - if ($note == "") { - $note = " "; - } echo " @@ -188,9 +157,7 @@ for ($i=0; $i < $nationcount; $i++) { - -"; } - echo " - {$note} - "; + echo ""; } echo " diff --git a/hwe/processing.php b/hwe/processing.php index 1017e717..7073dbc5 100644 --- a/hwe/processing.php +++ b/hwe/processing.php @@ -1725,7 +1725,6 @@ function command_61($turn, $command) { 타국에게 불가침을 제의합니다.
제의할 국가를 목록에서 선택하세요.
배경색은 현재 제의가 불가능한 국가는 붉은색, 현재 불가침중인 국가는 푸른색으로 표시됩니다.
-비고는 불가침시 세부 조건등을 지정하는 곳입니다.(최대 45자) ※유저 편의를 위한 것일뿐 시스템적으로 보장하지는 않습니다.
대상 국가
-비고 : "; for($i=0; $i < count($turn); $i++) { diff --git a/hwe/sammo/Command/Nation/che_불가침제의.php b/hwe/sammo/Command/Nation/che_불가침제의.php index 6e35ee08..d91f4ca0 100644 --- a/hwe/sammo/Command/Nation/che_불가침제의.php +++ b/hwe/sammo/Command/Nation/che_불가침제의.php @@ -37,11 +37,6 @@ class che_불가침제의 extends Command\NationCommand{ return false; } - $optionText = $this->arg['optionText']??''; - if(!is_string($optionText)){ - return false; - } - if(!key_exists('year', $this->arg) || !key_exists('month', $this->arg) ){ return false; } @@ -61,7 +56,6 @@ class che_불가침제의 extends Command\NationCommand{ $this->arg = [ 'destNationID'=>$destNationID, - 'optionText'=>$optionText, 'year'=>$year, 'month'=>$month, ]; @@ -177,17 +171,10 @@ class che_불가침제의 extends Command\NationCommand{ 'action'=>DiplomaticMessage::TYPE_NO_AGGRESSION, 'year'=>$year, 'month'=>$month, - 'option'=>$this->arg['optionText'], ] ); $msg->send(); - //FIXME: 현재 내무부, 외교란이 구형 코드임. diplomacy_ticket을 이용하여 재구현 - $db->update('diplomacy', [ - 'showing'=>$validUntil->format('Y-m-d H:i:s'), - 'reserved'=>$this->arg['optionText'], - ], 'me=%i AND you=%i', $nationID, $destNationID); - $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->applyDB($db); $destGeneral->applyDB($db); diff --git a/hwe/sammo/DiplomaticMessage.php b/hwe/sammo/DiplomaticMessage.php index 491d323d..99db2e99 100644 --- a/hwe/sammo/DiplomaticMessage.php +++ b/hwe/sammo/DiplomaticMessage.php @@ -73,7 +73,6 @@ class DiplomaticMessage extends Message{ protected function noAggression(){ $year = Util::array_get($this->msgOption['year']); - $option = Util::array_get($this->msgOption['option'])??''; if($year < 1 || $year > 30){ return [self::INVALID, '올바르지 않은 불가침 서신입니다.']; } @@ -81,7 +80,7 @@ class DiplomaticMessage extends Message{ $this->diplomacyDetail = "{$year}년"; $helper = new Engine\Diplomacy($this->src->nationID, $this->dest->nationID); - $chk = $helper->noAggression($year, $option); + $chk = $helper->noAggression($year); if($chk[0] !== self::ACCEPTED){ return $chk; } @@ -284,13 +283,6 @@ class DiplomaticMessage extends Message{ list($result, $reason) = $this->checkDiplomaticMessageValidation($general); - $db->update('diplomacy', [ - 'reserved'=>'', - 'showing'=>null - ], '(me=%s AND you=%s) OR (you=%s AND me=%s)', - $this->src->nationID, $this->dest->nationID, - $this->src->nationID, $this->dest->nationID - ); if($result !== self::ACCEPTED){ pushGenLog(['no'=>$receiverID], ["●{$reason} {$this->diplomacyName} 실패."]); if($result === self::DECLINED){ diff --git a/hwe/sammo/Engine/Diplomacy.php b/hwe/sammo/Engine/Diplomacy.php index 29f418a0..f7487eac 100644 --- a/hwe/sammo/Engine/Diplomacy.php +++ b/hwe/sammo/Engine/Diplomacy.php @@ -273,7 +273,7 @@ class Diplomacy{ return $prev; } - public function noAggression(int $when, string $option){ + public function noAggression(int $when){ $chk = $this->checkValidNation(); $chk = $this->checkNotWar($chk); $chk = $this->checkAlreadyMerging($chk); @@ -286,8 +286,7 @@ class Diplomacy{ $db = DB::db(); $db->update('diplomacy',[ 'state'=>7, - 'term'=>$when*12, - 'fixed'=>$option + 'term'=>$when*12 ], '(me=%i AND you=%i) OR (you=%i AND me=%i)', $this->srcNation['nation'], $this->destNation['nation'], @@ -308,8 +307,7 @@ class Diplomacy{ $db = DB::db(); $db->update('diplomacy',[ 'state'=>2, - 'term'=>0, - 'fixed'=>'' + 'term'=>0 ], '(me=%i AND you=%i) OR (you=%i AND me=%i)', $this->srcNation['nation'], $this->destNation['nation'], @@ -330,8 +328,7 @@ class Diplomacy{ $db = DB::db(); $db->update('diplomacy',[ 'state'=>2, - 'term'=>0, - 'fixed'=>'' + 'term'=>0 ], '(me=%i AND you=%i) OR (you=%i AND me=%i)', $this->srcNation['nation'], $this->destNation['nation'], @@ -356,16 +353,14 @@ class Diplomacy{ $db = DB::db(); $db->update('diplomacy',[ 'state'=>4, - 'term'=>24, - 'fixed'=>'' + 'term'=>24 ], 'me=%i AND you=%i', $this->srcNation['nation'], $this->destNation['nation']); $db->update('diplomacy',[ 'state'=>3, - 'term'=>24, - 'fixed'=>'' + 'term'=>24 ], 'you=%i AND me=%i', $this->srcNation['nation'], $this->destNation['nation']); @@ -389,16 +384,14 @@ class Diplomacy{ $db = DB::db(); $db->update('diplomacy',[ 'state'=>6, - 'term'=>24, - 'fixed'=>'' + 'term'=>24 ], 'me=%i AND you=%i', $this->srcNation['nation'], $this->destNation['nation']); $db->update('diplomacy',[ 'state'=>5, - 'term'=>24, - 'fixed'=>'' + 'term'=>24 ], 'you=%i AND me=%i', $this->srcNation['nation'], $this->destNation['nation']); diff --git a/hwe/sql/schema.sql b/hwe/sql/schema.sql index 9e42d4b4..cec5397e 100644 --- a/hwe/sql/schema.sql +++ b/hwe/sql/schema.sql @@ -540,8 +540,6 @@ create table diplomacy ( `state` INT(6) NULL DEFAULT '0', `term` INT(6) NULL DEFAULT '0', `dead` INT(8) NULL DEFAULT '0', - `fixed` CHAR(128) NULL DEFAULT '', - `reserved` CHAR(128) NULL DEFAULT '', `showing` DATETIME NULL DEFAULT NULL, PRIMARY KEY (`no`), @@ -552,17 +550,17 @@ CREATE TABLE `ng_diplomacy` ( `no` INT(11) NOT NULL AUTO_INCREMENT, `src_nation_id` INT(11) NOT NULL, `dest_nation_id` INT(11) NOT NULL, - `group_id` INT(11) NOT NULL, - `revision` INT(11) NOT NULL DEFAULT '1', + `prev_no` INT(11) NULL DEFAULT NULL, `state` ENUM('proposed','activaed','cancelled') NOT NULL DEFAULT 'proposed', `text_brief` TEXT NOT NULL, `text_detail` TEXT NOT NULL, - `date` DATETIME NOT NULL, + `date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, `src_signer` INT(11) NOT NULL, `dest_signer` INT(11) NULL DEFAULT NULL, `aux` TEXT NULL DEFAULT NULL, PRIMARY KEY (`no`), - INDEX `by_group` (`src_nation_id`, `dest_nation_id`, `group_id`, `revision`) + INDEX `by_nation_src` (`src_nation_id`, `dest_nation_id`, `state`, `date`), + INDEX `by_nation_dest` (`dest_nation_id`, `src_nation_id`, `state`, `date`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;