diff --git a/hwe/sammo/API/NationCommand/ReserveBulkCommand.php b/hwe/sammo/API/NationCommand/ReserveBulkCommand.php new file mode 100644 index 00000000..b8da199d --- /dev/null +++ b/hwe/sammo/API/NationCommand/ReserveBulkCommand.php @@ -0,0 +1,76 @@ +args as $idx => $turn) { + $v = new Validator($turn); + $v->rule('required', [ + 'action', + 'turnList' + ]) + ->rule('lengthMin', 'action', 1) + ->rule('integerArray', 'turnList'); + + if (!$v->validate()) { + return "{$idx}:{$v->errorStr()}"; + } + } + + return null; + } + + public function getRequiredSessionMode(): int + { + return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY; + } + + public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag) + { + $briefList = []; + foreach ($this->args as $idx => $turn) { + $action = $turn['action']; + $turnList = $turn['turnList']; + $arg = $turn['arg'] ?? []; + + if (!$turnList) { + return "{$idx}: 턴이 입력되지 않았습니다"; + } + + if (!in_array($action, Util::array_flatten(GameConst::$availableChiefCommand))) { + return "{$idx}: 사용할 수 없는 커맨드입니다."; + } + + if (!is_array($arg)) { + return "{$idx}: 올바른 arg 형태가 아닙니다."; + } + $partialResult = setNationCommand($session->generalID, $turnList, $action, $arg); + if(!$partialResult['result']){ + return [ + 'result' => false, + 'briefList' => $briefList, + 'errorIdx' => $idx, + 'reason' => $partialResult['reason'] + ]; + } + $briefList[$idx] = $partialResult['brief']; + } + + return [ + 'result' => true, + 'briefList' => $briefList, + 'reason' => 'success' + ]; + } +} diff --git a/hwe/scss/chiefCenter.scss b/hwe/scss/chiefCenter.scss index f340adaa..dab8b4da 100644 --- a/hwe/scss/chiefCenter.scss +++ b/hwe/scss/chiefCenter.scss @@ -31,11 +31,16 @@ $modcolor2: color.adjust($nbase2color, $lightness: -5%); line-height: 30px; } + .time_pad.inverted{ + background-color: gray; + color: white; + } + .turn_pad { line-height: 30px; } - .row:nth-child(odd) .turn_pad { + .row:nth-of-type(odd) .turn_pad { background-color: $modcolor2; } } @@ -83,7 +88,7 @@ $modcolor2: color.adjust($nbase2color, $lightness: -5%); } .commandBox .controlPad { - .turn_pad:nth-child(2n) { + .turn_pad:nth-of-type(even) { background-color: $modcolor2; } } @@ -109,7 +114,6 @@ $modcolor2: color.adjust($nbase2color, $lightness: -5%); width: 500px; height: 460px; margin: auto; - overflow: hidden; } #mainTable { @@ -131,7 +135,7 @@ $modcolor2: color.adjust($nbase2color, $lightness: -5%); .commandBox .controlPad { margin-top: 10px; - .turn_pad:nth-child(even) { + .turn_pad:nth-of-type(even) { background-color: $modcolor2; } } @@ -145,7 +149,7 @@ $modcolor2: color.adjust($nbase2color, $lightness: -5%); overflow: hidden; - .turn_pad:nth-child(even) { + .turn_pad:nth-of-type(even) { background-color: $modcolor2; } } diff --git a/hwe/ts/ChiefCenter/TopItem.vue b/hwe/ts/ChiefCenter/TopItem.vue index e1c9af4c..8e3fe4bd 100644 --- a/hwe/ts/ChiefCenter/TopItem.vue +++ b/hwe/ts/ChiefCenter/TopItem.vue @@ -1,88 +1,170 @@ - diff --git a/hwe/ts/PageChiefCenter.vue b/hwe/ts/PageChiefCenter.vue index e549eafa..396796ac 100644 --- a/hwe/ts/PageChiefCenter.vue +++ b/hwe/ts/PageChiefCenter.vue @@ -7,10 +7,7 @@ v-if="chiefList !== undefined" :class="`${targetIsMe ? 'targetIsMe' : 'targetIsNotMe'}`" > -