diff --git a/hwe/_admin8.php b/hwe/_admin8.php index 344c7749..d4335ec4 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 e2eb0ca7..77a805c2 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 = date('Y-m-d H:i:s'); - $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/c_double.php b/hwe/c_double.php index 632f04b7..b9e3ac79 100644 --- a/hwe/c_double.php +++ b/hwe/c_double.php @@ -93,11 +93,6 @@ if($command == 61) { $me = MYDB_fetch_array($result); if($me['level'] >= 5) { - $note = StringUtil::neutralize($note, 90); - - $query = "update diplomacy set reserved='{$note}' where me='{$me['nation']}' and you='$double'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $count = count($turn); $str = "type=type"; for($i=0; $i < $count; $i++) { diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index 555cc256..33248ccc 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -605,11 +605,6 @@ function process_61(&$general) { $validMinutes = max(30, $turnterm*3); $validUntil->add(new \DateInterval("PT{$validMinutes}M")); - //FIXME: 현재 command가 숫자로만 이루어져 있어서 문자열을 처리할 수 없다. - //XXX: 으악. - //TODO: 커맨드 처리 방식을 json으로 변경 - $option = $db->queryFirstField('SELECT reserved FROM diplomacy WHERE me=%i AND you=%i', $src->nationID, $dest->nationID); - $msg = new DiplomaticMessage( Message::MSGTYPE_DIPLOMACY, $src, @@ -619,19 +614,11 @@ function process_61(&$general) { $validUntil, [ 'action'=>DiplomaticMessage::TYPE_NO_AGGRESSION, - 'year'=>$when, - 'option'=>$option + 'year'=>$when ] ); $msg->send(); - //NOTE: 현재 내무부 외교란의 비고는 diplomacy가 기준이니까 유지할 필요는 있다. - //FIXME: 외교란도 message란의 diplomacy를 참조하든가 하도록. - $db->update('diplomacy', [ - 'showing'=>$validUntil->format('Y-m-d H:i:s') - ], 'me=%i AND you=%i', $src->nationID, $dest->nationID); - // 3턴후 - pushGenLog($general, ["●{$month}월:{$destNation['name']}으로 불가침 제의 서신을 보냈습니다.<1>$date"]); } diff --git a/hwe/processing.php b/hwe/processing.php index 1729eb2f..169d1d84 100644 --- a/hwe/processing.php +++ b/hwe/processing.php @@ -1739,7 +1739,6 @@ function command_61($turn, $command) { 타국에게 불가침을 제의합니다.
제의할 국가를 목록에서 선택하세요.
배경색은 현재 제의가 불가능한 국가는 붉은색, 현재 불가침중인 국가는 푸른색으로 표시됩니다.
-비고는 불가침시 세부 조건등을 지정하는 곳입니다.(최대 45자) ※유저 편의를 위한 것일뿐 시스템적으로 보장하지는 않습니다.
대상 국가
-비고 : "; for($i=0; $i < count($turn); $i++) { 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 175e500b..bd931ee7 100644 --- a/hwe/sql/schema.sql +++ b/hwe/sql/schema.sql @@ -644,8 +644,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`), @@ -656,17 +654,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;