diff --git a/hwe/sammo/API/General/Join.php b/hwe/sammo/API/General/Join.php index e0d3f795..731d81bc 100644 --- a/hwe/sammo/API/General/Join.php +++ b/hwe/sammo/API/General/Join.php @@ -75,6 +75,7 @@ class Join extends \sammo\BaseAPI if (!$v->validate()) { return $v->errorStr(); } + return null; } @@ -104,6 +105,10 @@ class Join extends \sammo\BaseAPI $inheritCity = $this->args['inheritCity'] ?? null; $inheritBonusStat = $this->args['inheritBonusStat'] ?? null; + if($inheritTurntime !== null && $inheritCity !== null){ + return '턴과 도시를 동시에 지정할 수 없습니다.'; + } + $rootDB = RootDB::db(); //회원 테이블에서 정보확인 $member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name`, imgsvr FROM member WHERE no=%i', $userID); diff --git a/hwe/ts/PageJoin.vue b/hwe/ts/PageJoin.vue index ea213caf..dd350a99 100644 --- a/hwe/ts/PageJoin.vue +++ b/hwe/ts/PageJoin.vue @@ -174,7 +174,7 @@
도시
-
@@ -346,7 +358,7 @@ watch(gameConstStore, (gameConst) => { total: gameConst.gameConst.defaultStatTotal, bonusMin: gameConst.gameConst.defaultStatMin, bonusMax: gameConst.gameConst.defaultStatMax, - } + }; args.value = { name: member.name, @@ -361,8 +373,6 @@ watch(gameConstStore, (gameConst) => { inheritSpecial: undefined, inheritTurntime: undefined, }; - - }); onMounted(async () => { @@ -466,6 +476,17 @@ watch(displayInherit, (newValue: boolean) => { localStorage.setItem(`conf.${serverID}.join.displayInherit`, JSON.stringify(newValue)); }); +const inheritCity = ref(); +watch(inheritCity, (newValue: undefined | number) => { + if (!args.value) throw "nyc"; + + if (!newValue) { + args.value.inheritCity = undefined; + return; + } + args.value.inheritCity = inheritCity.value; +}); + const inheritTurnTimeSet = ref(false); watch(inheritTurnTimeSet, (newValue: boolean) => { if (!args.value) throw "nyc"; @@ -477,6 +498,24 @@ watch(inheritTurnTimeSet, (newValue: boolean) => { args.value.inheritTurntime = inheritTurnTimeMinute.value * 60 + inheritTurnTimeSecond.value; }); +watch( + [inheritCity, inheritTurnTimeSet], + ([newInheritCity, newInheritTurnTimeSet], [oldInheritCity, oldInheritTurnTimeSet]) => { + if (newInheritCity === undefined || newInheritTurnTimeSet === false) { + return; + } + alert("도시와 턴 시간을 동시에 설정할 수 없습니다."); + + if (newInheritCity !== oldInheritCity) { + inheritCity.value = undefined; + } + if (newInheritTurnTimeSet !== oldInheritTurnTimeSet) { + inheritTurnTimeSet.value = false; + } + }, + { immediate: true } +); + const inheritTurnTimeMinute = ref(0); watch(inheritTurnTimeMinute, (newValue: number) => { if (!args.value) throw "nyc";