game,refac: 토너먼트 진행 시간을 턴 시간에 맞춤(최소 5초)
This commit is contained in:
+3
-3
@@ -23,8 +23,8 @@ $generalID = $session->generalID;
|
|||||||
|
|
||||||
$me = $db->queryFirstRow('SELECT no,tournament,con,turntime from general where owner=%i', $userID);
|
$me = $db->queryFirstRow('SELECT no,tournament,con,turntime from general where owner=%i', $userID);
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'develcost']);
|
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'turnterm', 'develcost']);
|
||||||
|
$turnTerm = $admin['turnterm'];
|
||||||
$con = checkLimit($me['con']);
|
$con = checkLimit($me['con']);
|
||||||
if ($con >= 2) {
|
if ($con >= 2) {
|
||||||
printLimitMsg($me['turntime']);
|
printLimitMsg($me['turntime']);
|
||||||
@@ -99,7 +99,7 @@ $str2 = getTournamentTime();
|
|||||||
if ($str2) {
|
if ($str2) {
|
||||||
$str2 = ', ' . $str2;
|
$str2 = ', ' . $str2;
|
||||||
}
|
}
|
||||||
$str3 = getTournamentTermText();
|
$str3 = getTournamentTermText($turnTerm);
|
||||||
if ($str3) {
|
if ($str3) {
|
||||||
$str3 = ', ' . $str3;
|
$str3 = ', ' . $str3;
|
||||||
}
|
}
|
||||||
|
|||||||
+67
-114
@@ -17,7 +17,8 @@ TurnExecutionHelper::executeAllCommand();
|
|||||||
$me = $db->queryFirstRow('select no,tournament,con,turntime from general where owner=%i', $userID);
|
$me = $db->queryFirstRow('select no,tournament,con,turntime from general where owner=%i', $userID);
|
||||||
$generalID = $session->generalID;
|
$generalID = $session->generalID;
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_msg', 'tnmt_type', 'develcost', 'tnmt_trig']);
|
$admin = $gameStor->getValues(['tournament', 'phase', 'turnterm', 'tnmt_msg', 'tnmt_type', 'develcost', 'tnmt_trig']);
|
||||||
|
$turnTerm = $admin['turnterm'];
|
||||||
|
|
||||||
$con = checkLimit($me['con']);
|
$con = checkLimit($me['con']);
|
||||||
if ($con >= 2) {
|
if ($con >= 2) {
|
||||||
@@ -120,128 +121,80 @@ $globalBetTotal = array_sum($globalBet);
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table align=center class='tb_layout bg0'>
|
<table align=center class='tb_layout bg0'>
|
||||||
<?php
|
<?php if ($session->userGrade >= 5) : ?>
|
||||||
if ($session->userGrade >= 5) {
|
<form method=post action=c_tournament.php>
|
||||||
$sel = [];
|
<tr>
|
||||||
echo "
|
<td colspan=8><input type=textarea size=150 style=color:white;background-color:black; name=msg><input type=submit name=btn value='메시지'></td>
|
||||||
<form method=post action=c_tournament.php>
|
</tr>
|
||||||
<tr><td colspan=8><input type=textarea size=150 style=color:white;background-color:black; name=msg><input type=submit name=btn value='메시지'></td></tr>
|
<tr>
|
||||||
<tr><td colspan=8>
|
<td colspan=8>
|
||||||
<input type=button value='갱신' onclick='location.reload()'>";
|
<input type=button value='갱신' onclick='location.reload()'>
|
||||||
|
<?php if ($admin['tournament'] == 0) : ?>
|
||||||
|
<select name=auto size=1 style=color:white;background-color:black;>
|
||||||
|
<option style=color:white; value=0 <?= !$admin['tnmt_trig'] ? 'selected' : '' ?>>수동진행</option>
|
||||||
|
<option style=color:white; value=1 <?= $admin['tnmt_trig'] ? 'selected' : '' ?>>자동진행</option>
|
||||||
|
</select>
|
||||||
|
<input type=submit name=btn value='자동개최설정'>
|
||||||
|
<?php else : ?>
|
||||||
|
<input type=submit name=btn value='중단' onclick='return confirm("진짜 중단하시겠습니까?")'>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
switch ($admin['tnmt_trig']) {
|
|
||||||
case 0:
|
|
||||||
$sel[0] = "selected";
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$sel[1] = "selected";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$sel[2] = "selected";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$sel[3] = "selected";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$sel[4] = "selected";
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
$sel[5] = "selected";
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
$sel[6] = "selected";
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
$sel[7] = "selected";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($admin['tournament'] == 0) {
|
<?php switch ($admin['tournament']) {
|
||||||
?>
|
case 1:
|
||||||
<select name=auto size=1 style=color:white;background-color:black;>
|
echo "<input type=submit name=btn value='랜덤투입'>";
|
||||||
<option style=color:white; value=0>수동진행</option>
|
echo "<input type=submit name=btn value='랜덤전부투입'>";
|
||||||
<option style=color:white; value=1>12분 05일</option>
|
break;
|
||||||
<option style=color:white; value=2>07분 10시</option>
|
case 2:
|
||||||
<option style=color:white; value=3>03분 04시</option>
|
echo "<input type=submit name=btn value='예선'><input type=submit name=btn value='예선전부'>";
|
||||||
<option style=color:white; value=4>01분 82분</option>
|
break;
|
||||||
<option style=color:white; value=5>30초 41분</option>
|
case 3:
|
||||||
<option style=color:white; value=6>15초 21분</option>
|
echo "<input type=submit name=btn value='추첨'><input type=submit name=btn value='추첨전부'>";
|
||||||
<option style=color:white; value=7>05초 07분</option>
|
break;
|
||||||
</select>
|
case 4:
|
||||||
<select name=type size=1 style=color:white;background-color:black;>
|
echo "<input type=submit name=btn value='본선'><input type=submit name=btn value='본선전부'>";
|
||||||
<option style=color:white; value=0>전력전</option>
|
break;
|
||||||
<option style=color:white; value=1>통솔전</option>
|
case 5:
|
||||||
<option style=color:white; value=2>일기토</option>
|
echo "<input type=submit name=btn value='배정'>";
|
||||||
<option style=color:white; value=3>설전</option>
|
break;
|
||||||
</select>
|
case 6:
|
||||||
<input type=submit name=btn value='개최'>
|
echo "<input type=submit name=btn value='베팅마감'>";
|
||||||
<select name=trig size=1 style=color:white;background-color:black;>
|
break;
|
||||||
<option style=color:white; value=0 <?= $sel[0] ?? '' ?>>수동진행</option>
|
case 7:
|
||||||
<option style=color:white; value=1 <?= $sel[1] ?? '' ?>>12분 05일</option>
|
echo "<input type=submit name=btn value='16강'>";
|
||||||
<option style=color:white; value=2 <?= $sel[2] ?? '' ?>>07분 10시</option>
|
break;
|
||||||
<option style=color:white; value=3 <?= $sel[3] ?? '' ?>>03분 04시</option>
|
case 8:
|
||||||
<option style=color:white; value=4 <?= $sel[4] ?? '' ?>>01분 82분</option>
|
echo "<input type=submit name=btn value='8강'>";
|
||||||
<option style=color:white; value=5 <?= $sel[5] ?? '' ?>>30초 41분</option>
|
break;
|
||||||
<option style=color:white; value=6 <?= $sel[6] ?? '' ?>>15초 21분</option>
|
case 9:
|
||||||
<option style=color:white; value=7 <?= $sel[7] ?? '' ?>>05초 07분</option>
|
echo "<input type=submit name=btn value='4강'>";
|
||||||
</select>
|
break;
|
||||||
<input type=submit name=btn value='자동개최설정'>
|
case 10:
|
||||||
<input type=submit name=btn value='포상'>
|
echo "<input type=submit name=btn value='결승'>";
|
||||||
<input type=submit name=btn value='회수'>
|
break;
|
||||||
<?php
|
} ?>
|
||||||
} else {
|
|
||||||
echo "<input type=submit name=btn value='중단' onclick='return confirm(\"진짜 중단하시겠습니까?\")'>";
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($admin['tournament']) {
|
</td>
|
||||||
case 1:
|
</tr>
|
||||||
echo "<input type=submit name=btn value='랜덤투입'>";
|
</form>
|
||||||
echo "<input type=submit name=btn value='랜덤전부투입'>";
|
<?php elseif ($me['no'] > 0 && $me['tournament'] == 0 && $admin['tournament'] == 1) : ?>
|
||||||
break;
|
<form method=post action=c_tournament.php>
|
||||||
case 2:
|
<tr>
|
||||||
echo "<input type=submit name=btn value='예선'><input type=submit name=btn value='예선전부'>";
|
<td colspan=8><input type=button value='갱신' onclick='location.reload()'><input type=submit name=btn value='참가' onclick='return confirm("참가비 금<?= $admin['develcost'] ?>이 필요합니다. 참가하시겠습니까?")'></td>
|
||||||
break;
|
</tr>
|
||||||
case 3:
|
</form>
|
||||||
echo "<input type=submit name=btn value='추첨'><input type=submit name=btn value='추첨전부'>";
|
<?php else : ?>
|
||||||
break;
|
<tr>
|
||||||
case 4:
|
<td colspan=8><input type=button value='갱신' onclick='location.reload()'></td>
|
||||||
echo "<input type=submit name=btn value='본선'><input type=submit name=btn value='본선전부'>";
|
</tr>
|
||||||
break;
|
<?php endif;
|
||||||
case 5:
|
|
||||||
echo "<input type=submit name=btn value='배정'>";
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
echo "<input type=submit name=btn value='베팅마감'>";
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
echo "<input type=submit name=btn value='16강'>";
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
echo "<input type=submit name=btn value='8강'>";
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
echo "<input type=submit name=btn value='4강'>";
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
echo "<input type=submit name=btn value='결승'>";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "
|
|
||||||
</td></tr>
|
|
||||||
</form>";
|
|
||||||
} elseif ($me['no'] > 0 && $me['tournament'] == 0 && $admin['tournament'] == 1) {
|
|
||||||
echo "<form method=post action=c_tournament.php><tr><td colspan=8><input type=button value='갱신' onclick='location.reload()'><input type=submit name=btn value='참가' onclick='return confirm(\"참가비 금{$admin['develcost']}이 필요합니다. 참가하시겠습니까?\")'></td></tr></form>";
|
|
||||||
} else {
|
|
||||||
echo "<tr><td colspan=8><input type=button value='갱신' onclick='location.reload()'></td></tr>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$str1 = getTournament($admin['tournament']);
|
$str1 = getTournament($admin['tournament']);
|
||||||
$str2 = getTournamentTime();
|
$str2 = getTournamentTime();
|
||||||
if ($str2) {
|
if ($str2) {
|
||||||
$str2 = ', ' . $str2;
|
$str2 = ', ' . $str2;
|
||||||
}
|
}
|
||||||
$str3 = getTournamentTermText();
|
$str3 = getTournamentTermText($turnTerm);
|
||||||
if ($str3) {
|
if ($str3) {
|
||||||
$str3 = ', ' . $str3;
|
$str3 = ', ' . $str3;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,11 +113,11 @@ if($session->userGrade < 5) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($btn == "자동개최설정") {
|
if($btn == "자동개최설정") {
|
||||||
$gameStor->tnmt_trig = $trig;
|
$gameStor->tnmt_trig = !!$trig;
|
||||||
} elseif($btn == "개최") {
|
} elseif($btn == "개최") {
|
||||||
startTournament($auto, $type);
|
startTournament($auto, $type);
|
||||||
} elseif($btn == "중단") {
|
} elseif($btn == "중단") {
|
||||||
$gameStor->tnmt_auto = 0;
|
$gameStor->tnmt_auto = false;
|
||||||
$gameStor->tournament = 0;
|
$gameStor->tournament = 0;
|
||||||
$gameStor->phase = 0;
|
$gameStor->phase = 0;
|
||||||
} elseif($btn == "랜덤투입") {
|
} elseif($btn == "랜덤투입") {
|
||||||
|
|||||||
+2
-2
@@ -1358,7 +1358,7 @@ function triggerTournament(RandUtil $rng)
|
|||||||
if ($tournament != 0) {
|
if ($tournament != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($tnmt_trig == 0) {
|
if (!$tnmt_trig) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!$rng->nextBool(0.4)) {
|
if (!$rng->nextBool(0.4)) {
|
||||||
@@ -1374,7 +1374,7 @@ function triggerTournament(RandUtil $rng)
|
|||||||
|
|
||||||
$tnmt_type = array_pop($tnmt_pattern);
|
$tnmt_type = array_pop($tnmt_pattern);
|
||||||
$gameStor->setValue('tnmt_pattern', $tnmt_pattern);
|
$gameStor->setValue('tnmt_pattern', $tnmt_pattern);
|
||||||
startTournament($tnmt_trig, $tnmt_type);
|
startTournament($tnmt_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
function CheckHall($no)
|
function CheckHall($no)
|
||||||
|
|||||||
+22
-77
@@ -5,17 +5,25 @@ namespace sammo;
|
|||||||
use sammo\DTO\BettingInfo;
|
use sammo\DTO\BettingInfo;
|
||||||
use sammo\Enums\InheritanceKey;
|
use sammo\Enums\InheritanceKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $turnTerm 서버 턴 단위
|
||||||
|
* @return int 토너먼트 초 단위
|
||||||
|
*/
|
||||||
|
function calcTournamentTerm(int $turnTerm): int{
|
||||||
|
return Util::valueFit($turnTerm, 5, 120);
|
||||||
|
}
|
||||||
|
|
||||||
function processTournament()
|
function processTournament()
|
||||||
{
|
{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'tnmt_auto', 'tnmt_time', 'last_tournament_betting_id']);
|
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'tnmt_auto', 'tnmt_time', 'turnterm', 'last_tournament_betting_id']);
|
||||||
$now = new \DateTime();
|
$now = new \DateTime();
|
||||||
$offset = $now->getTimestamp() - (new \DateTime($admin['tnmt_time']))->getTimestamp();
|
$offset = $now->getTimestamp() - (new \DateTime($admin['tnmt_time']))->getTimestamp();
|
||||||
|
|
||||||
//수동일땐 무시
|
//수동일땐 무시
|
||||||
if ($admin['tnmt_auto'] == 0) {
|
if (!$admin['tnmt_auto']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,18 +36,7 @@ function processTournament()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//현시간이 스탬프 지나친경우
|
//현시간이 스탬프 지나친경우
|
||||||
$unit = [
|
$unit = calcTournamentTerm($admin['turnterm']);
|
||||||
1 => 720,
|
|
||||||
2 => 420,
|
|
||||||
3 => 180,
|
|
||||||
4 => 60,
|
|
||||||
5 => 30,
|
|
||||||
6 => 15,
|
|
||||||
7 => 5,
|
|
||||||
][$admin['tnmt_auto']] ?? null;
|
|
||||||
if($unit === null){
|
|
||||||
throw new MustNotBeReachedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
//업데이트 횟수
|
//업데이트 횟수
|
||||||
$iter = intdiv($offset, $unit) + 1;
|
$iter = intdiv($offset, $unit) + 1;
|
||||||
@@ -123,10 +120,7 @@ function processTournament()
|
|||||||
|
|
||||||
//베팅은 무조건 60페이즈후 진행(최대 1시간)
|
//베팅은 무조건 60페이즈후 진행(최대 1시간)
|
||||||
if ($tnmt == 6) {
|
if ($tnmt == 6) {
|
||||||
$betTerm = $unit * 60;
|
$betTerm = Util::valueFit($unit * 60, null, 3600);
|
||||||
if ($betTerm > 3600) {
|
|
||||||
$betTerm = 3600;
|
|
||||||
}
|
|
||||||
//처리 초 더한 날짜
|
//처리 초 더한 날짜
|
||||||
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i + $betTerm);
|
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i + $betTerm);
|
||||||
$gameStor->tournament = $tnmt;
|
$gameStor->tournament = $tnmt;
|
||||||
@@ -134,20 +128,6 @@ function processTournament()
|
|||||||
$gameStor->tnmt_time = $dt;
|
$gameStor->tnmt_time = $dt;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($admin['tnmt_auto'] == 1) {
|
|
||||||
//처리 초 더한 날짜
|
|
||||||
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i);
|
|
||||||
$hr = substr($dt, 11, 2);
|
|
||||||
//지정시간대 넘어가면 중단 20~24시
|
|
||||||
if ($hr < 20) {
|
|
||||||
$dt = substr($dt, 0, 11) . "20:00:00";
|
|
||||||
$gameStor->tournament = $tnmt;
|
|
||||||
$gameStor->phase = $phase;
|
|
||||||
$gameStor->tnmt_time = $dt;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$second = $unit * $iter;
|
$second = $unit * $iter;
|
||||||
@@ -156,35 +136,9 @@ function processTournament()
|
|||||||
$gameStor->tnmt_time = (new \DateTimeImmutable($admin['tnmt_time']))->add(new \DateInterval("PT{$second}S"))->format('Y-m-d H:i:s');
|
$gameStor->tnmt_time = (new \DateTimeImmutable($admin['tnmt_time']))->add(new \DateInterval("PT{$second}S"))->format('Y-m-d H:i:s');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTournamentTerm(): ?int
|
function getTournamentTermText(int $turnTerm)
|
||||||
{
|
{
|
||||||
$db = DB::db();
|
$term = calcTournamentTerm($turnTerm);
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
|
||||||
|
|
||||||
$tnmt_auto = $gameStor->tnmt_auto;
|
|
||||||
if ($tnmt_auto === null) {
|
|
||||||
$tnmt_auto = $gameStor->tnmt_trig;
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
0 => null,
|
|
||||||
1 => 12 * 60,
|
|
||||||
2 => 7 * 60,
|
|
||||||
3 => 3 * 60,
|
|
||||||
4 => 1 * 60,
|
|
||||||
5 => 30,
|
|
||||||
6 => 15,
|
|
||||||
7 => 5,
|
|
||||||
][$tnmt_auto] ?? null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTournamentTermText()
|
|
||||||
{
|
|
||||||
$term = getTournamentTerm();
|
|
||||||
|
|
||||||
if ($term === null) {
|
|
||||||
return '수동';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($term % 60 === 0) {
|
if ($term % 60 === 0) {
|
||||||
$termMin = intdiv($term, 60);
|
$termMin = intdiv($term, 60);
|
||||||
@@ -320,26 +274,18 @@ function printFighting($tournament, $phase)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function startTournament($auto, $type)
|
function startTournament($type)
|
||||||
{
|
{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
|
||||||
eraseTnmtFightLogAll();
|
eraseTnmtFightLogAll();
|
||||||
|
|
||||||
$unit = [
|
$admin = $gameStor->getValues(['year', 'month', 'turnterm']);
|
||||||
1 => 60,
|
$turnTerm = $admin['turnterm'];
|
||||||
2 => 60,
|
$unit = calcTournamentTerm($turnTerm);
|
||||||
3 => 60,
|
|
||||||
4 => 60,
|
|
||||||
5 => 30,
|
|
||||||
6 => 15,
|
|
||||||
7 => 5,
|
|
||||||
][$auto] ?? 60;
|
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['year', 'month']);
|
$gameStor->tnmt_auto = true;
|
||||||
|
|
||||||
$gameStor->tnmt_auto = $auto;
|
|
||||||
$gameStor->tnmt_time = (new \DateTimeImmutable())->add(new \DateInterval("PT{$unit}M"))->format('Y-m-d H:i:s');
|
$gameStor->tnmt_time = (new \DateTimeImmutable())->add(new \DateInterval("PT{$unit}M"))->format('Y-m-d H:i:s');
|
||||||
$gameStor->tournament = 1;
|
$gameStor->tournament = 1;
|
||||||
$gameStor->tnmt_type = $type;
|
$gameStor->tnmt_type = $type;
|
||||||
@@ -392,7 +338,7 @@ function getDummyBettingInfo(string $tnmt_type): BettingInfo
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function startBetting($type, $unit)
|
function startBetting($type)
|
||||||
{
|
{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
@@ -431,7 +377,6 @@ function startBetting($type, $unit)
|
|||||||
aux: $general
|
aux: $general
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$candidateCnt = count($candidates);
|
|
||||||
|
|
||||||
Betting::openBetting(new BettingInfo(
|
Betting::openBetting(new BettingInfo(
|
||||||
id: $bettingID,
|
id: $bettingID,
|
||||||
@@ -982,7 +927,7 @@ function setGift($tnmt_type, $tnmt, $phase)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//자동진행 끝
|
//자동진행 끝
|
||||||
$gameStor->tnmt_auto = 0;
|
$gameStor->tnmt_auto = false;
|
||||||
|
|
||||||
//장수열전 기록
|
//장수열전 기록
|
||||||
/** @var ActionLogger */
|
/** @var ActionLogger */
|
||||||
@@ -1041,7 +986,7 @@ function setRefund()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//자동진행 끝
|
//자동진행 끝
|
||||||
$gameStor->tnmt_auto = 0;
|
$gameStor->tnmt_auto = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//10차이 1.1, 50 차이 1.17, 100차이 1.2
|
//10차이 1.1, 50 차이 1.17, 100차이 1.2
|
||||||
|
|||||||
+1
-1
@@ -190,7 +190,7 @@ if ($lastVoteID) {
|
|||||||
NPC선택 : <?= $npcmode ?>
|
NPC선택 : <?= $npcmode ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="s-border-t col py-2 col-4 col-md-2" style="color:<?= $color ?>;">
|
<div class="s-border-t col py-2 col-4 col-md-2" style="color:<?= $color ?>;">
|
||||||
토너먼트 : <?= getTournamentTermText() ?>
|
토너먼트 : <?= getTournamentTermText($gameStor->turnterm) ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="s-border-t col py-2 col-4 col-md-2" style="color:<?= $color ?>;">
|
<div class="s-border-t col py-2 col-4 col-md-2" style="color:<?= $color ?>;">
|
||||||
기타 설정: <?= $otherTextInfo ?>
|
기타 설정: <?= $otherTextInfo ?>
|
||||||
|
|||||||
+3
-9
@@ -194,17 +194,11 @@ if ($session->userGrade < 5 && !$allowReset) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="tournament_trig" class="col-sm-3 col-form-label"><span class="text-nowrap">토너먼트 자동 시작</span> <span class="text-nowrap">경기 단위</span></label>
|
<label for="tournament_trig" class="col-sm-3 col-form-label"><span class="text-nowrap">토너먼트 자동 시작</span></label>
|
||||||
<div class="col-sm-9" id="tournament_trig">
|
<div class="col-sm-9" id="tournament_trig">
|
||||||
<div id="tournament_trig" class="btn-group-toggle btn-group flex-wrap" data-bs-toggle="buttons">
|
<div id="tournament_trig" class="btn-group-toggle btn-group flex-wrap" data-bs-toggle="buttons">
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_0" name="tournament_trig" value="0"><label for="tournament_trig_0" class="btn btn-secondary w-25">안함</label>
|
<input type="radio" class="btn-check" id="tournament_trig_0" name="tournament_trig" value="0"><label for="tournament_trig_0" class="btn btn-secondary w-25">수동</label>
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_1" name="tournament_trig" value="1"><label for="tournament_trig_1" class="btn btn-secondary w-25">12분(총 5일)</label>
|
<input type="radio" class="btn-check" id="tournament_trig_1" name="tournament_trig" checked value="1"><label for="tournament_trig_1" class="btn btn-secondary w-25">자동</label>
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_2" name="tournament_trig" value="2"><label for="tournament_trig_2" class="btn btn-secondary w-25">7분(총 10시간)</label>
|
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_3" name="tournament_trig" value="3"><label for="tournament_trig_3" class="btn btn-secondary w-25">3분(총 4시간)</label>
|
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_4" name="tournament_trig" value="4" checked><label for="tournament_trig_4" class="btn btn-secondary w-25">1분(총 82분)</label>
|
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_5" name="tournament_trig" value="5"><label for="tournament_trig_5" class="btn btn-secondary w-25">30초(총 41분)</label>
|
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_6" name="tournament_trig" value="6"><label for="tournament_trig_6" class="btn btn-secondary w-25">15초(총 21분)</label>
|
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_7" name="tournament_trig" value="7"><label for="tournament_trig_7" class="btn btn-secondary w-25">5초(총 7분)</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+2
-2
@@ -56,7 +56,7 @@ else if(
|
|||||||
$status = 'closed';
|
$status = 'closed';
|
||||||
}
|
}
|
||||||
else if(
|
else if(
|
||||||
$isUnited > 0 &&
|
$isUnited > 0 &&
|
||||||
$now->getTimestamp() - $lastTurn->getTimestamp() > ($reservedDate->getTimestamp() - $now->getTimestamp()) * 2
|
$now->getTimestamp() - $lastTurn->getTimestamp() > ($reservedDate->getTimestamp() - $now->getTimestamp()) * 2
|
||||||
){
|
){
|
||||||
//천통 & 비정지 상태 & 2/3 넘음
|
//천통 & 비정지 상태 & 2/3 넘음
|
||||||
@@ -88,7 +88,7 @@ $result = ResetHelper::buildScenario(
|
|||||||
$options['block_general_create'],
|
$options['block_general_create'],
|
||||||
$options['npcmode'],
|
$options['npcmode'],
|
||||||
$options['show_img_level'],
|
$options['show_img_level'],
|
||||||
$options['tournament_trig'],
|
!!$options['tournament_trig'],
|
||||||
$options['join_mode'],
|
$options['join_mode'],
|
||||||
$options['starttime'],
|
$options['starttime'],
|
||||||
$options['autorun_user']?:null
|
$options['autorun_user']?:null
|
||||||
|
|||||||
+2
-2
@@ -111,7 +111,7 @@ $extend = (int)$_POST['extend'];
|
|||||||
$npcmode = (int)$_POST['npcmode'];
|
$npcmode = (int)$_POST['npcmode'];
|
||||||
$block_general_create = (bool)$_POST['block_general_create'];
|
$block_general_create = (bool)$_POST['block_general_create'];
|
||||||
$show_img_level = (int)$_POST['show_img_level'];
|
$show_img_level = (int)$_POST['show_img_level'];
|
||||||
$tournament_trig = (int)$_POST['tournament_trig'];
|
$tournament_trig = !!(int)$_POST['tournament_trig'];
|
||||||
$join_mode = $_POST['join_mode'];
|
$join_mode = $_POST['join_mode'];
|
||||||
$autorun_user_minutes = (int)$_POST['autorun_user_minutes'];
|
$autorun_user_minutes = (int)$_POST['autorun_user_minutes'];
|
||||||
$autorun_user_options = [];
|
$autorun_user_options = [];
|
||||||
@@ -208,7 +208,7 @@ Json::die(ResetHelper::buildScenario(
|
|||||||
$block_general_create,
|
$block_general_create,
|
||||||
$npcmode,
|
$npcmode,
|
||||||
$show_img_level,
|
$show_img_level,
|
||||||
$tournament_trig,
|
!!$tournament_trig,
|
||||||
$join_mode,
|
$join_mode,
|
||||||
TimeUtil::now(),
|
TimeUtil::now(),
|
||||||
$autorun_user
|
$autorun_user
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ class ResetHelper{
|
|||||||
bool $block_general_create,
|
bool $block_general_create,
|
||||||
int $npcmode,
|
int $npcmode,
|
||||||
int $show_img_level,
|
int $show_img_level,
|
||||||
int $tournament_trig,
|
bool $tournament_trig,
|
||||||
string $join_mode,
|
string $join_mode,
|
||||||
string $turntime,
|
string $turntime,
|
||||||
?array $autorun_user
|
?array $autorun_user
|
||||||
@@ -176,13 +176,6 @@ class ResetHelper{
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if($tournament_trig < 0 || $tournament_trig > 7){
|
|
||||||
return [
|
|
||||||
'result'=>false,
|
|
||||||
'reason'=>'올바르지 않은 토너먼트 주기입니다.'
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$clearResult = self::clearDB();
|
$clearResult = self::clearDB();
|
||||||
if(!$clearResult['result']){
|
if(!$clearResult['result']){
|
||||||
return $clearResult;
|
return $clearResult;
|
||||||
|
|||||||
Reference in New Issue
Block a user