fix: phan 출력 결과에 따라 처리
- switch에 변수를 정하는 경우 default에 throw - Util::getPost에 일부 타입 강제 - array인 일부 값들에 PHPDoc 타입 지정 - Enum에 toString이 없으므로 value값 지정 - 사용하지 않는 use function 제거
This commit is contained in:
+1
-3
@@ -16,6 +16,7 @@ return [
|
|||||||
// that functions removed in php 7.0 exist.
|
// that functions removed in php 7.0 exist.
|
||||||
// (See `backward_compatibility_checks` for additional options)
|
// (See `backward_compatibility_checks` for additional options)
|
||||||
"target_php_version" => '8.1',
|
"target_php_version" => '8.1',
|
||||||
|
"minimum_target_php_version" => '8.1',
|
||||||
'backward_compatibility_checks ' => true,
|
'backward_compatibility_checks ' => true,
|
||||||
'minimum_severity' => \Phan\Issue::SEVERITY_NORMAL,
|
'minimum_severity' => \Phan\Issue::SEVERITY_NORMAL,
|
||||||
|
|
||||||
@@ -42,7 +43,6 @@ return [
|
|||||||
'hwe/a_kingdomList.php',
|
'hwe/a_kingdomList.php',
|
||||||
'hwe/a_npcList.php',
|
'hwe/a_npcList.php',
|
||||||
'hwe/api.php',
|
'hwe/api.php',
|
||||||
'hwe/a_status.php',
|
|
||||||
'hwe/a_traffic.php',
|
'hwe/a_traffic.php',
|
||||||
'hwe/a_vote.php',
|
'hwe/a_vote.php',
|
||||||
'hwe/battle_simulator.php',
|
'hwe/battle_simulator.php',
|
||||||
@@ -98,10 +98,8 @@ return [
|
|||||||
'hwe/j_general_set_permission.php',
|
'hwe/j_general_set_permission.php',
|
||||||
'hwe/j_get_basic_general_list.php',
|
'hwe/j_get_basic_general_list.php',
|
||||||
'hwe/j_get_city_list.php',
|
'hwe/j_get_city_list.php',
|
||||||
'hwe/j_get_reserved_command.php',
|
|
||||||
'hwe/j_get_select_npc_token.php',
|
'hwe/j_get_select_npc_token.php',
|
||||||
'hwe/j_get_select_pool.php',
|
'hwe/j_get_select_pool.php',
|
||||||
'hwe/j_image_upload.php',
|
|
||||||
'hwe/j_install_db.php',
|
'hwe/j_install_db.php',
|
||||||
'hwe/j_install.php',
|
'hwe/j_install.php',
|
||||||
'hwe/j_load_scenarios.php',
|
'hwe/j_load_scenarios.php',
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ switch ($btn) {
|
|||||||
case "30분턴": $turnterm = 30; break;
|
case "30분턴": $turnterm = 30; break;
|
||||||
case "60분턴": $turnterm = 60; break;
|
case "60분턴": $turnterm = 60; break;
|
||||||
case "120분턴": $turnterm = 120; break;
|
case "120분턴": $turnterm = 120; break;
|
||||||
|
default: throw new \Exception("알 수 없는 턴 기간");
|
||||||
}
|
}
|
||||||
$oldunit = $admin['turnterm'] * 60;
|
$oldunit = $admin['turnterm'] * 60;
|
||||||
$unit = $turnterm * 60;
|
$unit = $turnterm * 60;
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ namespace sammo;
|
|||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
|
|
||||||
|
/** @var int */
|
||||||
$type = Util::getPost('type', 'int', 0);
|
$type = Util::getPost('type', 'int', 0);
|
||||||
|
/** @var int */
|
||||||
$type2 = Util::getPost('type2', 'int', 0);
|
$type2 = Util::getPost('type2', 'int', 0);
|
||||||
|
|
||||||
if ($type < 0 || $type > 17) {
|
if ($type < 0 || $type > 17) {
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ $sel[$type] = "selected";
|
|||||||
case 7:
|
case 7:
|
||||||
$state = "<font color=green>불가침</font>";
|
$state = "<font color=green>불가침</font>";
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
throw new \Exception("알 수 없는 외교 상태: {$dip['state']}");
|
||||||
}
|
}
|
||||||
|
|
||||||
$date = TimeUtil::now();
|
$date = TimeUtil::now();
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ $serverID = $emperior['server_id'] ?? ($emperior['serverID'] ?? null);
|
|||||||
}
|
}
|
||||||
$nation += Json::decode($nation['data']);
|
$nation += Json::decode($nation['data']);
|
||||||
|
|
||||||
|
/** @var array $nation */
|
||||||
$nation['typeName'] = getNationType($nation['type']);
|
$nation['typeName'] = getNationType($nation['type']);
|
||||||
$nation['levelName'] = getNationLevel($nation['level']);
|
$nation['levelName'] = getNationLevel($nation['level']);
|
||||||
/** @var int[]|null $nationGenerals */
|
/** @var int[]|null $nationGenerals */
|
||||||
|
|||||||
@@ -517,6 +517,7 @@ function fillLowGenAll($tnmt_type)
|
|||||||
};
|
};
|
||||||
|
|
||||||
//자동신청하고, 돈 있고, 아직 참가 안한 장수
|
//자동신청하고, 돈 있고, 아직 참가 안한 장수
|
||||||
|
/** @var array<array{0:array,1:float}> */
|
||||||
$freeJoinerCandidate = [];
|
$freeJoinerCandidate = [];
|
||||||
|
|
||||||
foreach ($db->query(
|
foreach ($db->query(
|
||||||
@@ -535,6 +536,7 @@ function fillLowGenAll($tnmt_type)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$general = Util::choiceRandomUsingWeightPair($freeJoinerCandidate);
|
$general = Util::choiceRandomUsingWeightPair($freeJoinerCandidate);
|
||||||
|
/** @var array $general */
|
||||||
unset($freeJoinerCandidate[$general['no']]);
|
unset($freeJoinerCandidate[$general['no']]);
|
||||||
|
|
||||||
$grpIdx = array_keys($grpCount, min($grpCount))[0];
|
$grpIdx = array_keys($grpCount, min($grpCount))[0];
|
||||||
|
|||||||
@@ -6,13 +6,10 @@ use sammo\Session;
|
|||||||
use DateTimeInterface;
|
use DateTimeInterface;
|
||||||
use sammo\DB;
|
use sammo\DB;
|
||||||
use sammo\DTO\BettingInfo;
|
use sammo\DTO\BettingInfo;
|
||||||
use sammo\General;
|
|
||||||
use sammo\KVStorage;
|
use sammo\KVStorage;
|
||||||
use sammo\Util;
|
use sammo\Util;
|
||||||
use sammo\Validator;
|
use sammo\Validator;
|
||||||
|
|
||||||
use function sammo\increaseRefresh;
|
|
||||||
|
|
||||||
class GetBettingDetail extends \sammo\BaseAPI
|
class GetBettingDetail extends \sammo\BaseAPI
|
||||||
{
|
{
|
||||||
public function validateArgs(): ?string
|
public function validateArgs(): ?string
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ use sammo\Session;
|
|||||||
use DateTimeInterface;
|
use DateTimeInterface;
|
||||||
use sammo\Validator;
|
use sammo\Validator;
|
||||||
|
|
||||||
use function sammo\cutTurn;
|
|
||||||
use function sammo\pushGeneralCommand;
|
use function sammo\pushGeneralCommand;
|
||||||
|
|
||||||
class PushCommand extends \sammo\BaseAPI
|
class PushCommand extends \sammo\BaseAPI
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ use sammo\Session;
|
|||||||
use DateTimeInterface;
|
use DateTimeInterface;
|
||||||
use sammo\Validator;
|
use sammo\Validator;
|
||||||
|
|
||||||
use function sammo\cutTurn;
|
|
||||||
use function sammo\repeatGeneralCommand;
|
use function sammo\repeatGeneralCommand;
|
||||||
|
|
||||||
class RepeatCommand extends \sammo\BaseAPI
|
class RepeatCommand extends \sammo\BaseAPI
|
||||||
|
|||||||
@@ -3,19 +3,14 @@
|
|||||||
namespace sammo\API\Global;
|
namespace sammo\API\Global;
|
||||||
|
|
||||||
use sammo\DB;
|
use sammo\DB;
|
||||||
use sammo\General;
|
|
||||||
use sammo\Json;
|
use sammo\Json;
|
||||||
use sammo\KVStorage;
|
use sammo\KVStorage;
|
||||||
use sammo\RootDB;
|
use sammo\RootDB;
|
||||||
use sammo\Session;
|
use sammo\Session;
|
||||||
use sammo\Util;
|
|
||||||
use sammo\Validator;
|
|
||||||
|
|
||||||
use function sammo\calcLeadershipBonus;
|
use function sammo\calcLeadershipBonus;
|
||||||
use function sammo\checkLimit;
|
use function sammo\checkLimit;
|
||||||
use function sammo\checkSecretPermission;
|
|
||||||
use function sammo\getDed;
|
use function sammo\getDed;
|
||||||
use function sammo\getDedLevelText;
|
|
||||||
use function sammo\getExpLevel;
|
use function sammo\getExpLevel;
|
||||||
use function sammo\getGenChar;
|
use function sammo\getGenChar;
|
||||||
use function sammo\getGeneralSpecialDomesticName;
|
use function sammo\getGeneralSpecialDomesticName;
|
||||||
|
|||||||
@@ -2,29 +2,6 @@
|
|||||||
|
|
||||||
namespace sammo\API\Global;
|
namespace sammo\API\Global;
|
||||||
|
|
||||||
use sammo\DB;
|
|
||||||
use sammo\General;
|
|
||||||
use sammo\Json;
|
|
||||||
use sammo\KVStorage;
|
|
||||||
use sammo\RootDB;
|
|
||||||
use sammo\Session;
|
|
||||||
use sammo\Util;
|
|
||||||
use sammo\Validator;
|
|
||||||
|
|
||||||
use function sammo\calcLeadershipBonus;
|
|
||||||
use function sammo\checkLimit;
|
|
||||||
use function sammo\checkSecretPermission;
|
|
||||||
use function sammo\getDed;
|
|
||||||
use function sammo\getDedLevelText;
|
|
||||||
use function sammo\getExpLevel;
|
|
||||||
use function sammo\getGenChar;
|
|
||||||
use function sammo\getGeneralSpecialDomesticName;
|
|
||||||
use function sammo\getGeneralSpecialWarName;
|
|
||||||
use function sammo\getHonor;
|
|
||||||
use function sammo\getNationStaticInfo;
|
|
||||||
use function sammo\getOfficerLevelText;
|
|
||||||
use function sammo\increaseRefresh;
|
|
||||||
|
|
||||||
class GeneralListWithToken extends GeneralList
|
class GeneralListWithToken extends GeneralList
|
||||||
{
|
{
|
||||||
static $withToken = true;
|
static $withToken = true;
|
||||||
|
|||||||
@@ -7,14 +7,11 @@ use DateTimeInterface;
|
|||||||
use sammo\APICacheResult;
|
use sammo\APICacheResult;
|
||||||
use sammo\DB;
|
use sammo\DB;
|
||||||
use sammo\Json;
|
use sammo\Json;
|
||||||
use sammo\KVStorage;
|
|
||||||
use sammo\UniqueConst;
|
use sammo\UniqueConst;
|
||||||
use sammo\Util;
|
use sammo\Util;
|
||||||
use sammo\Validator;
|
use sammo\Validator;
|
||||||
|
|
||||||
use function sammo\checkLimit;
|
use function sammo\checkLimit;
|
||||||
use function sammo\getAllNationStaticInfo;
|
|
||||||
use function sammo\getNationStaticInfo;
|
|
||||||
use function sammo\increaseRefresh;
|
use function sammo\increaseRefresh;
|
||||||
use function sammo\templateLimitMsg;
|
use function sammo\templateLimitMsg;
|
||||||
|
|
||||||
|
|||||||
@@ -6,16 +6,12 @@ use sammo\DB;
|
|||||||
use sammo\General;
|
use sammo\General;
|
||||||
use sammo\Session;
|
use sammo\Session;
|
||||||
use sammo\Util;
|
use sammo\Util;
|
||||||
use sammo\Validator;
|
|
||||||
|
|
||||||
use function sammo\calcLeadershipBonus;
|
use function sammo\calcLeadershipBonus;
|
||||||
use function sammo\checkLimit;
|
use function sammo\checkLimit;
|
||||||
use function sammo\checkSecretPermission;
|
use function sammo\checkSecretPermission;
|
||||||
use function sammo\getBillByLevel;
|
use function sammo\getBillByLevel;
|
||||||
use function sammo\getDedLevelText;
|
use function sammo\getDedLevelText;
|
||||||
use function sammo\getGenChar;
|
|
||||||
use function sammo\getGeneralSpecialDomesticName;
|
|
||||||
use function sammo\getGeneralSpecialWarName;
|
|
||||||
use function sammo\getHonor;
|
use function sammo\getHonor;
|
||||||
use function sammo\getNationStaticInfo;
|
use function sammo\getNationStaticInfo;
|
||||||
use function sammo\getOfficerLevelText;
|
use function sammo\getOfficerLevelText;
|
||||||
|
|||||||
@@ -13,9 +13,7 @@ use sammo\TimeUtil;
|
|||||||
|
|
||||||
use function sammo\checkLimit;
|
use function sammo\checkLimit;
|
||||||
use function sammo\checkSecretPermission;
|
use function sammo\checkSecretPermission;
|
||||||
use function sammo\cutTurn;
|
|
||||||
use function sammo\getChiefCommandTable;
|
use function sammo\getChiefCommandTable;
|
||||||
use function sammo\getNationChiefLevel;
|
|
||||||
use function sammo\getOfficerLevelText;
|
use function sammo\getOfficerLevelText;
|
||||||
use function sammo\increaseRefresh;
|
use function sammo\increaseRefresh;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ use DateTimeInterface;
|
|||||||
use sammo\DB;
|
use sammo\DB;
|
||||||
use sammo\Validator;
|
use sammo\Validator;
|
||||||
|
|
||||||
use function sammo\cutTurn;
|
|
||||||
use function sammo\pushNationCommand;
|
use function sammo\pushNationCommand;
|
||||||
|
|
||||||
class PushCommand extends \sammo\BaseAPI
|
class PushCommand extends \sammo\BaseAPI
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ use DateTimeInterface;
|
|||||||
use sammo\DB;
|
use sammo\DB;
|
||||||
use sammo\Validator;
|
use sammo\Validator;
|
||||||
|
|
||||||
use function sammo\cutTurn;
|
|
||||||
use function sammo\repeatGeneralCommand;
|
|
||||||
use function sammo\repeatNationCommand;
|
use function sammo\repeatNationCommand;
|
||||||
|
|
||||||
class RepeatCommand extends \sammo\BaseAPI
|
class RepeatCommand extends \sammo\BaseAPI
|
||||||
|
|||||||
@@ -3,20 +3,13 @@
|
|||||||
namespace sammo\Command\General;
|
namespace sammo\Command\General;
|
||||||
|
|
||||||
use \sammo\DB;
|
use \sammo\DB;
|
||||||
use \sammo\Util;
|
|
||||||
use \sammo\JosaUtil;
|
use \sammo\JosaUtil;
|
||||||
use \sammo\General;
|
|
||||||
use \sammo\ActionLogger;
|
use \sammo\ActionLogger;
|
||||||
use \sammo\GameConst;
|
|
||||||
use \sammo\GameUnitConst;
|
|
||||||
use \sammo\LastTurn;
|
use \sammo\LastTurn;
|
||||||
use \sammo\Command;
|
use \sammo\Command;
|
||||||
|
|
||||||
use function sammo\getMapTheme;
|
|
||||||
use function \sammo\printCitiesBasedOnDistance;
|
|
||||||
use function sammo\tryUniqueItemLottery;
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use sammo\CityConst;
|
use sammo\CityConst;
|
||||||
|
|
||||||
|
|||||||
@@ -16,15 +16,12 @@ use \sammo\Json;
|
|||||||
use function \sammo\tryUniqueItemLottery;
|
use function \sammo\tryUniqueItemLottery;
|
||||||
use function \sammo\getAllNationStaticInfo;
|
use function \sammo\getAllNationStaticInfo;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use sammo\CityConst;
|
|
||||||
use sammo\Enums\InheritanceKey;
|
use sammo\Enums\InheritanceKey;
|
||||||
|
|
||||||
use function sammo\buildNationTypeClass;
|
use function sammo\buildNationTypeClass;
|
||||||
use function sammo\refreshNationStaticInfo;
|
use function sammo\refreshNationStaticInfo;
|
||||||
use function sammo\GetNationColors;
|
use function sammo\GetNationColors;
|
||||||
use function sammo\newColor;
|
|
||||||
|
|
||||||
|
|
||||||
class che_건국 extends Command\GeneralCommand
|
class che_건국 extends Command\GeneralCommand
|
||||||
|
|||||||
@@ -18,10 +18,8 @@ use \sammo\{
|
|||||||
|
|
||||||
use function \sammo\getAllNationStaticInfo;
|
use function \sammo\getAllNationStaticInfo;
|
||||||
use function \sammo\getNationStaticInfo;
|
use function \sammo\getNationStaticInfo;
|
||||||
use function \sammo\newColor;
|
|
||||||
use function sammo\tryUniqueItemLottery;
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,21 +2,12 @@
|
|||||||
namespace sammo\Command\General;
|
namespace sammo\Command\General;
|
||||||
|
|
||||||
use \sammo\{
|
use \sammo\{
|
||||||
DB, Util, JosaUtil,
|
DB, JosaUtil,
|
||||||
General, DummyGeneral,
|
General,
|
||||||
ActionLogger,
|
|
||||||
GameConst,
|
GameConst,
|
||||||
LastTurn,
|
|
||||||
Json,
|
|
||||||
GameUnitConst,
|
|
||||||
Command,
|
Command,
|
||||||
ScoutMessage
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use function \sammo\getAllNationStaticInfo;
|
|
||||||
use function \sammo\getNationStaticInfo;
|
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use sammo\Enums\InheritanceKey;
|
use sammo\Enums\InheritanceKey;
|
||||||
|
|
||||||
|
|||||||
@@ -5,21 +5,13 @@ namespace sammo\Command\General;
|
|||||||
use \sammo\DB;
|
use \sammo\DB;
|
||||||
use \sammo\Util;
|
use \sammo\Util;
|
||||||
use \sammo\JosaUtil;
|
use \sammo\JosaUtil;
|
||||||
use \sammo\Session;
|
|
||||||
use \sammo\KVStorage;
|
|
||||||
use \sammo\General;
|
|
||||||
use \sammo\ActionLogger;
|
|
||||||
use \sammo\GameConst;
|
|
||||||
use \sammo\GameUnitConst;
|
use \sammo\GameUnitConst;
|
||||||
use \sammo\LastTurn;
|
use \sammo\LastTurn;
|
||||||
use \sammo\Command;
|
use \sammo\Command;
|
||||||
use \sammo\ServConfig;
|
|
||||||
|
|
||||||
use function \sammo\getDexCall;
|
|
||||||
use function sammo\getDexLevelList;
|
use function sammo\getDexLevelList;
|
||||||
use function \sammo\tryUniqueItemLottery;
|
use function \sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,18 +2,13 @@
|
|||||||
namespace sammo\Command\General;
|
namespace sammo\Command\General;
|
||||||
|
|
||||||
use \sammo\{
|
use \sammo\{
|
||||||
DB, Util, JosaUtil,
|
DB,
|
||||||
General,
|
|
||||||
ActionLogger,
|
|
||||||
GameConst, GameUnitConst,
|
|
||||||
LastTurn,
|
LastTurn,
|
||||||
Command
|
Command
|
||||||
};
|
};
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
|
|
||||||
use function sammo\tryRollbackInheritUniqueItem;
|
|
||||||
use function sammo\tryUniqueItemLottery;
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
class che_은퇴 extends Command\GeneralCommand{
|
class che_은퇴 extends Command\GeneralCommand{
|
||||||
|
|||||||
@@ -3,20 +3,13 @@
|
|||||||
namespace sammo\Command\General;
|
namespace sammo\Command\General;
|
||||||
|
|
||||||
use \sammo\DB;
|
use \sammo\DB;
|
||||||
use \sammo\Util;
|
|
||||||
use \sammo\JosaUtil;
|
use \sammo\JosaUtil;
|
||||||
use \sammo\General;
|
|
||||||
use \sammo\ActionLogger;
|
use \sammo\ActionLogger;
|
||||||
use \sammo\GameConst;
|
|
||||||
use \sammo\GameUnitConst;
|
|
||||||
use \sammo\LastTurn;
|
use \sammo\LastTurn;
|
||||||
use \sammo\Command;
|
use \sammo\Command;
|
||||||
|
|
||||||
use function sammo\getMapTheme;
|
|
||||||
use function \sammo\printCitiesBasedOnDistance;
|
|
||||||
use function sammo\tryUniqueItemLottery;
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use sammo\CityConst;
|
use sammo\CityConst;
|
||||||
|
|
||||||
|
|||||||
@@ -6,23 +6,16 @@ use \sammo\{
|
|||||||
DB,
|
DB,
|
||||||
Util,
|
Util,
|
||||||
JosaUtil,
|
JosaUtil,
|
||||||
General,
|
|
||||||
ActionLogger,
|
|
||||||
GameConst,
|
GameConst,
|
||||||
GameUnitConst,
|
|
||||||
LastTurn,
|
LastTurn,
|
||||||
Command,
|
Command,
|
||||||
Json,
|
|
||||||
KVStorage
|
KVStorage
|
||||||
};
|
};
|
||||||
|
|
||||||
use function \sammo\tryUniqueItemLottery;
|
use function \sammo\tryUniqueItemLottery;
|
||||||
use function \sammo\getInvitationList;
|
|
||||||
use function \sammo\getNationStaticInfo;
|
use function \sammo\getNationStaticInfo;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use sammo\CityConst;
|
|
||||||
use sammo\Enums\InheritanceKey;
|
use sammo\Enums\InheritanceKey;
|
||||||
|
|
||||||
class che_임관 extends Command\GeneralCommand
|
class che_임관 extends Command\GeneralCommand
|
||||||
|
|||||||
@@ -13,14 +13,10 @@ use \sammo\{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use function sammo\getAllNationStaticInfo;
|
use function sammo\getAllNationStaticInfo;
|
||||||
use function \sammo\formatName;
|
|
||||||
use function \sammo\tryUniqueItemLottery;
|
use function \sammo\tryUniqueItemLottery;
|
||||||
use function \sammo\getInvitationList;
|
|
||||||
use function \sammo\getNationStaticInfo;
|
use function \sammo\getNationStaticInfo;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use sammo\CityConst;
|
|
||||||
use sammo\Enums\InheritanceKey;
|
use sammo\Enums\InheritanceKey;
|
||||||
|
|
||||||
class che_장수대상임관 extends Command\GeneralCommand{
|
class che_장수대상임관 extends Command\GeneralCommand{
|
||||||
|
|||||||
@@ -4,23 +4,16 @@ namespace sammo\Command\General;
|
|||||||
|
|
||||||
use \sammo\DB;
|
use \sammo\DB;
|
||||||
use \sammo\Util;
|
use \sammo\Util;
|
||||||
use \sammo\JosaUtil;
|
|
||||||
use \sammo\Session;
|
|
||||||
use \sammo\KVStorage;
|
|
||||||
use \sammo\General;
|
|
||||||
use \sammo\ActionLogger;
|
|
||||||
use \sammo\GameConst;
|
use \sammo\GameConst;
|
||||||
use \sammo\GameUnitConst;
|
use \sammo\GameUnitConst;
|
||||||
use \sammo\LastTurn;
|
use \sammo\LastTurn;
|
||||||
use \sammo\Command;
|
use \sammo\Command;
|
||||||
use \sammo\ServConfig;
|
use \sammo\ServConfig;
|
||||||
|
|
||||||
use function \sammo\getTechCall;
|
|
||||||
use function \sammo\tryUniqueItemLottery;
|
use function \sammo\tryUniqueItemLottery;
|
||||||
use function \sammo\getTechAbil;
|
use function \sammo\getTechAbil;
|
||||||
use function sammo\getTechLevel;
|
use function sammo\getTechLevel;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,19 +5,15 @@ namespace sammo\Command\General;
|
|||||||
use \sammo\DB;
|
use \sammo\DB;
|
||||||
use \sammo\Util;
|
use \sammo\Util;
|
||||||
use \sammo\JosaUtil;
|
use \sammo\JosaUtil;
|
||||||
use \sammo\General;
|
|
||||||
use \sammo\ActionLogger;
|
use \sammo\ActionLogger;
|
||||||
use \sammo\GameConst;
|
|
||||||
use \sammo\GameUnitConst;
|
use \sammo\GameUnitConst;
|
||||||
use \sammo\LastTurn;
|
use \sammo\LastTurn;
|
||||||
use \sammo\Command;
|
use \sammo\Command;
|
||||||
use \sammo\Json;
|
use \sammo\Json;
|
||||||
|
|
||||||
use function \sammo\searchDistance;
|
use function \sammo\searchDistance;
|
||||||
use function \sammo\printCitiesBasedOnDistance;
|
|
||||||
use function sammo\tryRollbackInheritUniqueItem;
|
use function sammo\tryRollbackInheritUniqueItem;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use sammo\CityConst;
|
use sammo\CityConst;
|
||||||
use sammo\Enums\InheritanceKey;
|
use sammo\Enums\InheritanceKey;
|
||||||
|
|||||||
@@ -8,15 +8,12 @@ use \sammo\JosaUtil;
|
|||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
use \sammo\ActionLogger;
|
use \sammo\ActionLogger;
|
||||||
use \sammo\GameConst;
|
use \sammo\GameConst;
|
||||||
use \sammo\GameUnitConst;
|
|
||||||
use \sammo\LastTurn;
|
use \sammo\LastTurn;
|
||||||
use \sammo\Command;
|
use \sammo\Command;
|
||||||
|
|
||||||
use function \sammo\searchDistance;
|
use function \sammo\searchDistance;
|
||||||
use function \sammo\printCitiesBasedOnDistance;
|
|
||||||
use function sammo\tryRollbackInheritUniqueItem;
|
use function sammo\tryRollbackInheritUniqueItem;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use sammo\CityConst;
|
use sammo\CityConst;
|
||||||
use sammo\Enums\RankColumn;
|
use sammo\Enums\RankColumn;
|
||||||
|
|||||||
@@ -3,27 +3,15 @@
|
|||||||
namespace sammo\Command\Nation;
|
namespace sammo\Command\Nation;
|
||||||
|
|
||||||
use \sammo\DB;
|
use \sammo\DB;
|
||||||
use \sammo\Util;
|
|
||||||
use \sammo\JosaUtil;
|
use \sammo\JosaUtil;
|
||||||
use \sammo\General;
|
|
||||||
use \sammo\DummyGeneral;
|
|
||||||
use \sammo\ActionLogger;
|
|
||||||
use \sammo\GameConst;
|
|
||||||
use \sammo\LastTurn;
|
use \sammo\LastTurn;
|
||||||
use \sammo\GameUnitConst;
|
|
||||||
use \sammo\Command;
|
use \sammo\Command;
|
||||||
use \sammo\MessageTarget;
|
|
||||||
use \sammo\Message;
|
|
||||||
use \sammo\CityConst;
|
|
||||||
use \sammo\Json;
|
use \sammo\Json;
|
||||||
|
|
||||||
use function \sammo\GetNationColors;
|
use function \sammo\GetNationColors;
|
||||||
use function \sammo\newColor;
|
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use sammo\Enums\InheritanceKey;
|
use sammo\Enums\InheritanceKey;
|
||||||
use sammo\Event\Action;
|
|
||||||
|
|
||||||
class che_국기변경 extends Command\NationCommand
|
class che_국기변경 extends Command\NationCommand
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property string $name
|
||||||
|
* @property string|null $info
|
||||||
|
*/
|
||||||
trait DefaultAction{
|
trait DefaultAction{
|
||||||
public function getName():string{
|
public function getName():string{
|
||||||
return $this->name;
|
return $this->name;
|
||||||
|
|||||||
@@ -142,10 +142,10 @@ class InheritancePointManager
|
|||||||
$storeType = $inheritType->storeType;
|
$storeType = $inheritType->storeType;
|
||||||
$multiplier = $inheritType->pointCoeff;
|
$multiplier = $inheritType->pointCoeff;
|
||||||
if ($storeType !== true) {
|
if ($storeType !== true) {
|
||||||
throw new \InvalidArgumentException("{$key}는 직접 저장형 유산 포인트가 아님");
|
throw new \InvalidArgumentException("{$key->value}는 직접 저장형 유산 포인트가 아님");
|
||||||
}
|
}
|
||||||
if ($multiplier != 1 && $value != 0) {
|
if ($multiplier != 1 && $value != 0) {
|
||||||
throw new \InvalidArgumentException("{$key}는 1:1 유산 포인트가 아님");
|
throw new \InvalidArgumentException("{$key->value}는 1:1 유산 포인트가 아님");
|
||||||
}
|
}
|
||||||
|
|
||||||
$ownerID = $general->getVar('owner');
|
$ownerID = $general->getVar('owner');
|
||||||
@@ -177,7 +177,7 @@ class InheritancePointManager
|
|||||||
$storeType = $inheritType->storeType;
|
$storeType = $inheritType->storeType;
|
||||||
$multiplier = $inheritType->pointCoeff;
|
$multiplier = $inheritType->pointCoeff;
|
||||||
if ($storeType !== true) {
|
if ($storeType !== true) {
|
||||||
throw new \InvalidArgumentException("{$key}는 직접 저장형 유산 포인트가 아님");
|
throw new \InvalidArgumentException("{$key->value}는 직접 저장형 유산 포인트가 아님");
|
||||||
}
|
}
|
||||||
|
|
||||||
$ownerID = $general->getVar('owner');
|
$ownerID = $general->getVar('owner');
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ class KVStorage
|
|||||||
$keys = Util::valuesFromEnumArray($keys);
|
$keys = Util::valuesFromEnumArray($keys);
|
||||||
|
|
||||||
if ($this->cacheData === null) {
|
if ($this->cacheData === null) {
|
||||||
return $this->getDBValues($keys);
|
return $this->getDBValues($keys)->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace sammo;
|
|||||||
//NOTE: JavaScript 버전과 일치
|
//NOTE: JavaScript 버전과 일치
|
||||||
const MAX_RNG_SUPPORT_BIT = 53;
|
const MAX_RNG_SUPPORT_BIT = 53;
|
||||||
if (PHP_INT_SIZE * 8 < MAX_RNG_SUPPORT_BIT) {
|
if (PHP_INT_SIZE * 8 < MAX_RNG_SUPPORT_BIT) {
|
||||||
throw new \RangeException("PHP not support {$MAX_RNG_SUPPORT_BIT} bit integer");
|
throw new \RangeException('PHP not support '.MAX_RNG_SUPPORT_BIT.' bit integer');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+2
-3
@@ -520,9 +520,8 @@ class Util extends \utilphp\util
|
|||||||
/**
|
/**
|
||||||
* 각 값의 비중에 따라 랜덤한 값을 선택.
|
* 각 값의 비중에 따라 랜덤한 값을 선택.
|
||||||
*
|
*
|
||||||
* @param array $items 각 수치와 비중. [값, weight] 으로 보관
|
* @param array<{0:array|object,1:float|int}> $items 각 수치와 비중. [값, weight] 으로 보관
|
||||||
*
|
* @return array|object 선택된 랜덤 값의 첫번째 값
|
||||||
* @return object 선택된 랜덤 값의 첫번째 값
|
|
||||||
*/
|
*/
|
||||||
public static function choiceRandomUsingWeightPair(array $items)
|
public static function choiceRandomUsingWeightPair(array $items)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user