Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1e6ac7b89 | ||
|
|
7b24f66f93 | ||
|
|
b2b2934ce9 | ||
|
|
6ed3e673df | ||
|
|
aa7dcab1fd | ||
|
|
e2e578e485 | ||
|
|
6cebc903c9 | ||
|
|
c0190959e3 | ||
|
|
bb26366769
|
||
|
|
71849a457b
|
||
|
|
7c1a8d96a2
|
||
|
|
cebd152daf
|
||
|
|
2ca03389d2
|
||
|
|
cacf0981ce
|
||
|
|
bcf5b5cb7d
|
||
|
|
66b2f1a8f2
|
||
|
|
40ecca5440
|
||
|
|
a96c2312d0
|
||
|
|
faff3f4e6a | ||
|
|
83abf44380
|
||
|
|
e83960d67f
|
||
|
|
c6b2e64c05
|
||
|
|
029f719112 | ||
|
|
46f460c8ad | ||
|
|
af4401d9bb | ||
|
|
2f00aee947 | ||
|
|
dd2b032fa3 | ||
|
|
1b858ae36c
|
||
|
|
69f4d8e2c7 | ||
|
|
f24aea0120 | ||
|
|
f6dc7f49e2 | ||
|
|
c1f105226f
|
||
|
|
c5ed2d47fc |
+5
-5
@@ -408,14 +408,14 @@ function checkSecretPermission(array $me, $checkSecretLimit = true)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$secretMin = 0;
|
$secretMin = 0;
|
||||||
$secretMax = checkSecretMaxPermission($me, $penalty);
|
$secretMax = checkSecretMaxPermission($penalty);
|
||||||
|
|
||||||
|
|
||||||
if ($me['officer_level'] == 12) {
|
if ($me['officer_level'] == 12) {
|
||||||
$secretMin = 4;
|
$secretMin = 4;
|
||||||
} else if ($me['permission'] == 'ambassador') {
|
} else if ($permission == 'ambassador') {
|
||||||
$secretMin = 4;
|
$secretMin = 4;
|
||||||
} else if ($me['permission'] == 'auditor') {
|
} else if ($permission == 'auditor') {
|
||||||
$secretMin = 3;
|
$secretMin = 3;
|
||||||
} else if ($me['officer_level'] >= 5) {
|
} else if ($me['officer_level'] >= 5) {
|
||||||
$secretMin = 2;
|
$secretMin = 2;
|
||||||
@@ -1054,10 +1054,10 @@ function increaseRefresh($type = "", $cnt = 1)
|
|||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
'path' => "refresh",
|
'path' => "refresh",
|
||||||
'arg' => JSON::encode([
|
'arg' => Json::encode([
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
]),
|
]),
|
||||||
'aux' => JSON::encode([
|
'aux' => Json::encode([
|
||||||
'generalID' => $generalID,
|
'generalID' => $generalID,
|
||||||
'generalName' => $session->generalName,
|
'generalName' => $session->generalName,
|
||||||
'userName' => $session->userName,
|
'userName' => $session->userName,
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ function _setGeneralCommand(GeneralCommand $command, array $turnList):void {
|
|||||||
|
|
||||||
$db->update('general_turn', [
|
$db->update('general_turn', [
|
||||||
'action'=>$commandName,
|
'action'=>$commandName,
|
||||||
'arg'=>Json::encode($arg, JSON::EMPTY_ARRAY_IS_DICT),
|
'arg'=>Json::encode($arg, Json::EMPTY_ARRAY_IS_DICT),
|
||||||
'brief'=>$brief
|
'brief'=>$brief
|
||||||
], 'general_id = %i AND turn_idx IN %li', $generalID, $turnList);
|
], 'general_id = %i AND turn_idx IN %li', $generalID, $turnList);
|
||||||
}
|
}
|
||||||
@@ -233,7 +233,7 @@ function _setNationCommand(NationCommand $command, array $turnList):void {
|
|||||||
|
|
||||||
$db->update('nation_turn', [
|
$db->update('nation_turn', [
|
||||||
'action'=>$commandName,
|
'action'=>$commandName,
|
||||||
'arg'=>Json::encode($arg, JSON::EMPTY_ARRAY_IS_DICT),
|
'arg'=>Json::encode($arg, Json::EMPTY_ARRAY_IS_DICT),
|
||||||
'brief'=>$brief
|
'brief'=>$brief
|
||||||
], 'nation_id = %i AND officer_level = %i AND turn_idx IN %li', $nationID, $officerLevel, $turnList);
|
], 'nation_id = %i AND officer_level = %i AND turn_idx IN %li', $nationID, $officerLevel, $turnList);
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-4
@@ -899,7 +899,7 @@ function checkEmperior()
|
|||||||
'tiger' => $tigerstr,
|
'tiger' => $tigerstr,
|
||||||
'eagle' => $eaglestr,
|
'eagle' => $eaglestr,
|
||||||
'gen' => $gen,
|
'gen' => $gen,
|
||||||
'history' => JSON::encode($nationHistory),
|
'history' => Json::encode($nationHistory),
|
||||||
'aux' => $statGeneral['aux']
|
'aux' => $statGeneral['aux']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -951,8 +951,19 @@ function updateMaxDomesticCritical(General $general, $score)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function genGenericUniqueRNG(int $year, int $month, int $generalID): RandUtil
|
function genGenericUniqueRNG(int $year, int $month, int $generalID, ?string $reason = null): RandUtil
|
||||||
{
|
{
|
||||||
|
if($reason){
|
||||||
|
return new RandUtil(new LiteHashDRBG(Util::simpleSerialize(
|
||||||
|
UniqueConst::$hiddenSeed,
|
||||||
|
'unique',
|
||||||
|
$year,
|
||||||
|
$month,
|
||||||
|
$generalID,
|
||||||
|
$reason
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
return new RandUtil(new LiteHashDRBG(Util::simpleSerialize(
|
return new RandUtil(new LiteHashDRBG(Util::simpleSerialize(
|
||||||
UniqueConst::$hiddenSeed,
|
UniqueConst::$hiddenSeed,
|
||||||
'unique',
|
'unique',
|
||||||
@@ -962,7 +973,7 @@ function genGenericUniqueRNG(int $year, int $month, int $generalID): RandUtil
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
function genGenericUniqueRNGFromGeneral(General $general): RandUtil
|
function genGenericUniqueRNGFromGeneral(General $general, string $reason): RandUtil
|
||||||
{
|
{
|
||||||
$logger = $general->getLogger();
|
$logger = $general->getLogger();
|
||||||
if (!$logger) {
|
if (!$logger) {
|
||||||
@@ -971,5 +982,5 @@ function genGenericUniqueRNGFromGeneral(General $general): RandUtil
|
|||||||
$year = $logger->getYear();
|
$year = $logger->getYear();
|
||||||
$month = $logger->getMonth();
|
$month = $logger->getMonth();
|
||||||
$generalID = $general->getID();
|
$generalID = $general->getID();
|
||||||
return genGenericUniqueRNG($year, $month, $generalID);
|
return genGenericUniqueRNG($year, $month, $generalID, $reason);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,63 +148,6 @@ function allButton(bool $seizeNPCMode, array $opts = [])
|
|||||||
], $opts));
|
], $opts));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function commandButton(array $opts = [])
|
|
||||||
{
|
|
||||||
$session = Session::getInstance();
|
|
||||||
$userID = Session::getUserID();
|
|
||||||
if (!$session->isGameLoggedIn()) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$db = DB::db();
|
|
||||||
$me = $db->queryFirstRow("select no,nation,officer_level,belong,permission,penalty from general where owner=%i", $userID);
|
|
||||||
|
|
||||||
$nation = $db->queryFirstRow("select nation,level,color,secretlimit from nation where nation=%i", $me['nation']) ?? [
|
|
||||||
'nation' => 0,
|
|
||||||
'level' => 0,
|
|
||||||
'secretlimit' => 99,
|
|
||||||
'color' => '#000000'
|
|
||||||
];
|
|
||||||
|
|
||||||
$bgColor = $nation['color'] ?? '#000000';
|
|
||||||
$fgColor = newColor($bgColor);
|
|
||||||
|
|
||||||
$templates = new \League\Plates\Engine(__DIR__ . '/templates');
|
|
||||||
$showSecret = false;
|
|
||||||
$permission = checkSecretPermission($me);
|
|
||||||
$btnClassForTournament = $opts['btnClass'];
|
|
||||||
if ($opts['isTournamentApplicationOpen']) {
|
|
||||||
if ($btnClassForTournament != 'dropdown-item') {
|
|
||||||
$btnClassForTournament = 'toolbarButton2';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$btnClassForBetting = $opts['btnClass'];
|
|
||||||
if ($opts['isBettingActive']) {
|
|
||||||
if ($btnClassForTournament != 'dropdown-item') {
|
|
||||||
$btnClassForBetting = 'toolbarButton2';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($permission >= 1) {
|
|
||||||
$showSecret = true;
|
|
||||||
} else if ($me['officer_level'] == 0) {
|
|
||||||
$showSecret = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $templates->render('commandButton', array_merge([
|
|
||||||
'bgColor' => $bgColor,
|
|
||||||
'fgColor' => $fgColor,
|
|
||||||
'meLevel' => $me['officer_level'],
|
|
||||||
'nationLevel' => $nation['level'],
|
|
||||||
'showSecret' => $showSecret,
|
|
||||||
'permission' => $permission,
|
|
||||||
'btnClassForTournament' => $btnClassForTournament,
|
|
||||||
'btnClassForBetting' => $btnClassForBetting,
|
|
||||||
], $opts));
|
|
||||||
}
|
|
||||||
|
|
||||||
function formatWounded(int $value, int $wound): string
|
function formatWounded(int $value, int $wound): string
|
||||||
{
|
{
|
||||||
if ($wound == 0) {
|
if ($wound == 0) {
|
||||||
|
|||||||
+15
-3
@@ -27,14 +27,25 @@ $rootDB = RootDB::db();
|
|||||||
$oNow = new \DateTimeImmutable();
|
$oNow = new \DateTimeImmutable();
|
||||||
$now = $oNow->format('Y-m-d H:i:s');
|
$now = $oNow->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
$userNick = RootDB::db()->queryFirstField('SELECT `NAME` FROM member WHERE `NO`=%i',$userID);
|
$member = $rootDB->queryFirstRow('SELECT `name`, `penalty` FROM member WHERE `NO`=%i', $userID);
|
||||||
if(!$userNick){
|
if(!$member){
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'멤버 정보를 가져오지 못했습니다.'
|
'reason'=>'멤버 정보를 가져오지 못했습니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$userNick = $member['name'];
|
||||||
|
$memberPenalty = Json::decode($member['penalty'] ?? '{}');
|
||||||
|
$penaltyInfo = array_merge($memberPenalty['any'] ?? [], $memberPenalty[DB::prefix()] ?? []);
|
||||||
|
|
||||||
|
$penalty = [];
|
||||||
|
foreach($penaltyInfo as $penaltyKey => $penaltyValue){
|
||||||
|
if($penaltyValue['expire'] ?? 0 > TimeUtil::now()){
|
||||||
|
$penalty[$penaltyKey] = $penaltyValue['value'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$pickResult = $db->queryFirstField('SELECT pick_result FROM select_npc_token WHERE `owner`=%i AND `valid_until`>=%s', $userID, $now);
|
$pickResult = $db->queryFirstField('SELECT pick_result FROM select_npc_token WHERE `owner`=%i AND `valid_until`>=%s', $userID, $now);
|
||||||
if(!$pickResult){
|
if(!$pickResult){
|
||||||
Json::die([
|
Json::die([
|
||||||
@@ -86,7 +97,8 @@ $db->update('general', [
|
|||||||
'defence_train'=>80,
|
'defence_train'=>80,
|
||||||
'permission'=>'normal',
|
'permission'=>'normal',
|
||||||
'owner'=>$userID,
|
'owner'=>$userID,
|
||||||
'aux'=>Json::encode($genAux)
|
'aux'=>Json::encode($genAux),
|
||||||
|
'penalty'=>Json::encode($penalty),
|
||||||
], 'owner <= 0 AND npc = 2 AND no = %i', $pick);
|
], 'owner <= 0 AND npc = 2 AND no = %i', $pick);
|
||||||
$db->insertIgnore('general_access_log', [
|
$db->insertIgnore('general_access_log', [
|
||||||
GeneralAccessLogColumn::generalID->value => $pick,
|
GeneralAccessLogColumn::generalID->value => $pick,
|
||||||
|
|||||||
@@ -285,19 +285,6 @@ if ($lastVoteID) {
|
|||||||
<div id="general-position"><?php generalInfo($generalObj); ?></div>
|
<div id="general-position"><?php generalInfo($generalObj); ?></div>
|
||||||
<div id="generalCommandButton" class="row gx-0">
|
<div id="generalCommandButton" class="row gx-0">
|
||||||
<div class="buttonPlate bg2">
|
<div class="buttonPlate bg2">
|
||||||
<?= commandButton([
|
|
||||||
'splitBtnBegin' => '<div class="btn-group">',
|
|
||||||
'splitBtnEnd' => '</div>',
|
|
||||||
'splitZoneSign' => '<button type="button" class="btn btn-sammo-nation dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false"><span class="visually-hidden">Toggle Dropdown</span></button>',
|
|
||||||
'splitZoneBegin' => '<ul class="dropdown-menu dropdown-menu-end">',
|
|
||||||
'splitZoneEnd' => '</ul>',
|
|
||||||
'splitSubBtnBegin' => '<li>',
|
|
||||||
'splitSubBtnEnd' => '</li>',
|
|
||||||
'btnClass' => 'btn btn-sammo-nation',
|
|
||||||
'btnSplitClass' => 'dropdown-item',
|
|
||||||
'isTournamentApplicationOpen' => $isTournamentApplicationOpen,
|
|
||||||
'isBettingActive' => $isBettingActive
|
|
||||||
])
|
|
||||||
?></div>
|
?></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -398,18 +385,6 @@ if ($lastVoteID) {
|
|||||||
국가 메뉴
|
국가 메뉴
|
||||||
</div>
|
</div>
|
||||||
<ul class="dropdown-menu" aria-labelledby="navbarNation" id="navbarNationItems">
|
<ul class="dropdown-menu" aria-labelledby="navbarNation" id="navbarNationItems">
|
||||||
<?= commandButton([
|
|
||||||
'btnBegin' => '<li>',
|
|
||||||
'btnEnd' => '</li>',
|
|
||||||
'splitMainBegin' => '<div class="d-none">',
|
|
||||||
'splitMainEnd' => '</div>',
|
|
||||||
'splitSubBtnBegin' => '<li>',
|
|
||||||
'splitSubBtnEnd' => '</li>',
|
|
||||||
'btnClass' => 'dropdown-item',
|
|
||||||
'btnSplitClass' => 'dropdown-item',
|
|
||||||
'isTournamentApplicationOpen' => $isTournamentApplicationOpen,
|
|
||||||
'isBettingActive' => $isBettingActive
|
|
||||||
]) ?>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item dropup">
|
<li class="nav-item dropup">
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use sammo\Session;
|
|||||||
use DateTimeInterface;
|
use DateTimeInterface;
|
||||||
use sammo\DB;
|
use sammo\DB;
|
||||||
use sammo\Enums\APIRecoveryType;
|
use sammo\Enums\APIRecoveryType;
|
||||||
|
use sammo\GameConst;
|
||||||
use sammo\Json;
|
use sammo\Json;
|
||||||
use sammo\KVStorage;
|
use sammo\KVStorage;
|
||||||
use sammo\TimeUtil;
|
use sammo\TimeUtil;
|
||||||
@@ -32,8 +33,18 @@ class GetReservedCommand extends \sammo\BaseAPI
|
|||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$generalID = $session->generalID;
|
$generalID = $session->generalID;
|
||||||
|
|
||||||
|
$invalidTurnList = 0;
|
||||||
|
|
||||||
$rawTurn = $db->queryAllLists('SELECT turn_idx, action, arg, brief FROM general_turn WHERE general_id = %i ORDER BY turn_idx ASC', $generalID);
|
$rawTurn = $db->queryAllLists('SELECT turn_idx, action, arg, brief FROM general_turn WHERE general_id = %i ORDER BY turn_idx ASC', $generalID);
|
||||||
foreach ($rawTurn as [$turn_idx, $action, $arg, $brief]) {
|
foreach ($rawTurn as [$turn_idx, $action, $arg, $brief]) {
|
||||||
|
if($turn_idx < 0) {
|
||||||
|
$invalidTurnList = -1;
|
||||||
|
$turn_idx += GameConst::$maxTurn;
|
||||||
|
}
|
||||||
|
else if($turn_idx >= GameConst::$maxTurn) {
|
||||||
|
$invalidTurnList = 1;
|
||||||
|
$turn_idx -= GameConst::$maxTurn;
|
||||||
|
}
|
||||||
$commandList[$turn_idx] = [
|
$commandList[$turn_idx] = [
|
||||||
'action' => $action,
|
'action' => $action,
|
||||||
'brief' => $brief,
|
'brief' => $brief,
|
||||||
@@ -41,6 +52,19 @@ class GetReservedCommand extends \sammo\BaseAPI
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($invalidTurnList != 0){
|
||||||
|
if($invalidTurnList > 0){
|
||||||
|
$db->update('general_turn', [
|
||||||
|
'turn_idx' => $db->sqleval('turn_idx - %i', GameConst::$maxTurn)
|
||||||
|
], 'general_id=%i AND turn_idx >= %i', $generalID, GameConst::$maxTurn);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$db->update('general_turn', [
|
||||||
|
'turn_idx' => $db->sqleval('turn_idx + %i', GameConst::$maxTurn)
|
||||||
|
], 'general_id=%i AND turn_idx < 0', $generalID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[$turnTerm, $year, $month, $lastExecute] = $gameStor->getValuesAsArray(['turnterm', 'year', 'month', 'turntime']);
|
[$turnTerm, $year, $month, $lastExecute] = $gameStor->getValuesAsArray(['turnterm', 'year', 'month', 'turntime']);
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ class BuildNationCandidate extends \sammo\BaseAPI
|
|||||||
return '거병을 실패했습니다.';
|
return '거병을 실패했습니다.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$generalObj->setVar('killturn', $env['killturn']);
|
||||||
|
$generalObj->applyDB($db);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class Join extends \sammo\BaseAPI
|
|||||||
'leadership',
|
'leadership',
|
||||||
'strength',
|
'strength',
|
||||||
'intel',
|
'intel',
|
||||||
'inheritTurntime',
|
'inheritTurntimeZone',
|
||||||
])
|
])
|
||||||
->rule('boolean', [
|
->rule('boolean', [
|
||||||
'pic'
|
'pic'
|
||||||
@@ -72,7 +72,8 @@ class Join extends \sammo\BaseAPI
|
|||||||
], GameConst::$defaultStatMax)
|
], GameConst::$defaultStatMax)
|
||||||
->rule('in', 'character', array_merge(GameConst::$availablePersonality, ['Random']))
|
->rule('in', 'character', array_merge(GameConst::$availablePersonality, ['Random']))
|
||||||
->rule('in', 'inheritSpecial', GameConst::$availableSpecialWar)
|
->rule('in', 'inheritSpecial', GameConst::$availableSpecialWar)
|
||||||
->rule('min', 'inheritTurntime', 0)
|
->rule('min', 'inheritTurntimeZone', 0)
|
||||||
|
->rule('max', 'inheritTurntimeZone', 59)
|
||||||
->rule('in', 'inheritCity', array_keys(CityConst::all()))
|
->rule('in', 'inheritCity', array_keys(CityConst::all()))
|
||||||
->rule('integerArray', 'inheritBonusStat');
|
->rule('integerArray', 'inheritBonusStat');
|
||||||
|
|
||||||
@@ -139,22 +140,28 @@ class Join extends \sammo\BaseAPI
|
|||||||
$intel = $this->args['intel'];
|
$intel = $this->args['intel'];
|
||||||
|
|
||||||
$inheritSpecial = $this->args['inheritSpecial'] ?? null;
|
$inheritSpecial = $this->args['inheritSpecial'] ?? null;
|
||||||
$inheritTurntime = $this->args['inheritTurntime'] ?? null;
|
$inheritTurntimeZone = $this->args['inheritTurntimeZone'] ?? null;
|
||||||
$inheritCity = $this->args['inheritCity'] ?? null;
|
$inheritCity = $this->args['inheritCity'] ?? null;
|
||||||
$inheritBonusStat = $this->args['inheritBonusStat'] ?? null;
|
$inheritBonusStat = $this->args['inheritBonusStat'] ?? null;
|
||||||
|
|
||||||
if ($inheritTurntime !== null && $inheritCity !== null) {
|
|
||||||
return '턴과 도시를 동시에 지정할 수 없습니다.';
|
|
||||||
}
|
|
||||||
|
|
||||||
$rootDB = RootDB::db();
|
$rootDB = RootDB::db();
|
||||||
//회원 테이블에서 정보확인
|
//회원 테이블에서 정보확인
|
||||||
$member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name`, imgsvr FROM member WHERE no=%i', $userID);
|
$member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name`, imgsvr, `penalty` FROM member WHERE no=%i', $userID);
|
||||||
|
|
||||||
if (!$member) {
|
if (!$member) {
|
||||||
return "잘못된 접근입니다!!!";
|
return "잘못된 접근입니다!!!";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$memberPenalty = Json::decode($member['penalty'] ?? "{}");
|
||||||
|
$penaltyInfo = array_merge($memberPenalty['any'] ?? [], $memberPenalty[DB::prefix()] ?? []);
|
||||||
|
|
||||||
|
$penalty = [];
|
||||||
|
foreach($penaltyInfo as $penaltyKey => $penaltyValue){
|
||||||
|
if($penaltyValue['expire'] ?? 0 > TimeUtil::now()){
|
||||||
|
$penalty[$penaltyKey] = $penaltyValue['value'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$gameStor->cacheValues(['year', 'month', 'maxgeneral', 'scenario', 'show_img_level', 'block_general_create', 'turnterm', 'turntime', 'genius', 'npcmode']);
|
$gameStor->cacheValues(['year', 'month', 'maxgeneral', 'scenario', 'show_img_level', 'block_general_create', 'turnterm', 'turntime', 'genius', 'npcmode']);
|
||||||
@@ -232,7 +239,7 @@ class Join extends \sammo\BaseAPI
|
|||||||
if ($inheritSpecial !== null) {
|
if ($inheritSpecial !== null) {
|
||||||
$inheritRequiredPoint += GameConst::$inheritBornSpecialPoint;
|
$inheritRequiredPoint += GameConst::$inheritBornSpecialPoint;
|
||||||
}
|
}
|
||||||
if ($inheritTurntime !== null) {
|
if ($inheritTurntimeZone !== null) {
|
||||||
$inheritRequiredPoint += GameConst::$inheritBornTurntimePoint;
|
$inheritRequiredPoint += GameConst::$inheritBornTurntimePoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,12 +354,14 @@ class Join extends \sammo\BaseAPI
|
|||||||
$experience *= 0.8;
|
$experience *= 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($inheritTurntime !== null) {
|
if ($inheritTurntimeZone !== null) {
|
||||||
$inheritTurntime = $inheritTurntime % ($admin['turnterm'] * 60);
|
$inheritTurntime = $inheritTurntimeZone * $admin['turnterm'];
|
||||||
|
$inheritTurntime += $rng->nextRangeInt(0, Util::clamp($admin['turnterm'] - 1, 0));
|
||||||
|
|
||||||
$userLogger->push(sprintf("턴 시간 %02d:%02d 로 지정", intdiv($inheritTurntime, 60), $inheritTurntime % 60), "inheritPoint");
|
$userLogger->push(sprintf("턴 시간 %02d:%02d 로 지정", intdiv($inheritTurntime, 60), $inheritTurntime % 60), "inheritPoint");
|
||||||
|
|
||||||
$inheritTurntime += $rng->nextRangeInt(0, 999999) / 1000000;
|
$inheritTurntime += $rng->nextRangeInt(0, 999999) / 1000000;
|
||||||
|
|
||||||
$turntime = new \DateTimeImmutable(cutTurn($admin['turntime'], $admin['turnterm']));
|
$turntime = new \DateTimeImmutable(cutTurn($admin['turntime'], $admin['turnterm']));
|
||||||
$turntime = $turntime->add(TimeUtil::secondsToDateInterval($inheritTurntime));
|
$turntime = $turntime->add(TimeUtil::secondsToDateInterval($inheritTurntime));
|
||||||
$turntime = TimeUtil::format($turntime, true);
|
$turntime = TimeUtil::format($turntime, true);
|
||||||
@@ -424,7 +433,8 @@ class Join extends \sammo\BaseAPI
|
|||||||
'specage' => $specage,
|
'specage' => $specage,
|
||||||
'special' => $special,
|
'special' => $special,
|
||||||
'specage2' => $specage2,
|
'specage2' => $specage2,
|
||||||
'special2' => $special2
|
'special2' => $special2,
|
||||||
|
'penalty' => Json::encode($penalty),
|
||||||
]);
|
]);
|
||||||
$generalID = $db->insertId();
|
$generalID = $db->insertId();
|
||||||
$db->insert('general_access_log', [
|
$db->insert('general_access_log', [
|
||||||
|
|||||||
@@ -70,13 +70,13 @@ class ResetTurnTime extends \sammo\BaseAPI
|
|||||||
UniqueConst::$hiddenSeed,
|
UniqueConst::$hiddenSeed,
|
||||||
'ResetTurnTime',
|
'ResetTurnTime',
|
||||||
$userID,
|
$userID,
|
||||||
$general->getTurnTime()
|
$general->getAuxVar('nextTurnTimeBase') ?? $general->getTurnTime()
|
||||||
)));
|
)));
|
||||||
|
|
||||||
$afterTurn = $rng->nextFloat1() * $turnTerm * 60;
|
$afterTurn = $rng->nextFloat1() * $turnTerm * 60;
|
||||||
|
|
||||||
$userLogger = new UserLogger($userID);
|
$userLogger = new UserLogger($userID);
|
||||||
$userLogger->push(sprintf("{$reqPoint} 포인트로 턴 시간을 바꾸어 다음 턴부터 %02d:%02d 적용", intdiv(Util::toInt($afterTurn), 60), $afterTurn % 60), "inheritPoint");
|
$userLogger->push(sprintf("{$reqPoint} 포인트로 턴 시간을 바꾸어 다다음 턴부터 %02d:%02d 적용", intdiv(Util::toInt($afterTurn), 60), $afterTurn % 60), "inheritPoint");
|
||||||
$userLogger->flush();
|
$userLogger->flush();
|
||||||
|
|
||||||
$general->setAuxVar('inheritResetTurnTime', $nextLevel);
|
$general->setAuxVar('inheritResetTurnTime', $nextLevel);
|
||||||
|
|||||||
@@ -7,9 +7,11 @@ use DateTimeInterface;
|
|||||||
use sammo\DB;
|
use sammo\DB;
|
||||||
use sammo\Enums\APIRecoveryType;
|
use sammo\Enums\APIRecoveryType;
|
||||||
use sammo\Enums\MessageType;
|
use sammo\Enums\MessageType;
|
||||||
|
use sammo\Json;
|
||||||
use sammo\Message;
|
use sammo\Message;
|
||||||
use sammo\MessageTarget;
|
use sammo\MessageTarget;
|
||||||
use sammo\Validator;
|
use sammo\Validator;
|
||||||
|
use sammo\Util;
|
||||||
|
|
||||||
use function sammo\checkLimit;
|
use function sammo\checkLimit;
|
||||||
use function sammo\checkSecretPermission;
|
use function sammo\checkSecretPermission;
|
||||||
@@ -170,6 +172,8 @@ class SendMessage extends \sammo\BaseAPI
|
|||||||
return '장수가 없습니다.';
|
return '장수가 없습니다.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$penalty = Json::decode($me['penalty'] ?? '{}');
|
||||||
|
|
||||||
$limitState = checkLimit($me['refresh_score']);
|
$limitState = checkLimit($me['refresh_score']);
|
||||||
if ($limitState >= 2) {
|
if ($limitState >= 2) {
|
||||||
return '접속 제한입니다.';
|
return '접속 제한입니다.';
|
||||||
@@ -226,8 +230,10 @@ class SendMessage extends \sammo\BaseAPI
|
|||||||
$now = new \DateTime();
|
$now = new \DateTime();
|
||||||
$lastMsg = new \DateTime($session->lastMsg ?? '0000-00-00');
|
$lastMsg = new \DateTime($session->lastMsg ?? '0000-00-00');
|
||||||
$msg_interval = $now->getTimestamp() - $lastMsg->getTimestamp();
|
$msg_interval = $now->getTimestamp() - $lastMsg->getTimestamp();
|
||||||
if ($msg_interval < 2) {
|
|
||||||
return '개인메세지는 2초당 1건만 보낼 수 있습니다!';
|
$msg_min_interval = $penalty['sendPrivateMsgDelay'] ?? 2;
|
||||||
|
if ($msg_interval < $msg_min_interval) {
|
||||||
|
return "개인메세지는 {$msg_min_interval}초당 1건만 보낼 수 있습니다!";
|
||||||
}
|
}
|
||||||
$session->lastMsg = $now->format('Y-m-d H:i:s');
|
$session->lastMsg = $now->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ class GeneralList extends \sammo\BaseAPI
|
|||||||
foreach ($rawGeneralList as $rawGeneral) {
|
foreach ($rawGeneralList as $rawGeneral) {
|
||||||
//General 생성?
|
//General 생성?
|
||||||
if (key_exists('aux', $rawGeneral)) {
|
if (key_exists('aux', $rawGeneral)) {
|
||||||
$rawGeneral['aux'] = \sammo\JSON::decode($rawGeneral['aux']);
|
$rawGeneral['aux'] = \sammo\Json::decode($rawGeneral['aux']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$item = [];
|
$item = [];
|
||||||
|
|||||||
@@ -73,6 +73,11 @@ class GetReservedCommand extends \sammo\BaseAPI
|
|||||||
}
|
}
|
||||||
|
|
||||||
$nationTurnList = [];
|
$nationTurnList = [];
|
||||||
|
|
||||||
|
//혹시 정규 턴을 벗어난 턴이 있는지 체크
|
||||||
|
$invalidUnderTurnList = [];
|
||||||
|
$invalidOverTurnList = [];
|
||||||
|
|
||||||
foreach ($db->queryAllLists(
|
foreach ($db->queryAllLists(
|
||||||
'SELECT officer_level, turn_idx, action, arg, brief FROM nation_turn WHERE nation_id = %i ORDER BY officer_level DESC, turn_idx ASC',
|
'SELECT officer_level, turn_idx, action, arg, brief FROM nation_turn WHERE nation_id = %i ORDER BY officer_level DESC, turn_idx ASC',
|
||||||
$me['nation']
|
$me['nation']
|
||||||
@@ -80,6 +85,14 @@ class GetReservedCommand extends \sammo\BaseAPI
|
|||||||
if (!key_exists($officer_level, $nationTurnList)) {
|
if (!key_exists($officer_level, $nationTurnList)) {
|
||||||
$nationTurnList[$officer_level] = [];
|
$nationTurnList[$officer_level] = [];
|
||||||
}
|
}
|
||||||
|
if($turn_idx < 0){
|
||||||
|
$invalidUnderTurnList[$officer_level] = $turn_idx;
|
||||||
|
$turn_idx += GameConst::$maxChiefTurn;
|
||||||
|
}
|
||||||
|
else if($turn_idx >= GameConst::$maxChiefTurn){
|
||||||
|
$invalidOverTurnList[$officer_level] = $turn_idx;
|
||||||
|
$turn_idx -= GameConst::$maxChiefTurn;
|
||||||
|
}
|
||||||
$nationTurnList[$officer_level][$turn_idx] = [
|
$nationTurnList[$officer_level][$turn_idx] = [
|
||||||
'action' => $action,
|
'action' => $action,
|
||||||
'brief' => $brief,
|
'brief' => $brief,
|
||||||
@@ -87,6 +100,21 @@ class GetReservedCommand extends \sammo\BaseAPI
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($invalidUnderTurnList){
|
||||||
|
$db->update(
|
||||||
|
'nation_turn', [
|
||||||
|
'turn_idx' => $db->sqleval('`turn_idx` + %i', GameConst::$maxChiefTurn)
|
||||||
|
], 'nation_id = %i AND officer_level IN %li AND turn_idx < 0', $me['nation'], array_keys($invalidUnderTurnList)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if($invalidOverTurnList){
|
||||||
|
$db->update(
|
||||||
|
'nation_turn', [
|
||||||
|
'turn_idx' => $db->sqleval('`turn_idx` - %i', GameConst::$maxChiefTurn)
|
||||||
|
], 'nation_id = %i AND officer_level IN %li AND turn_idx >= %i', $me['nation'], array_keys($invalidOverTurnList), GameConst::$maxChiefTurn
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$troopList = [];
|
$troopList = [];
|
||||||
foreach ($db->queryAllLists(
|
foreach ($db->queryAllLists(
|
||||||
'SELECT troop_leader, `name` FROM troop WHERE `nation` = %i',
|
'SELECT troop_leader, `name` FROM troop WHERE `nation` = %i',
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class che_오두미도 extends \sammo\BaseNation{
|
|||||||
protected $name = '오두미도';
|
protected $name = '오두미도';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
static $pros = '쌀수입↑ 인구↑';
|
static $pros = '쌀수입↑ 인구↑';
|
||||||
static $cons = '기술↓ 수성↓ 내정↓';
|
static $cons = '기술↓ 수성↓ 농상↓';
|
||||||
|
|
||||||
|
|
||||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||||
@@ -40,4 +40,4 @@ class che_오두미도 extends \sammo\BaseNation{
|
|||||||
return $amount;
|
return $amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class che_유가 extends \sammo\BaseNation{
|
|||||||
|
|
||||||
protected $name = '유가';
|
protected $name = '유가';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
static $pros = '내정↑ 민심↑';
|
static $pros = '농상↑ 민심↑';
|
||||||
static $cons = '쌀수입↓';
|
static $cons = '쌀수입↓';
|
||||||
|
|
||||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||||
@@ -31,4 +31,4 @@ class che_유가 extends \sammo\BaseNation{
|
|||||||
|
|
||||||
return $amount;
|
return $amount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class che_음양가 extends \sammo\BaseNation{
|
|||||||
|
|
||||||
protected $name = '음양가';
|
protected $name = '음양가';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
static $pros = '내정↑ 인구↑';
|
static $pros = '농상↑ 인구↑';
|
||||||
static $cons = '기술↓ 전략↓';
|
static $cons = '기술↓ 전략↓';
|
||||||
|
|
||||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||||
@@ -29,14 +29,14 @@ class che_음양가 extends \sammo\BaseNation{
|
|||||||
if($type == 'pop' && $amount > 0){
|
if($type == 'pop' && $amount > 0){
|
||||||
return $amount * 1.2;
|
return $amount * 1.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $amount;
|
return $amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onCalcStrategic(string $turnType, string $varType, $value){
|
public function onCalcStrategic(string $turnType, string $varType, $value){
|
||||||
if($varType == 'delay'){
|
if($varType == 'delay'){
|
||||||
return $value * 2;
|
return Util::round($value * 4 / 3);
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class che_종횡가 extends \sammo\BaseNation{
|
|||||||
protected $name = '종횡가';
|
protected $name = '종횡가';
|
||||||
protected $info = '';
|
protected $info = '';
|
||||||
static $pros = '전략↑ 수성↑';
|
static $pros = '전략↑ 수성↑';
|
||||||
static $cons = '금수입↓ 내정↓';
|
static $cons = '금수입↓ 농상↓';
|
||||||
|
|
||||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||||
if($turnType == '수비' || $turnType == '성벽'){
|
if($turnType == '수비' || $turnType == '성벽'){
|
||||||
@@ -42,4 +42,4 @@ class che_종횡가 extends \sammo\BaseNation{
|
|||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ class che_강행 extends Command\GeneralCommand
|
|||||||
$general->increaseVar('leadership_exp', 1);
|
$general->increaseVar('leadership_exp', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ class che_거병 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ class che_건국 extends Command\GeneralCommand
|
|||||||
$general->increaseInheritancePoint(InheritanceKey::active_action, 1);
|
$general->increaseInheritancePoint(InheritanceKey::active_action, 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(genGenericUniqueRNGFromGeneral($general), $general, '건국');
|
tryUniqueItemLottery(genGenericUniqueRNGFromGeneral($general, static::$actionName), $general, '건국');
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ class che_견문 extends Command\GeneralCommand{
|
|||||||
$general->addExperience($exp);
|
$general->addExperience($exp);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ class che_군량매매 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class che_귀환 extends Command\GeneralCommand{
|
|||||||
$general->increaseVar('leadership_exp', 1);
|
$general->increaseVar('leadership_exp', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class che_기술연구 extends che_상업투자{
|
|||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class che_단련 extends Command\GeneralCommand{
|
|||||||
$general->increaseVar($incStat, 1);
|
$general->increaseVar($incStat, 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class che_등용 extends Command\GeneralCommand
|
|||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ class che_랜덤임관 extends Command\GeneralCommand
|
|||||||
$general->addExperience($exp);
|
$general->addExperience($exp);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(genGenericUniqueRNGFromGeneral($general), $general, '랜덤 임관');
|
tryUniqueItemLottery(genGenericUniqueRNGFromGeneral($general, static::$actionName), $general, '랜덤 임관');
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ class che_무작위건국 extends Command\GeneralCommand
|
|||||||
$general->increaseInheritancePoint(InheritanceKey::active_action, 1);
|
$general->increaseInheritancePoint(InheritanceKey::active_action, 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(genGenericUniqueRNGFromGeneral($general), $general, '건국');
|
tryUniqueItemLottery(genGenericUniqueRNGFromGeneral($general, static::$actionName), $general, '건국');
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ class che_물자조달 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class che_사기진작 extends Command\GeneralCommand{
|
|||||||
$general->increaseVar('leadership_exp', 1);
|
$general->increaseVar('leadership_exp', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ class che_상업투자 extends Command\GeneralCommand{
|
|||||||
$general->increaseVar(static::$statKey.'_exp', 1);
|
$general->increaseVar(static::$statKey.'_exp', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ class che_숙련전환 extends Command\GeneralCommand
|
|||||||
$general->increaseVar('leadership_exp', 2);
|
$general->increaseVar('leadership_exp', 2);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class che_은퇴 extends Command\GeneralCommand{
|
|||||||
$logger->pushGeneralActionLog("은퇴하였습니다. <1>$date</>");
|
$logger->pushGeneralActionLog("은퇴하였습니다. <1>$date</>");
|
||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ class che_이동 extends Command\GeneralCommand
|
|||||||
$general->increaseVar('leadership_exp', 1);
|
$general->increaseVar('leadership_exp', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ class che_인재탐색 extends Command\GeneralCommand
|
|||||||
$general->increaseVar($incStat, 1);
|
$general->increaseVar($incStat, 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -218,7 +218,7 @@ class che_인재탐색 extends Command\GeneralCommand
|
|||||||
$general->increaseVar($incStat, 3);
|
$general->increaseVar($incStat, 3);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ class che_임관 extends Command\GeneralCommand
|
|||||||
$general->addExperience($exp);
|
$general->addExperience($exp);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ class che_장비매매 extends Command\GeneralCommand
|
|||||||
$general->addExperience($exp);
|
$general->addExperience($exp);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
|
|||||||
$general->addExperience($exp);
|
$general->addExperience($exp);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class che_전투태세 extends Command\GeneralCommand{
|
|||||||
$general->increaseVar('leadership_exp', 3);
|
$general->increaseVar('leadership_exp', 3);
|
||||||
$this->setResultTurn($turnResult);
|
$this->setResultTurn($turnResult);
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class che_전투특기초기화 extends Command\GeneralCommand{
|
|||||||
$logger->pushGeneralActionLog("새로운 {$specialName}를 가질 준비가 되었습니다. <1>$date</>");
|
$logger->pushGeneralActionLog("새로운 {$specialName}를 가질 준비가 되었습니다. <1>$date</>");
|
||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ class che_정착장려 extends Command\GeneralCommand{
|
|||||||
$general->increaseVar(static::$statKey.'_exp', 1);
|
$general->increaseVar(static::$statKey.'_exp', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ class che_주민선정 extends Command\GeneralCommand{
|
|||||||
$general->increaseVar(static::$statKey.'_exp', 1);
|
$general->increaseVar(static::$statKey.'_exp', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ class che_증여 extends Command\GeneralCommand
|
|||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
$destGeneral->applyDB($db);
|
$destGeneral->applyDB($db);
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class che_집합 extends Command\GeneralCommand{
|
|||||||
$general->increaseVar('leadership_exp', 1);
|
$general->increaseVar('leadership_exp', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ class che_징병 extends Command\GeneralCommand
|
|||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
$general->setAuxVar('armType', $reqCrewType->armType);
|
$general->setAuxVar('armType', $reqCrewType->armType);
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ class che_출병 extends Command\GeneralCommand
|
|||||||
|
|
||||||
processWar($warRngSeed, $general, $this->nation, $this->destCity);
|
processWar($warRngSeed, $general, $this->nation, $this->destCity);
|
||||||
|
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ class che_헌납 extends Command\GeneralCommand
|
|||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
|
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class che_훈련 extends Command\GeneralCommand{
|
|||||||
$general->increaseVar('leadership_exp', 1);
|
$general->increaseVar('leadership_exp', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ class cr_건국 extends Command\GeneralCommand
|
|||||||
$general->increaseInheritancePoint(InheritanceKey::active_action, 1);
|
$general->increaseInheritancePoint(InheritanceKey::active_action, 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(genGenericUniqueRNGFromGeneral($general), $general, '건국');
|
tryUniqueItemLottery(genGenericUniqueRNGFromGeneral($general, static::$actionName), $general, '건국');
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ class cr_맹훈련 extends Command\GeneralCommand{
|
|||||||
$general->increaseVar('leadership_exp', 1);
|
$general->increaseVar('leadership_exp', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general), $general);
|
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -67,12 +67,14 @@ class RaiseInvader extends \sammo\Event\Action
|
|||||||
|
|
||||||
foreach ($db->queryAllLists('SELECT capital, nation from nation WHERE capital in %li', $cities) as $row) {
|
foreach ($db->queryAllLists('SELECT capital, nation from nation WHERE capital in %li', $cities) as $row) {
|
||||||
[$oldCapital, $nation] = $row;
|
[$oldCapital, $nation] = $row;
|
||||||
$capitalCandidates = $db->queryFirstColumn('SELECT from city WHERE nation = %i AND city != %i', $nation);
|
$capitalCandidates = $db->queryFirstColumn('SELECT city from city WHERE nation = %i AND city != %i NOT IN %li', $nation, $oldCapital, $cities);
|
||||||
if (!$capitalCandidates) {
|
if (!$capitalCandidates) {
|
||||||
$disabledInvaderCity->add($oldCapital);
|
$disabledInvaderCity->add($oldCapital);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$newCapital = $rng->choice($capitalCandidates);
|
$newCapital = $rng->choice($capitalCandidates);
|
||||||
|
|
||||||
$db->update('nation', ['capital' => $newCapital], 'nation=%i', $nation);
|
$db->update('nation', ['capital' => $newCapital], 'nation=%i', $nation);
|
||||||
$db->update('general', ['city' => $newCapital], 'nation=%i and city=%i', $nation, $oldCapital);
|
$db->update('general', ['city' => $newCapital], 'nation=%i and city=%i', $nation, $oldCapital);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ class GameConstBase
|
|||||||
|
|
||||||
public static $minMonthToAllowInheritItem = 4;
|
public static $minMonthToAllowInheritItem = 4;
|
||||||
public static $inheritBornSpecialPoint = 6000;
|
public static $inheritBornSpecialPoint = 6000;
|
||||||
public static $inheritBornTurntimePoint = 3000;
|
public static $inheritBornTurntimePoint = 2500;
|
||||||
public static $inheritBornCityPoint = 1000;
|
public static $inheritBornCityPoint = 1000;
|
||||||
public static $inheritBornStatPoint = 1000;
|
public static $inheritBornStatPoint = 1000;
|
||||||
public static $inheritItemUniqueMinPoint = 5000;
|
public static $inheritItemUniqueMinPoint = 5000;
|
||||||
@@ -318,7 +318,6 @@ class GameConstBase
|
|||||||
'che_치안강화',
|
'che_치안강화',
|
||||||
'che_정착장려',
|
'che_정착장려',
|
||||||
'che_주민선정',
|
'che_주민선정',
|
||||||
'che_물자조달',
|
|
||||||
],
|
],
|
||||||
'군사' => [
|
'군사' => [
|
||||||
'che_징병',
|
'che_징병',
|
||||||
@@ -349,6 +348,7 @@ class GameConstBase
|
|||||||
'국가' => [
|
'국가' => [
|
||||||
'che_증여',
|
'che_증여',
|
||||||
'che_헌납',
|
'che_헌납',
|
||||||
|
'che_물자조달',
|
||||||
'che_하야',
|
'che_하야',
|
||||||
'che_거병',
|
'che_거병',
|
||||||
'che_건국',
|
'che_건국',
|
||||||
|
|||||||
@@ -365,14 +365,14 @@ class General extends GeneralBase implements iAction
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->calcCache[$cKey] = $statValue;
|
|
||||||
|
|
||||||
$statValue = Util::clamp($statValue, 0, GameConst::$maxLevel);
|
$statValue = Util::clamp($statValue, 0, GameConst::$maxLevel);
|
||||||
|
|
||||||
if ($useFloor) {
|
if ($useFloor) {
|
||||||
return Util::toInt($statValue);
|
return Util::toInt($statValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->calcCache[$cKey] = $statValue;
|
||||||
|
|
||||||
return $statValue;
|
return $statValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -806,7 +806,7 @@ class General extends GeneralBase implements iAction
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/** @var iAction $iObj */
|
/** @var iAction $iObj */
|
||||||
$value = $iObj->onCalcStat($this, $statName, $value, $aux);
|
$value = $iObj->onCalcStat($general, $statName, $value, $aux);
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
@@ -819,7 +819,7 @@ class General extends GeneralBase implements iAction
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/** @var iAction $iObj */
|
/** @var iAction $iObj */
|
||||||
$value = $iObj->onCalcOpposeStat($this, $statName, $value, $aux);
|
$value = $iObj->onCalcOpposeStat($general, $statName, $value, $aux);
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|||||||
+35
-20
@@ -82,8 +82,9 @@ class GeneralAI
|
|||||||
const d직전 = 3;
|
const d직전 = 3;
|
||||||
const d전쟁 = 4;
|
const d전쟁 = 4;
|
||||||
|
|
||||||
protected function updateInstance(): void{
|
protected function updateInstance(): void
|
||||||
if(!$this->reqUpdateInstance){
|
{
|
||||||
|
if (!$this->reqUpdateInstance) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,11 +216,10 @@ class GeneralAI
|
|||||||
);
|
);
|
||||||
|
|
||||||
if ($yearMonth <= Util::joinYearMonth($env['startyear'] + 2, 5)) {
|
if ($yearMonth <= Util::joinYearMonth($env['startyear'] + 2, 5)) {
|
||||||
if(!$warTarget){
|
if (!$warTarget) {
|
||||||
$this->dipState = self::d평화;
|
$this->dipState = self::d평화;
|
||||||
$this->attackable = false;
|
$this->attackable = false;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$this->dipState = self::d선포;
|
$this->dipState = self::d선포;
|
||||||
$this->attackable = false;
|
$this->attackable = false;
|
||||||
}
|
}
|
||||||
@@ -2992,7 +2992,7 @@ class GeneralAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->frontCities as $frontCity) {
|
foreach ($this->frontCities as $frontCity) {
|
||||||
if(!$frontCity['supply']){
|
if (!$frontCity['supply']) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$candidateCities[$frontCity['city']] = $frontCity['important'];
|
$candidateCities[$frontCity['city']] = $frontCity['important'];
|
||||||
@@ -3120,6 +3120,11 @@ class GeneralAI
|
|||||||
{
|
{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
|
$dupLord = $db->queryFirstField('SELECT COUNT(*) FROM general WHERE officer_level = 12 AND city = %i', $this->general->getCityID());
|
||||||
|
if($dupLord <= 1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
$lordCities = $db->queryFirstColumn('SELECT city.city as city FROM general LEFT JOIN city ON general.city = city.city WHERE general.officer_level = 12 AND city.nation = 0');
|
$lordCities = $db->queryFirstColumn('SELECT city.city as city FROM general LEFT JOIN city ON general.city = city.city WHERE general.officer_level = 12 AND city.nation = 0');
|
||||||
$nationCities = $db->queryFirstColumn('SELECT city FROM city WHERE nation != 0');
|
$nationCities = $db->queryFirstColumn('SELECT city FROM city WHERE nation != 0');
|
||||||
@@ -3352,10 +3357,9 @@ class GeneralAI
|
|||||||
if ($this->rng->nextBool(pow(1 / ($nationCnt + 1) / pow($notFullNationCnt, 3), 1 / 4))) {
|
if ($this->rng->nextBool(pow(1 / ($nationCnt + 1) / pow($notFullNationCnt, 3), 1 / 4))) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
//임관 기간이 끝나면 고정 확률로 낮춤 0.3 * 0.5 = 0.15
|
//임관 기간이 끝나면 고정 확률로 낮춤 0.3 * 0.5 = 0.15
|
||||||
if ($this->rng->nextBool()){
|
if ($this->rng->nextBool()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3439,8 +3443,12 @@ class GeneralAI
|
|||||||
|
|
||||||
$cmd = buildGeneralCommandClass($this->rng->choice($candidate), $this->general, $this->env);
|
$cmd = buildGeneralCommandClass($this->rng->choice($candidate), $this->general, $this->env);
|
||||||
if (!$cmd->hasFullConditionMet()) {
|
if (!$cmd->hasFullConditionMet()) {
|
||||||
return buildGeneralCommandClass('che_물자조달', $this->general, $this->env);
|
$cmd = buildGeneralCommandClass('che_물자조달', $this->general, $this->env);
|
||||||
|
if (!$cmd->hasFullConditionMet()) {
|
||||||
|
$cmd = buildGeneralCommandClass('che_견문', $this->general, $this->env);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $cmd;
|
return $cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3477,7 +3485,7 @@ class GeneralAI
|
|||||||
}
|
}
|
||||||
if ($nationCity['front']) {
|
if ($nationCity['front']) {
|
||||||
$frontCities[$cityID] = $nationCity;
|
$frontCities[$cityID] = $nationCity;
|
||||||
} else if($nationCity['supply']) {
|
} else if ($nationCity['supply']) {
|
||||||
$backupCities[$cityID] = $nationCity;
|
$backupCities[$cityID] = $nationCity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3779,21 +3787,28 @@ class GeneralAI
|
|||||||
|
|
||||||
if ($npcType >= 2 && $general->getVar('officer_level') == 12 && !$this->nation['capital']) {
|
if ($npcType >= 2 && $general->getVar('officer_level') == 12 && !$this->nation['capital']) {
|
||||||
//방랑군 건국
|
//방랑군 건국
|
||||||
$result = $this->do건국();
|
$relYearMonth = Util::joinYearMonth($this->env['year'], $this->env['month']) - Util::joinYearMonth($this->env['init_year'], $this->env['init_month']);
|
||||||
if ($result !== null) {
|
|
||||||
$result->reason = 'do건국';
|
if ($relYearMonth > 1) {
|
||||||
return $result;
|
$result = $this->do건국();
|
||||||
|
if ($result !== null) {
|
||||||
|
$result->reason = 'do건국';
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->do방랑군이동();
|
$result = $this->do방랑군이동();
|
||||||
if ($result !== null) {
|
if ($result !== null) {
|
||||||
$result->reason = 'do방랑군이동';
|
$result->reason = 'do방랑군이동';
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->do해산();
|
if ($relYearMonth > 1) {
|
||||||
if ($result !== null) {
|
$result = $this->do해산();
|
||||||
$result->reason = 'do해산';
|
if ($result !== null) {
|
||||||
return $result;
|
$result->reason = 'do해산';
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4035,7 +4050,7 @@ class GeneralAI
|
|||||||
if (!key_exists($chiefLevel, $this->chiefGenerals) && !key_exists($chiefLevel, $nextChiefs)) {
|
if (!key_exists($chiefLevel, $this->chiefGenerals) && !key_exists($chiefLevel, $nextChiefs)) {
|
||||||
$newChiefProb = 1;
|
$newChiefProb = 1;
|
||||||
} else {
|
} else {
|
||||||
$newChiefProb = $this->rng->nextBool(0.1)?1:0;
|
$newChiefProb = $this->rng->nextBool(0.1) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($newChiefProb < 1 && !$this->rng->nextBool($newChiefProb)) {
|
if ($newChiefProb < 1 && !$this->rng->nextBool($newChiefProb)) {
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
<?=$btnBegin??''?><a href='v_board.php' class='commandButton <?=$btnClass??""?> <?= $meLevel >= 1 ? '' : 'disabled' ?>'>회 의 실</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_board.php?isSecret=true' class='commandButton <?= $permission >= 2 ? '' : 'disabled' ?> <?=$btnClass??""?>'>기 밀 실</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_troop.php' class='commandButton <?= ($meLevel >= 1 && $nationLevel >= 1) ? '' : 'disabled' ?> <?=$btnClass??""?>'>부대 편성</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='t_diplomacy.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>외 교 부</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_myBossInfo.php' class='commandButton <?= $meLevel >= 1 ? '' : 'disabled' ?> <?=$btnClass??""?>'>인 사 부</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_nationStratFinan.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>내 무 부</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_chiefCenter.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>사 령 부</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_NPCControl.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>NPC 정책</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_genList.php' target='_blank' class='open-window commandButton <?=$btnClass??""?> <?= $showSecret ? '' : 'disabled' ?>'>암 행 부</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_tournament.php' target='_blank' class='open-window <?=$btnClassForTournament??""?>'>토 너 먼 트</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_myKingdomInfo.php' class='commandButton <?=$btnClass??""?> <?= $meLevel >= 1 ? '' : 'disabled' ?>'>세력 정보</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_myCityInfo.php' class='commandButton <?=$btnClass??""?> <?= ($meLevel >= 1 && $nationLevel >= 1) ? '' : 'disabled' ?>'>세력 도시</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_nationGeneral.php' class='commandButton <?=$btnClass??""?> <?= $meLevel >= 1 ? '' : 'disabled' ?>'>세력 장수</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_globalDiplomacy.php' class='commandButton <?=$btnClass??""?>'>중원 정보</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_currentCity.php' class='commandButton <?=$btnClass??""?>'>현재 도시</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_battleCenter.php' target='_blank' class='open-window commandButton <?=$btnClass??""?> <?= $showSecret ? '' : 'disabled' ?>'>감 찰 부</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='v_inheritPoint.php' class='commandButton <?=$btnClass??""?>'>유산 관리</a><?=$btnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_myPage.php' class='commandButton <?=$btnClass??""?>'>내 정보&설정</a><?=$btnEnd??''?>
|
|
||||||
<?=$splitBtnBegin??''?>
|
|
||||||
<?=$splitMainBegin??''?><a href='v_auction.php' target='_blank' class='open-window commandButton <?=$btnClass??""?>'>경 매 장</a><?=$splitMainEnd??''?>
|
|
||||||
<?=$splitZoneSign??''?>
|
|
||||||
<?=$splitZoneBegin??''?>
|
|
||||||
<?=$splitSubBtnBegin??''?><a href='v_auction.php' target='_blank' class='open-window commandButton <?=$btnSplitClass??''?>'>금/쌀 경매장</a><?=$splitSubBtnEnd??''?>
|
|
||||||
<?=$splitSubBtnBegin??''?><a href='v_auction.php?type=unique' target='_blank' class='open-window commandButton <?=$btnSplitClass??''?>'>유니크 경매장</a><?=$splitSubBtnEnd??''?>
|
|
||||||
<?=$splitZoneEnd??''?>
|
|
||||||
<?=$splitBtnEnd??''?>
|
|
||||||
<?=$btnBegin??''?><a href='b_betting.php' target='_blank' class='open-window <?=$btnClassForBetting??""?>'>베 팅 장</a><?=$btnEnd??''?>
|
|
||||||
+45
-80
@@ -186,58 +186,45 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col col-lg-6 col-sm-6 col-12 p-2 align-self-center">
|
<div class="col col-lg-6 col-sm-6 col-12 p-2 align-self-center">
|
||||||
<div class="a-center">
|
<div class="row">
|
||||||
<label> <input v-model="inheritTurnTimeSet" type="checkbox" />턴 시간 고정 </label>
|
<div class="col col-6 a-right align-self-center">턴 시간 지정</div>
|
||||||
</div>
|
<div class="col col-6 align-self-center">
|
||||||
<div class="row turn_time_pad">
|
<select v-model.number="inheritTurnTimeZone" class="form-select form-inline" style="max-width: 24ch">
|
||||||
<div class="col col-lg-4 offset-lg-3 col-4 offset-3">
|
<option :value="undefined">사용안함</option>
|
||||||
<NumberInputWithInfo
|
<option v-for="(zone, idx) in turnTimeZoneList" :key="idx" :value="idx">
|
||||||
v-model="inheritTurnTimeMinute"
|
{{ zone }}
|
||||||
:readonly="!inheritTurnTimeSet"
|
</option>
|
||||||
:min="0"
|
</select>
|
||||||
:max="turnterm - 1"
|
|
||||||
:right="true"
|
|
||||||
title="분"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="col col-lg-4 col-4">
|
|
||||||
<NumberInputWithInfo
|
|
||||||
v-model="inheritTurnTimeSecond"
|
|
||||||
:readonly="!inheritTurnTimeSet"
|
|
||||||
:min="0"
|
|
||||||
:max="60"
|
|
||||||
:right="true"
|
|
||||||
title="초"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col col-lg-6 col-12 p-2">
|
<div class="col col-lg-6 col-sm-6 col-12 p-2 align-self-center">
|
||||||
<div class="a-center">추가 능력치 고정</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col col-6 a-right align-self-center">추가 능력치 고정(통/무/지)</div>
|
||||||
|
<div class="col col-6 align-self-center">
|
||||||
|
<div class="row g-1">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="(args.inheritBonusStat ?? [0, 0, 0])[0]"
|
v-model="(args.inheritBonusStat ?? [0, 0, 0])[0]"
|
||||||
:max="stats.bonusMax"
|
:max="stats.bonusMax"
|
||||||
title="통솔"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="(args.inheritBonusStat ?? [0, 0, 0])[1]"
|
v-model="(args.inheritBonusStat ?? [0, 0, 0])[1]"
|
||||||
:max="stats.bonusMax"
|
:max="stats.bonusMax"
|
||||||
title="무력"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="(args.inheritBonusStat ?? [0, 0, 0])[2]"
|
v-model="(args.inheritBonusStat ?? [0, 0, 0])[2]"
|
||||||
:max="stats.bonusMax"
|
:max="stats.bonusMax"
|
||||||
title="지력"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -284,7 +271,7 @@ import TopBackBar from "@/components/TopBackBar.vue";
|
|||||||
import { getIconPath } from "@util/getIconPath";
|
import { getIconPath } from "@util/getIconPath";
|
||||||
import { isBrightColor } from "@util/isBrightColor";
|
import { isBrightColor } from "@util/isBrightColor";
|
||||||
import { abilityLeadint, abilityLeadpow, abilityPowint, abilityRand } from "@util/generalStats";
|
import { abilityLeadint, abilityLeadpow, abilityPowint, abilityRand } from "@util/generalStats";
|
||||||
import { shuffle, sum } from "lodash-es";
|
import { range, shuffle, sum } from "lodash-es";
|
||||||
import NumberInputWithInfo from "@/components/NumberInputWithInfo.vue";
|
import NumberInputWithInfo from "@/components/NumberInputWithInfo.vue";
|
||||||
import { SammoAPI } from "./SammoAPI";
|
import { SammoAPI } from "./SammoAPI";
|
||||||
import type { JoinArgs } from "./defs/API/General";
|
import type { JoinArgs } from "./defs/API/General";
|
||||||
@@ -378,7 +365,7 @@ watch(gameConstStore, (gameConst) => {
|
|||||||
inheritCity: undefined,
|
inheritCity: undefined,
|
||||||
inheritBonusStat: [0, 0, 0],
|
inheritBonusStat: [0, 0, 0],
|
||||||
inheritSpecial: undefined,
|
inheritSpecial: undefined,
|
||||||
inheritTurntime: undefined,
|
inheritTurntimeZone: undefined,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -462,7 +449,7 @@ const inheritRequiredPoint = computed(() => {
|
|||||||
if (args.value.inheritSpecial !== undefined) {
|
if (args.value.inheritSpecial !== undefined) {
|
||||||
inheritRequiredPoint += gameConst.inheritBornSpecialPoint;
|
inheritRequiredPoint += gameConst.inheritBornSpecialPoint;
|
||||||
}
|
}
|
||||||
if (args.value.inheritTurntime !== undefined) {
|
if (args.value.inheritTurntimeZone !== undefined) {
|
||||||
inheritRequiredPoint += gameConst.inheritBornTurntimePoint;
|
inheritRequiredPoint += gameConst.inheritBornTurntimePoint;
|
||||||
}
|
}
|
||||||
if (args.value.inheritBonusStat !== undefined && sum(args.value.inheritBonusStat) != 0) {
|
if (args.value.inheritBonusStat !== undefined && sum(args.value.inheritBonusStat) != 0) {
|
||||||
@@ -494,55 +481,37 @@ watch(inheritCity, (newValue: undefined | number) => {
|
|||||||
args.value.inheritCity = inheritCity.value;
|
args.value.inheritCity = inheritCity.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
const inheritTurnTimeSet = ref(false);
|
|
||||||
watch(inheritTurnTimeSet, (newValue: boolean) => {
|
|
||||||
if (!args.value) throw "nyc";
|
|
||||||
|
|
||||||
if (!newValue) {
|
const inheritTurnTimeZone = ref<number>();
|
||||||
args.value.inheritTurntime = undefined;
|
const turnTimeZoneList: string[] = (()=>{
|
||||||
return;
|
const result: string[] = [];
|
||||||
|
const zoneSec = turnterm; // * 60 / 60
|
||||||
|
let zoneCur = 0;
|
||||||
|
for(const idx of range(60)){
|
||||||
|
const zoneNext = zoneCur + zoneSec;
|
||||||
|
|
||||||
|
const zoneCurMin = Math.floor(zoneCur / 60);
|
||||||
|
const zoneCurSec = zoneCur % 60;
|
||||||
|
const zoneCurText = `${zoneCurMin.toString().padStart(2, "0")}:${zoneCurSec.toString().padStart(2, "0")}.000`;
|
||||||
|
|
||||||
|
const zoneCurEnd = zoneCur + zoneSec - 1;
|
||||||
|
const zoneCurEndMin = Math.floor(zoneCurEnd / 60);
|
||||||
|
const zoneCurEndSec = zoneCurEnd % 60;
|
||||||
|
const zoneCurEndText = `${zoneCurEndMin.toString().padStart(2, "0")}:${zoneCurEndSec.toString().padStart(2, "0")}.999`;
|
||||||
|
|
||||||
|
// aa:bb.000 ~ cc:dd.999
|
||||||
|
const zoneStr = `${zoneCurText} ~ ${zoneCurEndText}`;
|
||||||
|
result.push(zoneStr);
|
||||||
|
zoneCur = zoneNext;
|
||||||
}
|
}
|
||||||
args.value.inheritTurntime = inheritTurnTimeMinute.value * 60 + inheritTurnTimeSecond.value;
|
return result;
|
||||||
|
})();
|
||||||
|
|
||||||
|
watch(inheritTurnTimeZone, (newValue: undefined | number) => {
|
||||||
|
if (!args.value) throw "nyc";
|
||||||
|
args.value.inheritTurntimeZone = inheritTurnTimeZone.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";
|
|
||||||
if (!inheritTurnTimeSet.value) {
|
|
||||||
args.value.inheritTurntime = undefined;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
args.value.inheritTurntime = newValue * 60 + inheritTurnTimeSecond.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
const inheritTurnTimeSecond = ref(0);
|
|
||||||
watch(inheritTurnTimeSecond, (newValue: number) => {
|
|
||||||
if (!args.value) throw "nyc";
|
|
||||||
|
|
||||||
if (!inheritTurnTimeSet.value) {
|
|
||||||
args.value.inheritTurntime = undefined;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
args.value.inheritTurntime = inheritTurnTimeMinute.value * 60 + newValue;
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "@scss/common/base.scss";
|
@import "@scss/common/base.scss";
|
||||||
@@ -569,10 +538,6 @@ watch(inheritTurnTimeSecond, (newValue: number) => {
|
|||||||
.col-form-label {
|
.col-form-label {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.turn_time_pad .col-form-label {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ async function refreshDetail() {
|
|||||||
currentAuction.value = await SammoAPI.Auction.GetUniqueItemAuctionDetail({ auctionID });
|
currentAuction.value = await SammoAPI.Auction.GetUniqueItemAuctionDetail({ auctionID });
|
||||||
const bidList = currentAuction.value.bidList;
|
const bidList = currentAuction.value.bidList;
|
||||||
const highestBidAmount = Math.max(bidList[0].amount, bidList[bidList.length-1].amount);
|
const highestBidAmount = Math.max(bidList[0].amount, bidList[bidList.length-1].amount);
|
||||||
bidAmount.value = Math.max(bidAmount.value, Math.ceil(highestBidAmount * 1.01));
|
bidAmount.value = Math.ceil(highestBidAmount * 1.01);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
if (isString(e)) {
|
if (isString(e)) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export type JoinArgs = {
|
|||||||
pic: boolean;
|
pic: boolean;
|
||||||
character: string;
|
character: string;
|
||||||
inheritSpecial?: string;
|
inheritSpecial?: string;
|
||||||
inheritTurntime?: number;
|
inheritTurntimeZone?: number;
|
||||||
inheritCity?: number;
|
inheritCity?: number;
|
||||||
inheritBonusStat?: [number, number, number];
|
inheritBonusStat?: [number, number, number];
|
||||||
};
|
};
|
||||||
|
|||||||
+23
-20
@@ -93,8 +93,8 @@ class APIHelper
|
|||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
'path' => $actionPath,
|
'path' => $actionPath,
|
||||||
'arg' => JSON::encode($filteredArgs),
|
'arg' => Json::encode($filteredArgs),
|
||||||
'aux' => JSON::encode([
|
'aux' => Json::encode([
|
||||||
'result' => false,
|
'result' => false,
|
||||||
'state' => 'validate',
|
'state' => 'validate',
|
||||||
'reason' => $validateResult
|
'reason' => $validateResult
|
||||||
@@ -123,8 +123,8 @@ class APIHelper
|
|||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
'path' => $actionPath,
|
'path' => $actionPath,
|
||||||
'arg' => JSON::encode($filteredArgs),
|
'arg' => Json::encode($filteredArgs),
|
||||||
'aux' => JSON::encode([
|
'aux' => Json::encode([
|
||||||
'result' => false,
|
'result' => false,
|
||||||
'state' => 'launch',
|
'state' => 'launch',
|
||||||
'reason' => $result
|
'reason' => $result
|
||||||
@@ -139,8 +139,8 @@ class APIHelper
|
|||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
'path' => $actionPath,
|
'path' => $actionPath,
|
||||||
'arg' => JSON::encode($filteredArgs),
|
'arg' => Json::encode($filteredArgs),
|
||||||
'aux' => JSON::encode([
|
'aux' => Json::encode([
|
||||||
'result' => false,
|
'result' => false,
|
||||||
'state' => 'launch',
|
'state' => 'launch',
|
||||||
'reason' => $recoveryType->info(),
|
'reason' => $recoveryType->info(),
|
||||||
@@ -168,8 +168,8 @@ class APIHelper
|
|||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
'path' => $actionPath,
|
'path' => $actionPath,
|
||||||
'arg' => JSON::encode($filteredArgs),
|
'arg' => Json::encode($filteredArgs),
|
||||||
'aux' => JSON::encode([
|
'aux' => Json::encode([
|
||||||
'result' => true,
|
'result' => true,
|
||||||
'state' => 'cache_not_modified',
|
'state' => 'cache_not_modified',
|
||||||
]),
|
]),
|
||||||
@@ -183,8 +183,8 @@ class APIHelper
|
|||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
'path' => $actionPath,
|
'path' => $actionPath,
|
||||||
'arg' => JSON::encode($filteredArgs),
|
'arg' => Json::encode($filteredArgs),
|
||||||
'aux' => JSON::encode([
|
'aux' => Json::encode([
|
||||||
'result' => true,
|
'result' => true,
|
||||||
'state' => 'cache_not_modified',
|
'state' => 'cache_not_modified',
|
||||||
]),
|
]),
|
||||||
@@ -199,8 +199,8 @@ class APIHelper
|
|||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
'path' => $actionPath,
|
'path' => $actionPath,
|
||||||
'arg' => JSON::encode($filteredArgs),
|
'arg' => Json::encode($filteredArgs),
|
||||||
'aux' => JSON::encode([
|
'aux' => Json::encode([
|
||||||
'result' => true,
|
'result' => true,
|
||||||
'state' => 'success_simple',
|
'state' => 'success_simple',
|
||||||
'set_cache' => $setCache,
|
'set_cache' => $setCache,
|
||||||
@@ -216,8 +216,8 @@ class APIHelper
|
|||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
'path' => $actionPath,
|
'path' => $actionPath,
|
||||||
'arg' => JSON::encode($filteredArgs),
|
'arg' => Json::encode($filteredArgs),
|
||||||
'aux' => JSON::encode([
|
'aux' => Json::encode([
|
||||||
'result' => true,
|
'result' => true,
|
||||||
'state' => 'success_complex',
|
'state' => 'success_complex',
|
||||||
'set_cache' => $setCache,
|
'set_cache' => $setCache,
|
||||||
@@ -226,6 +226,7 @@ class APIHelper
|
|||||||
$result['result'] = $result['result'] ?? true;
|
$result['result'] = $result['result'] ?? true;
|
||||||
Json::die($result, $setCache ? 0 : Json::NO_CACHE);
|
Json::die($result, $setCache ? 0 : Json::NO_CACHE);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
$session = Session::getInstance();
|
||||||
$errMsg = $e->getMessage();
|
$errMsg = $e->getMessage();
|
||||||
$errTrace = $e->getTraceAsString();
|
$errTrace = $e->getTraceAsString();
|
||||||
$logDB->insert('api_log', [
|
$logDB->insert('api_log', [
|
||||||
@@ -233,8 +234,8 @@ class APIHelper
|
|||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
'path' => $actionPath,
|
'path' => $actionPath,
|
||||||
'arg' => JSON::encode($filteredArgs),
|
'arg' => Json::encode($filteredArgs),
|
||||||
'aux' => JSON::encode([
|
'aux' => Json::encode([
|
||||||
'result' => false,
|
'result' => false,
|
||||||
'state' => 'error_exception',
|
'state' => 'error_exception',
|
||||||
'errMsg' => $errMsg,
|
'errMsg' => $errMsg,
|
||||||
@@ -244,6 +245,7 @@ class APIHelper
|
|||||||
Json::dieWithReason("{$errMsg}\n{$errTrace}");
|
Json::dieWithReason("{$errMsg}\n{$errTrace}");
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
logExceptionByCustomHandler($e, false);
|
logExceptionByCustomHandler($e, false);
|
||||||
|
$session = Session::getInstance();
|
||||||
$errMsg = $e->getMessage();
|
$errMsg = $e->getMessage();
|
||||||
$errTrace = $e->getTraceAsString();
|
$errTrace = $e->getTraceAsString();
|
||||||
$logDB->insert('api_log', [
|
$logDB->insert('api_log', [
|
||||||
@@ -251,8 +253,8 @@ class APIHelper
|
|||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
'path' => $actionPath,
|
'path' => $actionPath,
|
||||||
'arg' => JSON::encode($filteredArgs),
|
'arg' => Json::encode($filteredArgs),
|
||||||
'aux' => JSON::encode([
|
'aux' => Json::encode([
|
||||||
'result' => false,
|
'result' => false,
|
||||||
'state' => 'error_throwable',
|
'state' => 'error_throwable',
|
||||||
'errMsg' => $errMsg,
|
'errMsg' => $errMsg,
|
||||||
@@ -261,14 +263,15 @@ class APIHelper
|
|||||||
]);
|
]);
|
||||||
Json::dieWithReason("{$errMsg}\n{$errTrace}");
|
Json::dieWithReason("{$errMsg}\n{$errTrace}");
|
||||||
} catch (mixed $e) {
|
} catch (mixed $e) {
|
||||||
|
$session = Session::getInstance();
|
||||||
$errStr = strval($e);
|
$errStr = strval($e);
|
||||||
$logDB->insert('api_log', [
|
$logDB->insert('api_log', [
|
||||||
'user_id' => $session->userID ?? 0,
|
'user_id' => $session->userID ?? 0,
|
||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
'path' => $actionPath,
|
'path' => $actionPath,
|
||||||
'arg' => JSON::encode($filteredArgs),
|
'arg' => Json::encode($filteredArgs),
|
||||||
'aux' => JSON::encode([
|
'aux' => Json::encode([
|
||||||
'result' => false,
|
'result' => false,
|
||||||
'state' => 'error_mixed',
|
'state' => 'error_mixed',
|
||||||
'errMsg' => $errStr,
|
'errMsg' => $errStr,
|
||||||
|
|||||||
Reference in New Issue
Block a user