Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6282445f7d | ||
|
|
bf244533f7 | ||
|
|
5ebfaf24ee | ||
|
|
0c0283dc02 | ||
|
|
375b08be87 | ||
|
|
cbc8f94b0a | ||
|
|
bdac8d163d | ||
|
|
1f61f37841 | ||
|
|
51d523ae72 | ||
|
|
3f9e4962e6 | ||
|
|
f8fc4fe56b | ||
|
|
fb64b7e412 | ||
|
|
3209cfbc45 | ||
|
|
8a99476136 | ||
|
|
eb80f8d111 | ||
|
|
afde3ce54d | ||
|
|
c4b61fec17 | ||
|
|
0b74abf300 | ||
|
|
e6c3c9f1d4 | ||
|
|
4e7560b4ed | ||
|
|
542491b278 | ||
|
|
d36439355d | ||
|
|
4a80815b39 | ||
|
|
6dc57f2566 | ||
|
|
07e8511ce1 | ||
|
|
8e927831f5 | ||
|
|
2c533d2ab3 | ||
|
|
38208750e7 | ||
|
|
df14d7c306 | ||
|
|
b3612db7d2 | ||
|
|
8d90da659e | ||
|
|
f8ddbc0622 | ||
|
|
673b7054aa | ||
|
|
1472cbf257 | ||
|
|
d806935c58 | ||
|
|
6b56eb79e1 | ||
|
|
d2aea16744 | ||
|
|
bb800f032e | ||
|
|
64b9f9443e | ||
|
|
fd2d3a0e06 | ||
|
|
08d678bdb8 | ||
|
|
418007e572 | ||
|
|
4a1bccdf75 | ||
|
|
00c0b59e9d | ||
|
|
ac82c8ff0b | ||
|
|
f4bef8a090 | ||
|
|
d8a1055bff | ||
|
|
d672ce4d80 | ||
|
|
43ec361d03 | ||
|
|
c3c99c5f76 | ||
|
|
eb1e1421ab | ||
|
|
e8a1d87919 | ||
|
|
921ba6811d | ||
|
|
906dd241b4 | ||
|
|
3f0cd2ad64 | ||
|
|
41420d1954 | ||
|
|
6e5a72b170 | ||
|
|
4b19e6aec8 | ||
|
|
58572cbc36 | ||
|
|
096d5766bf |
+36
-30
@@ -15,20 +15,34 @@ return [
|
|||||||
// Note that the **only** effect of choosing `'5.6'` is to infer
|
// Note that the **only** effect of choosing `'5.6'` is to infer
|
||||||
// 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" => '7.4',
|
"target_php_version" => '8.0',
|
||||||
'backward_compatibility_checks ' => true,
|
'backward_compatibility_checks ' => true,
|
||||||
'minimum_severity'=>\Phan\Issue::SEVERITY_CRITICAL,
|
'minimum_severity' => \Phan\Issue::SEVERITY_NORMAL,
|
||||||
|
|
||||||
'file_list' => [
|
'file_list' => [
|
||||||
'f_config/config.php',
|
'f_config/config.php',
|
||||||
|
'hwe/_119_b.php',
|
||||||
|
'hwe/_119.php',
|
||||||
'hwe/a_bestGeneral.php',
|
'hwe/a_bestGeneral.php',
|
||||||
'hwe/a_emperior.php',
|
'hwe/_admin1.php',
|
||||||
|
'hwe/_admin1_submit.php',
|
||||||
|
'hwe/_admin2.php',
|
||||||
|
'hwe/_admin2_submit.php',
|
||||||
|
'hwe/_admin4.php',
|
||||||
|
'hwe/_admin4_submit.php',
|
||||||
|
'hwe/_admin5.php',
|
||||||
|
'hwe/_admin5_submit.php',
|
||||||
|
'hwe/_admin7.php',
|
||||||
|
'hwe/_admin8.php',
|
||||||
|
'hwe/_admin_force_rehall.php',
|
||||||
'hwe/a_emperior_detail.php',
|
'hwe/a_emperior_detail.php',
|
||||||
|
'hwe/a_emperior.php',
|
||||||
'hwe/a_genList.php',
|
'hwe/a_genList.php',
|
||||||
'hwe/a_hallOfFame.php',
|
'hwe/a_hallOfFame.php',
|
||||||
'hwe/a_history.php',
|
'hwe/a_history.php',
|
||||||
'hwe/a_kingdomList.php',
|
'hwe/a_kingdomList.php',
|
||||||
'hwe/a_npcList.php',
|
'hwe/a_npcList.php',
|
||||||
|
'hwe/api.php',
|
||||||
'hwe/a_status.php',
|
'hwe/a_status.php',
|
||||||
'hwe/a_traffic.php',
|
'hwe/a_traffic.php',
|
||||||
'hwe/a_vote.php',
|
'hwe/a_vote.php',
|
||||||
@@ -41,13 +55,11 @@ return [
|
|||||||
'hwe/b_dipcenter.php',
|
'hwe/b_dipcenter.php',
|
||||||
'hwe/b_diplomacy.php',
|
'hwe/b_diplomacy.php',
|
||||||
'hwe/b_genList.php',
|
'hwe/b_genList.php',
|
||||||
'hwe/v_inheritPoint.php',
|
|
||||||
'hwe/b_myBossInfo.php',
|
'hwe/b_myBossInfo.php',
|
||||||
'hwe/b_myCityInfo.php',
|
'hwe/b_myCityInfo.php',
|
||||||
'hwe/b_myGenInfo.php',
|
'hwe/b_myGenInfo.php',
|
||||||
'hwe/b_myKingdomInfo.php',
|
'hwe/b_myKingdomInfo.php',
|
||||||
'hwe/b_myPage.php',
|
'hwe/b_myPage.php',
|
||||||
'hwe/b_npc_control.php',
|
|
||||||
'hwe/b_processing.php',
|
'hwe/b_processing.php',
|
||||||
'hwe/b_tournament.php',
|
'hwe/b_tournament.php',
|
||||||
'hwe/b_troop.php',
|
'hwe/b_troop.php',
|
||||||
@@ -55,7 +67,6 @@ return [
|
|||||||
'hwe/c_dipcenter.php',
|
'hwe/c_dipcenter.php',
|
||||||
'hwe/c_tournament.php',
|
'hwe/c_tournament.php',
|
||||||
'hwe/c_vote.php',
|
'hwe/c_vote.php',
|
||||||
'hwe/func.php',
|
|
||||||
'hwe/func_auction.php',
|
'hwe/func_auction.php',
|
||||||
'hwe/func_command.php',
|
'hwe/func_command.php',
|
||||||
'hwe/func_converter.php',
|
'hwe/func_converter.php',
|
||||||
@@ -64,16 +75,15 @@ return [
|
|||||||
'hwe/func_legacy.php',
|
'hwe/func_legacy.php',
|
||||||
'hwe/func_map.php',
|
'hwe/func_map.php',
|
||||||
'hwe/func_message.php',
|
'hwe/func_message.php',
|
||||||
|
'hwe/func.php',
|
||||||
'hwe/func_process.php',
|
'hwe/func_process.php',
|
||||||
'hwe/func_string.php',
|
'hwe/func_string.php',
|
||||||
'hwe/func_template.php',
|
'hwe/func_template.php',
|
||||||
'hwe/func_time_event.php',
|
'hwe/func_time_event.php',
|
||||||
'hwe/func_tournament.php',
|
'hwe/func_tournament.php',
|
||||||
'hwe/index.php',
|
'hwe/index.php',
|
||||||
'hwe/install.php',
|
|
||||||
'hwe/install_db.php',
|
'hwe/install_db.php',
|
||||||
'hwe/join.php',
|
'hwe/install.php',
|
||||||
'hwe/join_post.php',
|
|
||||||
'hwe/j_adjust_icon.php',
|
'hwe/j_adjust_icon.php',
|
||||||
'hwe/j_autoreset.php',
|
'hwe/j_autoreset.php',
|
||||||
'hwe/j_basic_info.php',
|
'hwe/j_basic_info.php',
|
||||||
@@ -92,8 +102,8 @@ return [
|
|||||||
'hwe/j_general_log_old.php',
|
'hwe/j_general_log_old.php',
|
||||||
'hwe/j_general_set_permission.php',
|
'hwe/j_general_set_permission.php',
|
||||||
'hwe/j_general_turn.php',
|
'hwe/j_general_turn.php',
|
||||||
'hwe/j_getChiefTurn.php',
|
|
||||||
'hwe/j_get_basic_general_list.php',
|
'hwe/j_get_basic_general_list.php',
|
||||||
|
'hwe/j_getChiefTurn.php',
|
||||||
'hwe/j_get_city_list.php',
|
'hwe/j_get_city_list.php',
|
||||||
'hwe/j_get_general_list.php',
|
'hwe/j_get_general_list.php',
|
||||||
'hwe/j_get_nation_general_list.php',
|
'hwe/j_get_nation_general_list.php',
|
||||||
@@ -101,11 +111,12 @@ return [
|
|||||||
'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_image_upload.php',
|
||||||
'hwe/j_install.php',
|
|
||||||
'hwe/j_install_db.php',
|
'hwe/j_install_db.php',
|
||||||
|
'hwe/j_install.php',
|
||||||
'hwe/j_load_scenarios.php',
|
'hwe/j_load_scenarios.php',
|
||||||
'hwe/j_map.php',
|
|
||||||
'hwe/j_map_history.php',
|
'hwe/j_map_history.php',
|
||||||
|
'hwe/j_map.php',
|
||||||
|
'hwe/j_map_recent.php',
|
||||||
'hwe/j_msg_contact_list.php',
|
'hwe/j_msg_contact_list.php',
|
||||||
'hwe/j_msg_decide_opt.php',
|
'hwe/j_msg_decide_opt.php',
|
||||||
'hwe/j_msg_delete.php',
|
'hwe/j_msg_delete.php',
|
||||||
@@ -123,26 +134,20 @@ return [
|
|||||||
'hwe/j_set_npc_control.php',
|
'hwe/j_set_npc_control.php',
|
||||||
'hwe/j_simulate_battle.php',
|
'hwe/j_simulate_battle.php',
|
||||||
'hwe/j_troop.php',
|
'hwe/j_troop.php',
|
||||||
|
'hwe/j_update_picked_general.php',
|
||||||
'hwe/j_vacation.php',
|
'hwe/j_vacation.php',
|
||||||
'hwe/lib.php',
|
'hwe/lib.php',
|
||||||
'hwe/process_war.php',
|
'hwe/process_war.php',
|
||||||
|
'hwe/proc.php',
|
||||||
|
'hwe/readme.php',
|
||||||
|
'hwe/recent_map.php',
|
||||||
'hwe/select_general_from_pool.php',
|
'hwe/select_general_from_pool.php',
|
||||||
'hwe/select_npc.php',
|
'hwe/select_npc.php',
|
||||||
'hwe/t_board.php',
|
|
||||||
'hwe/t_diplomacy.php',
|
'hwe/t_diplomacy.php',
|
||||||
'hwe/_119.php',
|
'hwe/v_board.php',
|
||||||
'hwe/_119_b.php',
|
'hwe/v_inheritPoint.php',
|
||||||
'hwe/_admin1.php',
|
'hwe/v_join.php',
|
||||||
'hwe/_admin1_submit.php',
|
'hwe/v_NPCControl.php',
|
||||||
'hwe/_admin2.php',
|
|
||||||
'hwe/_admin2_submit.php',
|
|
||||||
'hwe/_admin4.php',
|
|
||||||
'hwe/_admin4_submit.php',
|
|
||||||
'hwe/_admin5.php',
|
|
||||||
'hwe/_admin5_submit.php',
|
|
||||||
'hwe/_admin7.php',
|
|
||||||
'hwe/_admin8.php',
|
|
||||||
'hwe/_admin_force_rehall.php',
|
|
||||||
],
|
],
|
||||||
|
|
||||||
// A list of directories that should be parsed for class and
|
// A list of directories that should be parsed for class and
|
||||||
@@ -153,9 +158,9 @@ return [
|
|||||||
// Thus, both first-party and third-party code being used by
|
// Thus, both first-party and third-party code being used by
|
||||||
// your application should be included in this list.
|
// your application should be included in this list.
|
||||||
'directory_list' => [
|
'directory_list' => [
|
||||||
'hwe/d_setting',
|
'hwe/d_setting',
|
||||||
'hwe/sammo',
|
'hwe/sammo',
|
||||||
'd_setting',
|
'd_setting',
|
||||||
'src/sammo',
|
'src/sammo',
|
||||||
'src/kakao',
|
'src/kakao',
|
||||||
'vendor'
|
'vendor'
|
||||||
@@ -179,6 +184,7 @@ return [
|
|||||||
|
|
||||||
'suppress_issue_types' => [
|
'suppress_issue_types' => [
|
||||||
'PhanUnreferencedUseNormal',
|
'PhanUnreferencedUseNormal',
|
||||||
|
'PhanTypeArraySuspiciousNullable',
|
||||||
],
|
],
|
||||||
|
|
||||||
// A list of plugin files to execute.
|
// A list of plugin files to execute.
|
||||||
@@ -195,4 +201,4 @@ return [
|
|||||||
'PregRegexCheckerPlugin',
|
'PregRegexCheckerPlugin',
|
||||||
'PrintfCheckerPlugin',
|
'PrintfCheckerPlugin',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<title>닫혀 있습니다.</title>
|
<title>닫혀 있습니다.</title>
|
||||||
<script>
|
<script>
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
window.location = window.location+'/../';
|
window.location.href = '../';
|
||||||
}, 5000);
|
}, 5000);
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
background-color:black;
|
background-color:black;
|
||||||
color:yellow;
|
color:yellow;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -2,7 +2,11 @@
|
|||||||
|
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
require(__DIR__ . '/vendor/autoload.php');
|
||||||
include "func.php";
|
|
||||||
|
|
||||||
|
if (!class_exists('\\sammo\\RootDB')) {
|
||||||
|
Json::dieWithReason('No DB');
|
||||||
|
}
|
||||||
|
|
||||||
APIHelper::launch(dirname(__FILE__));
|
APIHelper::launch(dirname(__FILE__));
|
||||||
+5
-4
@@ -8,7 +8,7 @@
|
|||||||
],
|
],
|
||||||
"config": {
|
"config": {
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "7.4"
|
"php": "8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
"sergeytsalkov/meekrodb": "^2.3",
|
"sergeytsalkov/meekrodb": "^2.3",
|
||||||
"league/plates": "^3.3",
|
"league/plates": "^3.3",
|
||||||
"guzzlehttp/guzzle": "^6.3",
|
"guzzlehttp/guzzle": "^6.3",
|
||||||
"scssphp/scssphp": "^1.0",
|
|
||||||
"monolog/monolog": "^1.23",
|
"monolog/monolog": "^1.23",
|
||||||
"firephp/firephp-core": "^0.4.0",
|
"firephp/firephp-core": "^0.4.0",
|
||||||
"vlucas/valitron": "^1.4",
|
"vlucas/valitron": "^1.4",
|
||||||
@@ -28,7 +27,9 @@
|
|||||||
"catfan/medoo": "^1.5",
|
"catfan/medoo": "^1.5",
|
||||||
"phan/phan": "*",
|
"phan/phan": "*",
|
||||||
"erusev/parsedown-extra": "^0.8.1",
|
"erusev/parsedown-extra": "^0.8.1",
|
||||||
"nette/caching": "^3.0"
|
"nette/caching": "^3.0",
|
||||||
|
"illuminate/database": "^8.61",
|
||||||
|
"illuminate/events": "^8.61"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@@ -49,5 +50,5 @@
|
|||||||
"f_config/config.php"
|
"f_config/config.php"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+1133
-162
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "2aeb036fc53a6fdc343bd2707d4697ee",
|
"content-hash": "94cfbcb22b9f475e421ad5009391006f",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "brandonwamboldt/utilphp",
|
"name": "brandonwamboldt/utilphp",
|
||||||
@@ -122,16 +122,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "composer/semver",
|
"name": "composer/semver",
|
||||||
"version": "3.2.5",
|
"version": "3.2.6",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/composer/semver.git",
|
"url": "https://github.com/composer/semver.git",
|
||||||
"reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9"
|
"reference": "83e511e247de329283478496f7a1e114c9517506"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9",
|
"url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506",
|
||||||
"reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9",
|
"reference": "83e511e247de329283478496f7a1e114c9517506",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
"support": {
|
"support": {
|
||||||
"irc": "irc://irc.freenode.org/composer",
|
"irc": "irc://irc.freenode.org/composer",
|
||||||
"issues": "https://github.com/composer/semver/issues",
|
"issues": "https://github.com/composer/semver/issues",
|
||||||
"source": "https://github.com/composer/semver/tree/3.2.5"
|
"source": "https://github.com/composer/semver/tree/3.2.6"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -199,7 +199,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-05-24T12:41:47+00:00"
|
"time": "2021-10-25T11:34:17+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "composer/xdebug-handler",
|
"name": "composer/xdebug-handler",
|
||||||
@@ -265,6 +265,97 @@
|
|||||||
],
|
],
|
||||||
"time": "2021-07-31T17:03:58+00:00"
|
"time": "2021-07-31T17:03:58+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "doctrine/inflector",
|
||||||
|
"version": "2.0.4",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/doctrine/inflector.git",
|
||||||
|
"reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89",
|
||||||
|
"reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.2 || ^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"doctrine/coding-standard": "^8.2",
|
||||||
|
"phpstan/phpstan": "^0.12",
|
||||||
|
"phpstan/phpstan-phpunit": "^0.12",
|
||||||
|
"phpstan/phpstan-strict-rules": "^0.12",
|
||||||
|
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
|
||||||
|
"vimeo/psalm": "^4.10"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Doctrine\\Inflector\\": "lib/Doctrine/Inflector"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Guilherme Blanco",
|
||||||
|
"email": "guilhermeblanco@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Roman Borschel",
|
||||||
|
"email": "roman@code-factory.org"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Benjamin Eberlei",
|
||||||
|
"email": "kontakt@beberlei.de"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jonathan Wage",
|
||||||
|
"email": "jonwage@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Johannes Schmitt",
|
||||||
|
"email": "schmittjoh@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.",
|
||||||
|
"homepage": "https://www.doctrine-project.org/projects/inflector.html",
|
||||||
|
"keywords": [
|
||||||
|
"inflection",
|
||||||
|
"inflector",
|
||||||
|
"lowercase",
|
||||||
|
"manipulation",
|
||||||
|
"php",
|
||||||
|
"plural",
|
||||||
|
"singular",
|
||||||
|
"strings",
|
||||||
|
"uppercase",
|
||||||
|
"words"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/doctrine/inflector/issues",
|
||||||
|
"source": "https://github.com/doctrine/inflector/tree/2.0.4"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://www.doctrine-project.org/sponsorship.html",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://www.patreon.com/phpdoctrine",
|
||||||
|
"type": "patreon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2021-10-22T20:16:43+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "erusev/parsedown",
|
"name": "erusev/parsedown",
|
||||||
"version": "1.7.4",
|
"version": "1.7.4",
|
||||||
@@ -579,16 +670,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/promises",
|
"name": "guzzlehttp/promises",
|
||||||
"version": "1.4.1",
|
"version": "1.5.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/promises.git",
|
"url": "https://github.com/guzzle/promises.git",
|
||||||
"reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d"
|
"reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d",
|
"url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
|
||||||
"reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d",
|
"reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -600,7 +691,7 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.4-dev"
|
"dev-master": "1.5-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -616,10 +707,25 @@
|
|||||||
"MIT"
|
"MIT"
|
||||||
],
|
],
|
||||||
"authors": [
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Graham Campbell",
|
||||||
|
"email": "hello@gjcampbell.co.uk",
|
||||||
|
"homepage": "https://github.com/GrahamCampbell"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Michael Dowling",
|
"name": "Michael Dowling",
|
||||||
"email": "mtdowling@gmail.com",
|
"email": "mtdowling@gmail.com",
|
||||||
"homepage": "https://github.com/mtdowling"
|
"homepage": "https://github.com/mtdowling"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tobias Nyholm",
|
||||||
|
"email": "tobias.nyholm@gmail.com",
|
||||||
|
"homepage": "https://github.com/Nyholm"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tobias Schultze",
|
||||||
|
"email": "webmaster@tubo-world.de",
|
||||||
|
"homepage": "https://github.com/Tobion"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Guzzle promises library",
|
"description": "Guzzle promises library",
|
||||||
@@ -628,22 +734,36 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/guzzle/promises/issues",
|
"issues": "https://github.com/guzzle/promises/issues",
|
||||||
"source": "https://github.com/guzzle/promises/tree/1.4.1"
|
"source": "https://github.com/guzzle/promises/tree/1.5.1"
|
||||||
},
|
},
|
||||||
"time": "2021-03-07T09:25:29+00:00"
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/GrahamCampbell",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/Nyholm",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2021-10-22T20:56:57+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/psr7",
|
"name": "guzzlehttp/psr7",
|
||||||
"version": "1.8.2",
|
"version": "1.8.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/psr7.git",
|
"url": "https://github.com/guzzle/psr7.git",
|
||||||
"reference": "dc960a912984efb74d0a90222870c72c87f10c91"
|
"reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91",
|
"url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85",
|
||||||
"reference": "dc960a912984efb74d0a90222870c72c87f10c91",
|
"reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -680,13 +800,34 @@
|
|||||||
"MIT"
|
"MIT"
|
||||||
],
|
],
|
||||||
"authors": [
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Graham Campbell",
|
||||||
|
"email": "hello@gjcampbell.co.uk",
|
||||||
|
"homepage": "https://github.com/GrahamCampbell"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Michael Dowling",
|
"name": "Michael Dowling",
|
||||||
"email": "mtdowling@gmail.com",
|
"email": "mtdowling@gmail.com",
|
||||||
"homepage": "https://github.com/mtdowling"
|
"homepage": "https://github.com/mtdowling"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "George Mponos",
|
||||||
|
"email": "gmponos@gmail.com",
|
||||||
|
"homepage": "https://github.com/gmponos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tobias Nyholm",
|
||||||
|
"email": "tobias.nyholm@gmail.com",
|
||||||
|
"homepage": "https://github.com/Nyholm"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Márk Sági-Kazár",
|
||||||
|
"email": "mark.sagikazar@gmail.com",
|
||||||
|
"homepage": "https://github.com/sagikazarmark"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Tobias Schultze",
|
"name": "Tobias Schultze",
|
||||||
|
"email": "webmaster@tubo-world.de",
|
||||||
"homepage": "https://github.com/Tobion"
|
"homepage": "https://github.com/Tobion"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -703,9 +844,514 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/guzzle/psr7/issues",
|
"issues": "https://github.com/guzzle/psr7/issues",
|
||||||
"source": "https://github.com/guzzle/psr7/tree/1.8.2"
|
"source": "https://github.com/guzzle/psr7/tree/1.8.3"
|
||||||
},
|
},
|
||||||
"time": "2021-04-26T09:17:50+00:00"
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/GrahamCampbell",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/Nyholm",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2021-10-05T13:56:00+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "illuminate/bus",
|
||||||
|
"version": "v8.69.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/illuminate/bus.git",
|
||||||
|
"reference": "be400399687b97d5558a224e970060fd5d5f2735"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/illuminate/bus/zipball/be400399687b97d5558a224e970060fd5d5f2735",
|
||||||
|
"reference": "be400399687b97d5558a224e970060fd5d5f2735",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"illuminate/collections": "^8.0",
|
||||||
|
"illuminate/contracts": "^8.0",
|
||||||
|
"illuminate/pipeline": "^8.0",
|
||||||
|
"illuminate/support": "^8.0",
|
||||||
|
"php": "^7.3|^8.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"illuminate/queue": "Required to use closures when chaining jobs (^7.0)."
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "8.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Illuminate\\Bus\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Taylor Otwell",
|
||||||
|
"email": "taylor@laravel.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The Illuminate Bus package.",
|
||||||
|
"homepage": "https://laravel.com",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
|
"source": "https://github.com/laravel/framework"
|
||||||
|
},
|
||||||
|
"time": "2021-10-21T19:19:36+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "illuminate/collections",
|
||||||
|
"version": "v8.69.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/illuminate/collections.git",
|
||||||
|
"reference": "05f286ec5fd2dd286e8384577047efc375c8954c"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/illuminate/collections/zipball/05f286ec5fd2dd286e8384577047efc375c8954c",
|
||||||
|
"reference": "05f286ec5fd2dd286e8384577047efc375c8954c",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"illuminate/contracts": "^8.0",
|
||||||
|
"illuminate/macroable": "^8.0",
|
||||||
|
"php": "^7.3|^8.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"symfony/var-dumper": "Required to use the dump method (^5.1.4)."
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "8.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Illuminate\\Support\\": ""
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"helpers.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Taylor Otwell",
|
||||||
|
"email": "taylor@laravel.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The Illuminate Collections package.",
|
||||||
|
"homepage": "https://laravel.com",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
|
"source": "https://github.com/laravel/framework"
|
||||||
|
},
|
||||||
|
"time": "2021-10-22T18:01:46+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "illuminate/container",
|
||||||
|
"version": "v8.69.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/illuminate/container.git",
|
||||||
|
"reference": "ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/illuminate/container/zipball/ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d",
|
||||||
|
"reference": "ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"illuminate/contracts": "^8.0",
|
||||||
|
"php": "^7.3|^8.0",
|
||||||
|
"psr/container": "^1.0"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"psr/container-implementation": "1.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "8.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Illuminate\\Container\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Taylor Otwell",
|
||||||
|
"email": "taylor@laravel.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The Illuminate Container package.",
|
||||||
|
"homepage": "https://laravel.com",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
|
"source": "https://github.com/laravel/framework"
|
||||||
|
},
|
||||||
|
"time": "2021-09-15T14:32:50+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "illuminate/contracts",
|
||||||
|
"version": "v8.69.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/illuminate/contracts.git",
|
||||||
|
"reference": "e76f4bce73a2a1656add24bd5210ebc4b8af49c0"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/illuminate/contracts/zipball/e76f4bce73a2a1656add24bd5210ebc4b8af49c0",
|
||||||
|
"reference": "e76f4bce73a2a1656add24bd5210ebc4b8af49c0",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.3|^8.0",
|
||||||
|
"psr/container": "^1.0",
|
||||||
|
"psr/simple-cache": "^1.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "8.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Illuminate\\Contracts\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Taylor Otwell",
|
||||||
|
"email": "taylor@laravel.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The Illuminate Contracts package.",
|
||||||
|
"homepage": "https://laravel.com",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
|
"source": "https://github.com/laravel/framework"
|
||||||
|
},
|
||||||
|
"time": "2021-10-22T18:01:46+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "illuminate/database",
|
||||||
|
"version": "v8.69.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/illuminate/database.git",
|
||||||
|
"reference": "43c7ffb6299ae55b000b286cf1278afd268ef29f"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/illuminate/database/zipball/43c7ffb6299ae55b000b286cf1278afd268ef29f",
|
||||||
|
"reference": "43c7ffb6299ae55b000b286cf1278afd268ef29f",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-json": "*",
|
||||||
|
"illuminate/collections": "^8.0",
|
||||||
|
"illuminate/container": "^8.0",
|
||||||
|
"illuminate/contracts": "^8.0",
|
||||||
|
"illuminate/macroable": "^8.0",
|
||||||
|
"illuminate/support": "^8.0",
|
||||||
|
"php": "^7.3|^8.0",
|
||||||
|
"symfony/console": "^5.1.4"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.2).",
|
||||||
|
"fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).",
|
||||||
|
"illuminate/console": "Required to use the database commands (^8.0).",
|
||||||
|
"illuminate/events": "Required to use the observers with Eloquent (^8.0).",
|
||||||
|
"illuminate/filesystem": "Required to use the migrations (^8.0).",
|
||||||
|
"illuminate/pagination": "Required to paginate the result set (^8.0).",
|
||||||
|
"symfony/finder": "Required to use Eloquent model factories (^5.1.4)."
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "8.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Illuminate\\Database\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Taylor Otwell",
|
||||||
|
"email": "taylor@laravel.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The Illuminate Database package.",
|
||||||
|
"homepage": "https://laravel.com",
|
||||||
|
"keywords": [
|
||||||
|
"database",
|
||||||
|
"laravel",
|
||||||
|
"orm",
|
||||||
|
"sql"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
|
"source": "https://github.com/laravel/framework"
|
||||||
|
},
|
||||||
|
"time": "2021-10-29T19:46:53+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "illuminate/events",
|
||||||
|
"version": "v8.69.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/illuminate/events.git",
|
||||||
|
"reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/illuminate/events/zipball/b7f06cafb6c09581617f2ca05d69e9b159e5a35d",
|
||||||
|
"reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"illuminate/bus": "^8.0",
|
||||||
|
"illuminate/collections": "^8.0",
|
||||||
|
"illuminate/container": "^8.0",
|
||||||
|
"illuminate/contracts": "^8.0",
|
||||||
|
"illuminate/macroable": "^8.0",
|
||||||
|
"illuminate/support": "^8.0",
|
||||||
|
"php": "^7.3|^8.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "8.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Illuminate\\Events\\": ""
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"functions.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Taylor Otwell",
|
||||||
|
"email": "taylor@laravel.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The Illuminate Events package.",
|
||||||
|
"homepage": "https://laravel.com",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
|
"source": "https://github.com/laravel/framework"
|
||||||
|
},
|
||||||
|
"time": "2021-09-15T14:32:50+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "illuminate/macroable",
|
||||||
|
"version": "v8.69.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/illuminate/macroable.git",
|
||||||
|
"reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/illuminate/macroable/zipball/300aa13c086f25116b5f3cde3ca54ff5c822fb05",
|
||||||
|
"reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.3|^8.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "8.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Illuminate\\Support\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Taylor Otwell",
|
||||||
|
"email": "taylor@laravel.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The Illuminate Macroable package.",
|
||||||
|
"homepage": "https://laravel.com",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
|
"source": "https://github.com/laravel/framework"
|
||||||
|
},
|
||||||
|
"time": "2020-10-27T15:20:30+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "illuminate/pipeline",
|
||||||
|
"version": "v8.69.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/illuminate/pipeline.git",
|
||||||
|
"reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/illuminate/pipeline/zipball/23aeff5b26ae4aee3f370835c76bd0f4e93f71d2",
|
||||||
|
"reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"illuminate/contracts": "^8.0",
|
||||||
|
"illuminate/support": "^8.0",
|
||||||
|
"php": "^7.3|^8.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "8.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Illuminate\\Pipeline\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Taylor Otwell",
|
||||||
|
"email": "taylor@laravel.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The Illuminate Pipeline package.",
|
||||||
|
"homepage": "https://laravel.com",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
|
"source": "https://github.com/laravel/framework"
|
||||||
|
},
|
||||||
|
"time": "2021-03-26T18:39:16+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "illuminate/support",
|
||||||
|
"version": "v8.69.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/illuminate/support.git",
|
||||||
|
"reference": "a8851b7001530d3c11626a81449ed9b63dd10db7"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/illuminate/support/zipball/a8851b7001530d3c11626a81449ed9b63dd10db7",
|
||||||
|
"reference": "a8851b7001530d3c11626a81449ed9b63dd10db7",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"doctrine/inflector": "^1.4|^2.0",
|
||||||
|
"ext-json": "*",
|
||||||
|
"ext-mbstring": "*",
|
||||||
|
"illuminate/collections": "^8.0",
|
||||||
|
"illuminate/contracts": "^8.0",
|
||||||
|
"illuminate/macroable": "^8.0",
|
||||||
|
"nesbot/carbon": "^2.53.1",
|
||||||
|
"php": "^7.3|^8.0",
|
||||||
|
"voku/portable-ascii": "^1.4.8"
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"tightenco/collect": "<5.5.33"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"illuminate/filesystem": "Required to use the composer class (^8.0).",
|
||||||
|
"league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).",
|
||||||
|
"ramsey/uuid": "Required to use Str::uuid() (^4.2.2).",
|
||||||
|
"symfony/process": "Required to use the composer class (^5.1.4).",
|
||||||
|
"symfony/var-dumper": "Required to use the dd function (^5.1.4).",
|
||||||
|
"vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)."
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "8.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Illuminate\\Support\\": ""
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"helpers.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Taylor Otwell",
|
||||||
|
"email": "taylor@laravel.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The Illuminate Support package.",
|
||||||
|
"homepage": "https://laravel.com",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
|
"source": "https://github.com/laravel/framework"
|
||||||
|
},
|
||||||
|
"time": "2021-10-29T13:34:03+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/plates",
|
"name": "league/plates",
|
||||||
@@ -902,6 +1548,101 @@
|
|||||||
],
|
],
|
||||||
"time": "2021-05-28T08:32:12+00:00"
|
"time": "2021-05-28T08:32:12+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "nesbot/carbon",
|
||||||
|
"version": "2.54.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/briannesbitt/Carbon.git",
|
||||||
|
"reference": "eed83939f1aed3eee517d03a33f5ec587ac529b5"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/eed83939f1aed3eee517d03a33f5ec587ac529b5",
|
||||||
|
"reference": "eed83939f1aed3eee517d03a33f5ec587ac529b5",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-json": "*",
|
||||||
|
"php": "^7.1.8 || ^8.0",
|
||||||
|
"symfony/polyfill-mbstring": "^1.0",
|
||||||
|
"symfony/polyfill-php80": "^1.16",
|
||||||
|
"symfony/translation": "^3.4 || ^4.0 || ^5.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"doctrine/dbal": "^2.0 || ^3.0",
|
||||||
|
"doctrine/orm": "^2.7",
|
||||||
|
"friendsofphp/php-cs-fixer": "^3.0",
|
||||||
|
"kylekatarnls/multi-tester": "^2.0",
|
||||||
|
"phpmd/phpmd": "^2.9",
|
||||||
|
"phpstan/extension-installer": "^1.0",
|
||||||
|
"phpstan/phpstan": "^0.12.54",
|
||||||
|
"phpunit/phpunit": "^7.5.20 || ^8.5.14",
|
||||||
|
"squizlabs/php_codesniffer": "^3.4"
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"bin/carbon"
|
||||||
|
],
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-3.x": "3.x-dev",
|
||||||
|
"dev-master": "2.x-dev"
|
||||||
|
},
|
||||||
|
"laravel": {
|
||||||
|
"providers": [
|
||||||
|
"Carbon\\Laravel\\ServiceProvider"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"phpstan": {
|
||||||
|
"includes": [
|
||||||
|
"extension.neon"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Carbon\\": "src/Carbon/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Brian Nesbitt",
|
||||||
|
"email": "brian@nesbot.com",
|
||||||
|
"homepage": "https://markido.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "kylekatarnls",
|
||||||
|
"homepage": "https://github.com/kylekatarnls"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "An API extension for DateTime that supports 281 different languages.",
|
||||||
|
"homepage": "https://carbon.nesbot.com",
|
||||||
|
"keywords": [
|
||||||
|
"date",
|
||||||
|
"datetime",
|
||||||
|
"time"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/briannesbitt/Carbon/issues",
|
||||||
|
"source": "https://github.com/briannesbitt/Carbon"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://opencollective.com/Carbon",
|
||||||
|
"type": "open_collective"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/nesbot/carbon",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2021-11-01T21:22:20+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "netresearch/jsonmapper",
|
"name": "netresearch/jsonmapper",
|
||||||
"version": "v4.0.0",
|
"version": "v4.0.0",
|
||||||
@@ -1093,20 +1834,20 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nette/utils",
|
"name": "nette/utils",
|
||||||
"version": "v3.2.2",
|
"version": "v3.2.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/nette/utils.git",
|
"url": "https://github.com/nette/utils.git",
|
||||||
"reference": "967cfc4f9a1acd5f1058d76715a424c53343c20c"
|
"reference": "9cd80396ca58d7969ab44fc7afcf03624dfa526e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/nette/utils/zipball/967cfc4f9a1acd5f1058d76715a424c53343c20c",
|
"url": "https://api.github.com/repos/nette/utils/zipball/9cd80396ca58d7969ab44fc7afcf03624dfa526e",
|
||||||
"reference": "967cfc4f9a1acd5f1058d76715a424c53343c20c",
|
"reference": "9cd80396ca58d7969ab44fc7afcf03624dfa526e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2 <8.1"
|
"php": ">=7.2 <8.2"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"nette/di": "<3.0.6"
|
"nette/di": "<3.0.6"
|
||||||
@@ -1172,9 +1913,9 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/nette/utils/issues",
|
"issues": "https://github.com/nette/utils/issues",
|
||||||
"source": "https://github.com/nette/utils/tree/v3.2.2"
|
"source": "https://github.com/nette/utils/tree/v3.2.5"
|
||||||
},
|
},
|
||||||
"time": "2021-03-03T22:53:25+00:00"
|
"time": "2021-09-20T10:50:11+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "pguardiario/phpuri",
|
"name": "pguardiario/phpuri",
|
||||||
@@ -1206,16 +1947,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phan/phan",
|
"name": "phan/phan",
|
||||||
"version": "5.0.0",
|
"version": "5.2.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phan/phan.git",
|
"url": "https://github.com/phan/phan.git",
|
||||||
"reference": "f36b6b9a2f4143a25f35ce94d712ceb0527e9d90"
|
"reference": "d724bbb8fc3ba89179868bb5220ecdf6a9c1636b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phan/phan/zipball/f36b6b9a2f4143a25f35ce94d712ceb0527e9d90",
|
"url": "https://api.github.com/repos/phan/phan/zipball/d724bbb8fc3ba89179868bb5220ecdf6a9c1636b",
|
||||||
"reference": "f36b6b9a2f4143a25f35ce94d712ceb0527e9d90",
|
"reference": "d724bbb8fc3ba89179868bb5220ecdf6a9c1636b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1232,7 +1973,7 @@
|
|||||||
"symfony/console": "^3.2|^4.0|^5.0",
|
"symfony/console": "^3.2|^4.0|^5.0",
|
||||||
"symfony/polyfill-mbstring": "^1.11.0",
|
"symfony/polyfill-mbstring": "^1.11.0",
|
||||||
"symfony/polyfill-php80": "^1.20.0",
|
"symfony/polyfill-php80": "^1.20.0",
|
||||||
"tysonandre/var_representation_polyfill": "^0.0.2"
|
"tysonandre/var_representation_polyfill": "^0.0.2|^0.1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^8.5.0"
|
"phpunit/phpunit": "^8.5.0"
|
||||||
@@ -1279,9 +2020,9 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/phan/phan/issues",
|
"issues": "https://github.com/phan/phan/issues",
|
||||||
"source": "https://github.com/phan/phan/tree/5.0.0"
|
"source": "https://github.com/phan/phan/tree/5.2.1"
|
||||||
},
|
},
|
||||||
"time": "2021-08-01T18:17:28+00:00"
|
"time": "2021-09-15T00:08:40+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "php-extended/php-system",
|
"name": "php-extended/php-system",
|
||||||
@@ -1430,16 +2171,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpdocumentor/reflection-docblock",
|
"name": "phpdocumentor/reflection-docblock",
|
||||||
"version": "5.2.2",
|
"version": "5.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
||||||
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556"
|
"reference": "622548b623e81ca6d78b721c5e029f4ce664f170"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556",
|
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170",
|
||||||
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556",
|
"reference": "622548b623e81ca6d78b721c5e029f4ce664f170",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1450,7 +2191,8 @@
|
|||||||
"webmozart/assert": "^1.9.1"
|
"webmozart/assert": "^1.9.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"mockery/mockery": "~1.3.2"
|
"mockery/mockery": "~1.3.2",
|
||||||
|
"psalm/phar": "^4.8"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
@@ -1480,22 +2222,22 @@
|
|||||||
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
|
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
|
||||||
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master"
|
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0"
|
||||||
},
|
},
|
||||||
"time": "2020-09-03T19:13:55+00:00"
|
"time": "2021-10-19T17:43:47+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpdocumentor/type-resolver",
|
"name": "phpdocumentor/type-resolver",
|
||||||
"version": "1.4.0",
|
"version": "1.5.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpDocumentor/TypeResolver.git",
|
"url": "https://github.com/phpDocumentor/TypeResolver.git",
|
||||||
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0"
|
"reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
|
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae",
|
||||||
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
|
"reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1503,7 +2245,8 @@
|
|||||||
"phpdocumentor/reflection-common": "^2.0"
|
"phpdocumentor/reflection-common": "^2.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"ext-tokenizer": "*"
|
"ext-tokenizer": "*",
|
||||||
|
"psalm/phar": "^4.8"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
@@ -1529,26 +2272,26 @@
|
|||||||
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
|
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
|
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
|
||||||
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0"
|
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1"
|
||||||
},
|
},
|
||||||
"time": "2020-09-17T18:55:26+00:00"
|
"time": "2021-10-02T14:08:47+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/container",
|
"name": "psr/container",
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/php-fig/container.git",
|
"url": "https://github.com/php-fig/container.git",
|
||||||
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf"
|
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
|
"url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
|
||||||
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
|
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2.0"
|
"php": ">=7.4.0"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -1577,9 +2320,9 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/php-fig/container/issues",
|
"issues": "https://github.com/php-fig/container/issues",
|
||||||
"source": "https://github.com/php-fig/container/tree/1.1.1"
|
"source": "https://github.com/php-fig/container/tree/1.1.2"
|
||||||
},
|
},
|
||||||
"time": "2021-03-05T17:36:06+00:00"
|
"time": "2021-11-05T16:50:12+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/http-message",
|
"name": "psr/http-message",
|
||||||
@@ -1684,6 +2427,57 @@
|
|||||||
},
|
},
|
||||||
"time": "2021-05-03T11:20:27+00:00"
|
"time": "2021-05-03T11:20:27+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "psr/simple-cache",
|
||||||
|
"version": "1.0.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/php-fig/simple-cache.git",
|
||||||
|
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||||
|
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.0.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Psr\\SimpleCache\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "PHP-FIG",
|
||||||
|
"homepage": "http://www.php-fig.org/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Common interfaces for simple caching",
|
||||||
|
"keywords": [
|
||||||
|
"cache",
|
||||||
|
"caching",
|
||||||
|
"psr",
|
||||||
|
"psr-16",
|
||||||
|
"simple-cache"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/php-fig/simple-cache/tree/master"
|
||||||
|
},
|
||||||
|
"time": "2017-10-23T01:57:42+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "ralouphie/getallheaders",
|
"name": "ralouphie/getallheaders",
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
@@ -1730,23 +2524,23 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sabre/event",
|
"name": "sabre/event",
|
||||||
"version": "5.1.2",
|
"version": "5.1.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sabre-io/event.git",
|
"url": "https://github.com/sabre-io/event.git",
|
||||||
"reference": "c120bec57c17b6251a496efc82b732418b49d50a"
|
"reference": "d7da22897125d34d7eddf7977758191c06a74497"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sabre-io/event/zipball/c120bec57c17b6251a496efc82b732418b49d50a",
|
"url": "https://api.github.com/repos/sabre-io/event/zipball/d7da22897125d34d7eddf7977758191c06a74497",
|
||||||
"reference": "c120bec57c17b6251a496efc82b732418b49d50a",
|
"reference": "d7da22897125d34d7eddf7977758191c06a74497",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.1 || ^8.0"
|
"php": "^7.1 || ^8.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"friendsofphp/php-cs-fixer": "~2.16.1",
|
"friendsofphp/php-cs-fixer": "~2.17.1",
|
||||||
"phpstan/phpstan": "^0.12",
|
"phpstan/phpstan": "^0.12",
|
||||||
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
|
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
|
||||||
},
|
},
|
||||||
@@ -1792,80 +2586,7 @@
|
|||||||
"issues": "https://github.com/sabre-io/event/issues",
|
"issues": "https://github.com/sabre-io/event/issues",
|
||||||
"source": "https://github.com/fruux/sabre-event"
|
"source": "https://github.com/fruux/sabre-event"
|
||||||
},
|
},
|
||||||
"time": "2020-10-03T11:02:22+00:00"
|
"time": "2021-11-04T06:51:17+00:00"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "scssphp/scssphp",
|
|
||||||
"version": "v1.6.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/scssphp/scssphp.git",
|
|
||||||
"reference": "b83594e2323c5d6e80785df3f91b9d1d32aad530"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/scssphp/scssphp/zipball/b83594e2323c5d6e80785df3f91b9d1d32aad530",
|
|
||||||
"reference": "b83594e2323c5d6e80785df3f91b9d1d32aad530",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"ext-ctype": "*",
|
|
||||||
"ext-json": "*",
|
|
||||||
"php": ">=5.6.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"bamarni/composer-bin-plugin": "^1.4",
|
|
||||||
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3 || ^9.4",
|
|
||||||
"sass/sass-spec": "*",
|
|
||||||
"squizlabs/php_codesniffer": "~3.5",
|
|
||||||
"symfony/phpunit-bridge": "^5.1",
|
|
||||||
"twbs/bootstrap": "~5.0",
|
|
||||||
"twbs/bootstrap4": "4.6.0",
|
|
||||||
"zurb/foundation": "~6.5"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"ext-iconv": "Can be used as fallback when ext-mbstring is not available",
|
|
||||||
"ext-mbstring": "For best performance, mbstring should be installed as it is faster than ext-iconv"
|
|
||||||
},
|
|
||||||
"bin": [
|
|
||||||
"bin/pscss"
|
|
||||||
],
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"ScssPhp\\ScssPhp\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Anthon Pang",
|
|
||||||
"email": "apang@softwaredevelopment.ca",
|
|
||||||
"homepage": "https://github.com/robocoder"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Cédric Morin",
|
|
||||||
"email": "cedric@yterium.com",
|
|
||||||
"homepage": "https://github.com/Cerdic"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "scssphp is a compiler for SCSS written in PHP.",
|
|
||||||
"homepage": "http://scssphp.github.io/scssphp/",
|
|
||||||
"keywords": [
|
|
||||||
"css",
|
|
||||||
"less",
|
|
||||||
"sass",
|
|
||||||
"scss",
|
|
||||||
"stylesheet"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/scssphp/scssphp/issues",
|
|
||||||
"source": "https://github.com/scssphp/scssphp/tree/v1.6.0"
|
|
||||||
},
|
|
||||||
"time": "2021-07-02T16:28:10+00:00"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sergeytsalkov/meekrodb",
|
"name": "sergeytsalkov/meekrodb",
|
||||||
@@ -1917,16 +2638,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/console",
|
"name": "symfony/console",
|
||||||
"version": "v5.3.6",
|
"version": "v5.3.10",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/console.git",
|
"url": "https://github.com/symfony/console.git",
|
||||||
"reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2"
|
"reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2",
|
"url": "https://api.github.com/repos/symfony/console/zipball/d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3",
|
||||||
"reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2",
|
"reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1996,7 +2717,7 @@
|
|||||||
"terminal"
|
"terminal"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/console/tree/v5.3.6"
|
"source": "https://github.com/symfony/console/tree/v5.3.10"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -2012,7 +2733,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-07-27T19:10:22+00:00"
|
"time": "2021-10-26T09:30:15+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/deprecation-contracts",
|
"name": "symfony/deprecation-contracts",
|
||||||
@@ -2083,16 +2804,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/lock",
|
"name": "symfony/lock",
|
||||||
"version": "v4.4.27",
|
"version": "v4.4.33",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/lock.git",
|
"url": "https://github.com/symfony/lock.git",
|
||||||
"reference": "6ca476d4ac992802f2a4043929f68f1818449486"
|
"reference": "567d29b1bc6e3937652054dafc069151d17824a9"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/lock/zipball/6ca476d4ac992802f2a4043929f68f1818449486",
|
"url": "https://api.github.com/repos/symfony/lock/zipball/567d29b1bc6e3937652054dafc069151d17824a9",
|
||||||
"reference": "6ca476d4ac992802f2a4043929f68f1818449486",
|
"reference": "567d29b1bc6e3937652054dafc069151d17824a9",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -2141,7 +2862,7 @@
|
|||||||
"semaphore"
|
"semaphore"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/lock/tree/v4.4.27"
|
"source": "https://github.com/symfony/lock/tree/v4.4.33"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -2157,7 +2878,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-07-23T15:41:52+00:00"
|
"time": "2021-10-05T20:27:01+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-ctype",
|
"name": "symfony/polyfill-ctype",
|
||||||
@@ -2889,16 +3610,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/string",
|
"name": "symfony/string",
|
||||||
"version": "v5.3.3",
|
"version": "v5.3.10",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/string.git",
|
"url": "https://github.com/symfony/string.git",
|
||||||
"reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1"
|
"reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1",
|
"url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c",
|
||||||
"reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1",
|
"reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -2952,7 +3673,7 @@
|
|||||||
"utf8"
|
"utf8"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/string/tree/v5.3.3"
|
"source": "https://github.com/symfony/string/tree/v5.3.10"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -2968,20 +3689,193 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-06-27T11:44:38+00:00"
|
"time": "2021-10-27T18:21:46+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "tysonandre/var_representation_polyfill",
|
"name": "symfony/translation",
|
||||||
"version": "0.0.2",
|
"version": "v5.3.10",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/TysonAndre/var_representation_polyfill.git",
|
"url": "https://github.com/symfony/translation.git",
|
||||||
"reference": "3f17999ee1f257319ddc6721dd26ebbc5d175f33"
|
"reference": "6ef197aea2ac8b9cd63e0da7522b3771714035aa"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/TysonAndre/var_representation_polyfill/zipball/3f17999ee1f257319ddc6721dd26ebbc5d175f33",
|
"url": "https://api.github.com/repos/symfony/translation/zipball/6ef197aea2ac8b9cd63e0da7522b3771714035aa",
|
||||||
"reference": "3f17999ee1f257319ddc6721dd26ebbc5d175f33",
|
"reference": "6ef197aea2ac8b9cd63e0da7522b3771714035aa",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.2.5",
|
||||||
|
"symfony/deprecation-contracts": "^2.1",
|
||||||
|
"symfony/polyfill-mbstring": "~1.0",
|
||||||
|
"symfony/polyfill-php80": "^1.16",
|
||||||
|
"symfony/translation-contracts": "^2.3"
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"symfony/config": "<4.4",
|
||||||
|
"symfony/dependency-injection": "<5.0",
|
||||||
|
"symfony/http-kernel": "<5.0",
|
||||||
|
"symfony/twig-bundle": "<5.0",
|
||||||
|
"symfony/yaml": "<4.4"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"symfony/translation-implementation": "2.3"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"psr/log": "^1|^2|^3",
|
||||||
|
"symfony/config": "^4.4|^5.0",
|
||||||
|
"symfony/console": "^4.4|^5.0",
|
||||||
|
"symfony/dependency-injection": "^5.0",
|
||||||
|
"symfony/finder": "^4.4|^5.0",
|
||||||
|
"symfony/http-kernel": "^5.0",
|
||||||
|
"symfony/intl": "^4.4|^5.0",
|
||||||
|
"symfony/polyfill-intl-icu": "^1.21",
|
||||||
|
"symfony/service-contracts": "^1.1.2|^2",
|
||||||
|
"symfony/yaml": "^4.4|^5.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"psr/log-implementation": "To use logging capability in translator",
|
||||||
|
"symfony/config": "",
|
||||||
|
"symfony/yaml": ""
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"Resources/functions.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Component\\Translation\\": ""
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fabien Potencier",
|
||||||
|
"email": "fabien@symfony.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Provides tools to internationalize your application",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/translation/tree/v5.3.10"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2021-10-10T06:43:24+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/translation-contracts",
|
||||||
|
"version": "v2.4.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/translation-contracts.git",
|
||||||
|
"reference": "95c812666f3e91db75385749fe219c5e494c7f95"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/95c812666f3e91db75385749fe219c5e494c7f95",
|
||||||
|
"reference": "95c812666f3e91db75385749fe219c5e494c7f95",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.2.5"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"symfony/translation-implementation": ""
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-main": "2.4-dev"
|
||||||
|
},
|
||||||
|
"thanks": {
|
||||||
|
"name": "symfony/contracts",
|
||||||
|
"url": "https://github.com/symfony/contracts"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Contracts\\Translation\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Grekas",
|
||||||
|
"email": "p@tchwork.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Generic abstractions related to translation",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"keywords": [
|
||||||
|
"abstractions",
|
||||||
|
"contracts",
|
||||||
|
"decoupling",
|
||||||
|
"interfaces",
|
||||||
|
"interoperability",
|
||||||
|
"standards"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/translation-contracts/tree/v2.4.0"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2021-03-23T23:28:01+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "tysonandre/var_representation_polyfill",
|
||||||
|
"version": "0.1.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/TysonAndre/var_representation_polyfill.git",
|
||||||
|
"reference": "0a942e74e18af5514749895507bc6ca7ab96399a"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/TysonAndre/var_representation_polyfill/zipball/0a942e74e18af5514749895507bc6ca7ab96399a",
|
||||||
|
"reference": "0a942e74e18af5514749895507bc6ca7ab96399a",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -2992,6 +3886,9 @@
|
|||||||
"phan/phan": "^4.0",
|
"phan/phan": "^4.0",
|
||||||
"phpunit/phpunit": "^8.5.0"
|
"phpunit/phpunit": "^8.5.0"
|
||||||
},
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-var_representation": "*"
|
||||||
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@@ -3010,16 +3907,16 @@
|
|||||||
"name": "Tyson Andre"
|
"name": "Tyson Andre"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Polyfill for var_representation",
|
"description": "Polyfill for var_representation: convert a variable to a string in a way that fixes the shortcomings of var_export",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"var_export",
|
"var_export",
|
||||||
"var_representation"
|
"var_representation"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/TysonAndre/var_representation_polyfill/issues",
|
"issues": "https://github.com/TysonAndre/var_representation_polyfill/issues",
|
||||||
"source": "https://github.com/TysonAndre/var_representation_polyfill/tree/0.0.2"
|
"source": "https://github.com/TysonAndre/var_representation_polyfill/tree/0.1.1"
|
||||||
},
|
},
|
||||||
"time": "2021-06-26T18:55:02+00:00"
|
"time": "2021-08-16T00:12:50+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vlucas/valitron",
|
"name": "vlucas/valitron",
|
||||||
@@ -3080,6 +3977,80 @@
|
|||||||
],
|
],
|
||||||
"time": "2021-07-08T16:18:03+00:00"
|
"time": "2021-07-08T16:18:03+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "voku/portable-ascii",
|
||||||
|
"version": "1.5.6",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/voku/portable-ascii.git",
|
||||||
|
"reference": "80953678b19901e5165c56752d087fc11526017c"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/voku/portable-ascii/zipball/80953678b19901e5165c56752d087fc11526017c",
|
||||||
|
"reference": "80953678b19901e5165c56752d087fc11526017c",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.0.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-intl": "Use Intl for transliterator_transliterate() support"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"voku\\": "src/voku/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Lars Moelleken",
|
||||||
|
"homepage": "http://www.moelleken.org/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Portable ASCII library - performance optimized (ascii) string functions for php.",
|
||||||
|
"homepage": "https://github.com/voku/portable-ascii",
|
||||||
|
"keywords": [
|
||||||
|
"ascii",
|
||||||
|
"clean",
|
||||||
|
"php"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/voku/portable-ascii/issues",
|
||||||
|
"source": "https://github.com/voku/portable-ascii/tree/1.5.6"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://www.paypal.me/moelleken",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/voku",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://opencollective.com/portable-ascii",
|
||||||
|
"type": "open_collective"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://www.patreon.com/voku",
|
||||||
|
"type": "patreon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2020-11-12T00:07:28+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "webmozart/assert",
|
"name": "webmozart/assert",
|
||||||
"version": "1.10.0",
|
"version": "1.10.0",
|
||||||
@@ -3203,7 +4174,7 @@
|
|||||||
"platform": [],
|
"platform": [],
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
"platform-overrides": {
|
"platform-overrides": {
|
||||||
"php": "7.3"
|
"php": "8.0"
|
||||||
},
|
},
|
||||||
"plugin-api-version": "2.0.0"
|
"plugin-api-version": "2.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
+41
-16
@@ -15,35 +15,35 @@ ini_set("session.gc_maxlifetime", '604800'); // seconds
|
|||||||
function getFriendlyErrorType($type)
|
function getFriendlyErrorType($type)
|
||||||
{
|
{
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case E_ERROR: // 1 //
|
case E_ERROR: // 1 //
|
||||||
return 'E_ERROR';
|
return 'E_ERROR';
|
||||||
case E_WARNING: // 2 //
|
case E_WARNING: // 2 //
|
||||||
return 'E_WARNING';
|
return 'E_WARNING';
|
||||||
case E_PARSE: // 4 //
|
case E_PARSE: // 4 //
|
||||||
return 'E_PARSE';
|
return 'E_PARSE';
|
||||||
case E_NOTICE: // 8 //
|
case E_NOTICE: // 8 //
|
||||||
return 'E_NOTICE';
|
return 'E_NOTICE';
|
||||||
case E_CORE_ERROR: // 16 //
|
case E_CORE_ERROR: // 16 //
|
||||||
return 'E_CORE_ERROR';
|
return 'E_CORE_ERROR';
|
||||||
case E_CORE_WARNING: // 32 //
|
case E_CORE_WARNING: // 32 //
|
||||||
return 'E_CORE_WARNING';
|
return 'E_CORE_WARNING';
|
||||||
case E_COMPILE_ERROR: // 64 //
|
case E_COMPILE_ERROR: // 64 //
|
||||||
return 'E_COMPILE_ERROR';
|
return 'E_COMPILE_ERROR';
|
||||||
case E_COMPILE_WARNING: // 128 //
|
case E_COMPILE_WARNING: // 128 //
|
||||||
return 'E_COMPILE_WARNING';
|
return 'E_COMPILE_WARNING';
|
||||||
case E_USER_ERROR: // 256 //
|
case E_USER_ERROR: // 256 //
|
||||||
return 'E_USER_ERROR';
|
return 'E_USER_ERROR';
|
||||||
case E_USER_WARNING: // 512 //
|
case E_USER_WARNING: // 512 //
|
||||||
return 'E_USER_WARNING';
|
return 'E_USER_WARNING';
|
||||||
case E_USER_NOTICE: // 1024 //
|
case E_USER_NOTICE: // 1024 //
|
||||||
return 'E_USER_NOTICE';
|
return 'E_USER_NOTICE';
|
||||||
case E_STRICT: // 2048 //
|
case E_STRICT: // 2048 //
|
||||||
return 'E_STRICT';
|
return 'E_STRICT';
|
||||||
case E_RECOVERABLE_ERROR: // 4096 //
|
case E_RECOVERABLE_ERROR: // 4096 //
|
||||||
return 'E_RECOVERABLE_ERROR';
|
return 'E_RECOVERABLE_ERROR';
|
||||||
case E_DEPRECATED: // 8192 //
|
case E_DEPRECATED: // 8192 //
|
||||||
return 'E_DEPRECATED';
|
return 'E_DEPRECATED';
|
||||||
case E_USER_DEPRECATED: // 16384 //
|
case E_USER_DEPRECATED: // 16384 //
|
||||||
return 'E_USER_DEPRECATED';
|
return 'E_USER_DEPRECATED';
|
||||||
}
|
}
|
||||||
return "{$type}";
|
return "{$type}";
|
||||||
@@ -134,7 +134,7 @@ function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, in
|
|||||||
getExceptionTraceAsString($e)
|
getExceptionTraceAsString($e)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
set_error_handler("\sammo\logErrorByCustomHandler");
|
set_error_handler("\\sammo\\logErrorByCustomHandler");
|
||||||
|
|
||||||
|
|
||||||
function logExceptionByCustomHandler(\Throwable $e)
|
function logExceptionByCustomHandler(\Throwable $e)
|
||||||
@@ -151,3 +151,28 @@ function logExceptionByCustomHandler(\Throwable $e)
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
set_exception_handler('\\sammo\\logExceptionByCustomHandler');
|
set_exception_handler('\\sammo\\logExceptionByCustomHandler');
|
||||||
|
|
||||||
|
function getAPIExecutorClass($path){
|
||||||
|
|
||||||
|
static $basePath = __NAMESPACE__.'\\API\\';
|
||||||
|
if(is_string($path)){
|
||||||
|
}
|
||||||
|
else if(is_array($path)){
|
||||||
|
$path = join('\\', $path);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
throw new \InvalidArgumentException("{$path}는 올바른 API 지시자가 아님");
|
||||||
|
}
|
||||||
|
|
||||||
|
$classPath = str_replace('/', '\\', $basePath.$path);
|
||||||
|
|
||||||
|
if(class_exists($classPath)){
|
||||||
|
return $classPath;
|
||||||
|
}
|
||||||
|
throw new \InvalidArgumentException("{$path}는 올바른 API 경로가 아님");
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildAPIExecutorClass($type, string $rootPath, array $args):\sammo\BaseAPI{
|
||||||
|
$class = getAPIExecutorClass($type);
|
||||||
|
return new $class($rootPath, $args);
|
||||||
|
}
|
||||||
@@ -58,7 +58,7 @@ CREATE TABLE `member_log` (
|
|||||||
INDEX `action` (`member_no`, `action_type`, `date`),
|
INDEX `action` (`member_no`, `action_type`, `date`),
|
||||||
INDEX `member` (`member_no`, `date`)
|
INDEX `member` (`member_no`, `date`)
|
||||||
)
|
)
|
||||||
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
ENGINE=Aria DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# KV storage
|
# KV storage
|
||||||
@@ -72,4 +72,19 @@ CREATE TABLE if not exists `storage` (
|
|||||||
UNIQUE INDEX `key` (`namespace`, `key`)
|
UNIQUE INDEX `key` (`namespace`, `key`)
|
||||||
)
|
)
|
||||||
COLLATE='utf8mb4_general_ci'
|
COLLATE='utf8mb4_general_ci'
|
||||||
ENGINE=MyISAM
|
ENGINE=Aria;
|
||||||
|
|
||||||
|
CREATE TABLE `login_token` (
|
||||||
|
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`user_id` INT(11) NOT NULL,
|
||||||
|
`base_token` VARCHAR(20) NOT NULL COLLATE 'utf8mb4_general_ci',
|
||||||
|
`reg_ip` VARCHAR(40) NOT NULL COLLATE 'utf8mb4_general_ci',
|
||||||
|
`reg_date` DATETIME NOT NULL,
|
||||||
|
`expire_date` DATETIME NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE INDEX `by_token` (`base_token`),
|
||||||
|
INDEX `by_date` (`user_id`, `expire_date`)
|
||||||
|
)
|
||||||
|
COLLATE='utf8mb4_general_ci'
|
||||||
|
ENGINE=Aria
|
||||||
|
;
|
||||||
@@ -2,9 +2,15 @@
|
|||||||
|
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
|
//https://hub.packtpub.com/eloquent-without-laravel/
|
||||||
|
use Illuminate\Database\Capsule\Manager as Capsule;
|
||||||
|
use Illuminate\Events\Dispatcher;
|
||||||
|
use Illuminate\Container\Container;
|
||||||
|
|
||||||
class RootDB
|
class RootDB
|
||||||
{
|
{
|
||||||
private static $uDB = null;
|
private static $uDB = null;
|
||||||
|
private static ?Capsule $uIlluminate = null;
|
||||||
|
|
||||||
private static $host = '_tK_host_';
|
private static $host = '_tK_host_';
|
||||||
private static $user = '_tK_user_';
|
private static $user = '_tK_user_';
|
||||||
@@ -12,6 +18,8 @@ class RootDB
|
|||||||
private static $dbName = '_tK_dbName_';
|
private static $dbName = '_tK_dbName_';
|
||||||
private static $port = _tK_port_;
|
private static $port = _tK_port_;
|
||||||
private static $encoding = 'utf8mb4';
|
private static $encoding = 'utf8mb4';
|
||||||
|
private static $collation = 'utf8mb4_general_ci';
|
||||||
|
|
||||||
|
|
||||||
private static $globalSalt = '_tK_globalSalt_';
|
private static $globalSalt = '_tK_globalSalt_';
|
||||||
|
|
||||||
@@ -19,6 +27,29 @@ class RootDB
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function illuminate(): Capsule
|
||||||
|
{
|
||||||
|
if(self::$uIlluminate !== null){
|
||||||
|
return self::$uIlluminate;
|
||||||
|
}
|
||||||
|
$capsule = new Capsule;
|
||||||
|
|
||||||
|
$capsule->addConnection([
|
||||||
|
'driver' => 'mysql',
|
||||||
|
'host' => self::$host,
|
||||||
|
'database' => self::$dbName,
|
||||||
|
'username' => self::$user,
|
||||||
|
'password' => self::$password,
|
||||||
|
'charset' => self::$encoding,
|
||||||
|
'collation' => self::$collation,
|
||||||
|
], 'root');
|
||||||
|
|
||||||
|
$capsule->setEventDispatcher(new Dispatcher(new Container));
|
||||||
|
$capsule->bootEloquent();
|
||||||
|
self::$uIlluminate = $capsule;
|
||||||
|
return $capsule;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DB 객체 생성
|
* DB 객체 생성
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -342,6 +342,7 @@ switch ($btn) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "랜덤턴":
|
case "랜덤턴":
|
||||||
|
$turnterm = $gameStor->turnterm;
|
||||||
foreach ($genlist as $generalID) {
|
foreach ($genlist as $generalID) {
|
||||||
$turntime = getRandTurn($turnterm);
|
$turntime = getRandTurn($turnterm);
|
||||||
$db->update('general', [
|
$db->update('general', [
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ $scenarioList = (function(){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($scenarioIdx !== null && key_exists($scenarioIdx, $scenarioList)){
|
if($scenarioIdx && key_exists($scenarioIdx, $scenarioList[$seasonIdx]??[])){
|
||||||
$searchScenarioName = $scenarioList[$seasonIdx][$scenarioIdx]['name'];
|
$searchScenarioName = $scenarioList[$seasonIdx][$scenarioIdx]['name'];
|
||||||
$searchFilter = $db->sqleval('season = %i AND scenario = %i', $seasonIdx, $scenarioIdx);
|
$searchFilter = $db->sqleval('season = %i AND scenario = %i', $seasonIdx, $scenarioIdx);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
class DB{
|
//https://hub.packtpub.com/eloquent-without-laravel/
|
||||||
|
use Illuminate\Database\Capsule\Manager as Capsule;
|
||||||
|
use Illuminate\Events\Dispatcher;
|
||||||
|
use Illuminate\Container\Container;
|
||||||
|
|
||||||
|
class DB
|
||||||
|
{
|
||||||
private static $uDB = null;
|
private static $uDB = null;
|
||||||
|
private static ?Capsule $uIlluminate = null;
|
||||||
|
|
||||||
private static $host = '_tK_host_';
|
private static $host = '_tK_host_';
|
||||||
private static $user = '_tK_user_';
|
private static $user = '_tK_user_';
|
||||||
@@ -10,11 +18,36 @@ class DB{
|
|||||||
private static $dbName = '_tK_dbName_';
|
private static $dbName = '_tK_dbName_';
|
||||||
private static $port = _tK_port_;
|
private static $port = _tK_port_;
|
||||||
private static $encoding = 'utf8mb4';
|
private static $encoding = 'utf8mb4';
|
||||||
|
private static $collation = 'utf8mb4_general_ci';
|
||||||
|
|
||||||
private static $prefix = '_tK_prefix_';
|
private static $prefix = '_tK_prefix_';
|
||||||
|
|
||||||
private function __construct(){
|
private function __construct()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function illuminate(): Capsule
|
||||||
|
{
|
||||||
|
if(self::$uIlluminate !== null){
|
||||||
|
return self::$uIlluminate;
|
||||||
|
}
|
||||||
|
$capsule = new Capsule;
|
||||||
|
|
||||||
|
$capsule->addConnection([
|
||||||
|
'driver' => 'mysql',
|
||||||
|
'host' => self::$host,
|
||||||
|
'database' => self::$dbName,
|
||||||
|
'username' => self::$user,
|
||||||
|
'password' => self::$password,
|
||||||
|
'charset' => self::$encoding,
|
||||||
|
'collation' => self::$collation,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$capsule->setEventDispatcher(new Dispatcher(new Container));
|
||||||
|
$capsule->setAsGlobal();
|
||||||
|
$capsule->bootEloquent();
|
||||||
|
self::$uIlluminate = $capsule;
|
||||||
|
return $capsule;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,12 +56,14 @@ class DB{
|
|||||||
* @return \MeekroDB
|
* @return \MeekroDB
|
||||||
* @suppress PhanTypeMismatchProperty
|
* @suppress PhanTypeMismatchProperty
|
||||||
*/
|
*/
|
||||||
public static function db(){
|
public static function db()
|
||||||
if(self::$uDB === null){
|
{
|
||||||
self::$uDB = new \MeekroDB(self::$host,self::$user,self::$password,self::$dbName,self::$port,self::$encoding);
|
if (self::$uDB === null) {
|
||||||
|
self::$uDB = new \MeekroDB(self::$host, self::$user, self::$password, self::$dbName, self::$port, self::$encoding);
|
||||||
self::$uDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true;
|
self::$uDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true;
|
||||||
|
|
||||||
self::$uDB->error_handler= function(){};
|
self::$uDB->error_handler = function () {
|
||||||
|
};
|
||||||
self::$uDB->throw_exception_on_error = true;
|
self::$uDB->throw_exception_on_error = true;
|
||||||
self::$uDB->throw_exception_on_nonsql_error = true;
|
self::$uDB->throw_exception_on_nonsql_error = true;
|
||||||
}
|
}
|
||||||
@@ -39,4 +74,4 @@ class DB{
|
|||||||
{
|
{
|
||||||
return self::$prefix;
|
return self::$prefix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
<div class="buttonPlate bg1">
|
<div class="buttonPlate bg1">
|
||||||
<div>
|
<div>
|
||||||
<a href="a_status.php" target="_blank"><button class="toolbarButton">세력도</button></a>
|
<a href="a_status.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">세력도</button></a>
|
||||||
<a href="a_kingdomList.php" target="_blank"><button class="toolbarButton">세력일람</button></a>
|
<a href="a_kingdomList.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">세력일람</button></a>
|
||||||
<a href="a_genList.php" target="_blank"><button class="toolbarButton">장수일람</button></a>
|
<a href="a_genList.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">장수일람</button></a>
|
||||||
<a href="a_bestGeneral.php" target="_blank"><button class="toolbarButton">명장일람</button></a>
|
<a href="a_bestGeneral.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">명장일람</button></a>
|
||||||
<a href="a_history.php" target="_blank"><button class="toolbarButton">연감</button></a>
|
<a href="a_history.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">연감</button></a>
|
||||||
<a href="a_hallOfFame.php" target="_blank"><button class="toolbarButton">명예의전당</button></a>
|
<a href="a_hallOfFame.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">명예의전당</button></a>
|
||||||
<a href="a_emperior.php" target="_blank"><button class="toolbarButton">왕조일람</button></a>
|
<a href="a_emperior.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">왕조일람</button></a>
|
||||||
<a href="a_traffic.php" target="_blank"><button class="toolbarButton">접속량정보</button></a>
|
<a href="a_traffic.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">접속량정보</button></a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a href="/bbs/board" target="_blank"><button class="toolbarButton2">삼모게시판</button></a>
|
<a href="/bbs/board" target="_blank"><button type="button" class="toolbarButton2">삼모게시판</button></a>
|
||||||
<a href="/bbs/tip" target="_blank"><button class="toolbarButton">팁/강좌</button></a>
|
<a href="/bbs/tip" target="_blank"><button type="button" class="toolbarButton">팁/강좌</button></a>
|
||||||
<a href="/bbs/news" target="_blank"><button class="toolbarButton">삼국 일보</button></a>
|
<a href="/bbs/news" target="_blank"><button type="button" class="toolbarButton">삼국 일보</button></a>
|
||||||
<a href="/bbs/history2" target="_blank"><button class="toolbarButton">개인 열전</button></a>
|
<a href="/bbs/history2" target="_blank"><button type="button" class="toolbarButton">개인 열전</button></a>
|
||||||
<a href="/bbs/history3" target="_blank"><button class="toolbarButton">국가 열전</button></a>
|
<a href="/bbs/history3" target="_blank"><button type="button" class="toolbarButton">국가 열전</button></a>
|
||||||
<a href="/bbs/patch" target="_blank"><button class="toolbarButton">패치 내역</button></a>
|
<a href="/bbs/patch" target="_blank"><button type="button" class="toolbarButton">패치 내역</button></a>
|
||||||
<a href="../i_other/help.php" target="_blank"><button class="toolbarButton">튜토리얼</button></a>
|
<a href="battle_simulator.php" target="_blank"><button type="button" class="toolbarButton">전투 시뮬레이터</button></a>
|
||||||
<a href="<?=$site?>" target="_blank"><button class="toolbarButton"><?=$call?></button></a>
|
<a href="<?=$site?>" target="_blank" class="open-window"><button type="button" class="toolbarButton"><?=$call?></button></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+44
-20
@@ -1348,17 +1348,29 @@ function triggerTournament()
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['tournament', 'tnmt_trig']);
|
[$tournament, $tnmt_trig, $tnmt_pattern] = $gameStor->getValuesAsArray(['tournament', 'tnmt_trig', 'tnmt_pattern']);
|
||||||
|
|
||||||
//현재 토너먼트 없고, 자동개시 걸려있을때, 40%확률
|
//현재 토너먼트 없고, 자동개시 걸려있을때, 40%확률
|
||||||
if ($admin['tournament'] == 0 && $admin['tnmt_trig'] > 0 && rand() % 100 < 40) {
|
if($tournament != 0){
|
||||||
$type = rand() % 5; // 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전
|
return;
|
||||||
//전력전 40%, 통, 일, 설 각 20%
|
|
||||||
if ($type > 3) {
|
|
||||||
$type = 0;
|
|
||||||
}
|
|
||||||
startTournament($admin['tnmt_trig'], $type);
|
|
||||||
}
|
}
|
||||||
|
if($tnmt_trig == 0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!Util::randBool(0.4)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$tnmt_pattern){
|
||||||
|
// 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전
|
||||||
|
//전력전 40%, 통, 일, 설 각 20%
|
||||||
|
$tnmt_pattern = [0, 0, 1, 2, 3];
|
||||||
|
shuffle($tnmt_pattern);
|
||||||
|
}
|
||||||
|
|
||||||
|
$tnmt_type = array_pop($tnmt_pattern);
|
||||||
|
$gameStor->setValue('tnmt_pattern', $tnmt_pattern);
|
||||||
|
startTournament($tnmt_trig, $tnmt_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
function CheckHall($no)
|
function CheckHall($no)
|
||||||
@@ -1840,21 +1852,26 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$inheritUnique = $general->getAuxVar('inheritUniqueTrial');
|
$itemTypeCnt = count(GameConst::$allItems);
|
||||||
if ($acquireType != '설문조사' && $inheritUnique && count($inheritUnique)) {
|
|
||||||
LogText("유니크 준비?? {$general->getID()}", $inheritUnique);
|
[$startYear, $year] = $gameStor->getValuesAsArray(['startyear', 'year']);
|
||||||
$trialResult = tryInheritUniqueItem($general, $acquireType);
|
$relYear = $year - $startYear;
|
||||||
if ($trialResult) {
|
$maxTrialCountByYear = 1;
|
||||||
return true;
|
foreach(GameConst::$maxUniqueItemLimit as $tmpVals){
|
||||||
|
[$targetYear, $targetTrialCnt] = $tmpVals;
|
||||||
|
if($relYear < $targetYear){
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
$maxTrialCountByYear = $targetTrialCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
$itemTypeCnt = count(GameConst::$allItems);
|
$trialCnt = Util::valueFit($itemTypeCnt, null, $maxTrialCountByYear);
|
||||||
$trialCnt = $itemTypeCnt;
|
$maxCnt = $itemTypeCnt;
|
||||||
|
|
||||||
foreach ($general->getItems() as $item) {
|
foreach ($general->getItems() as $item) {
|
||||||
if (!$item->isBuyable()) {
|
if (!$item->isBuyable()) {
|
||||||
$trialCnt -= 1;
|
$trialCnt -= 1;
|
||||||
|
$maxCnt -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1866,10 +1883,17 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템
|
|||||||
$userLogger = new UserLogger($general->getVar('owner'));
|
$userLogger = new UserLogger($general->getVar('owner'));
|
||||||
$userLogger->push(sprintf("유니크를 얻을 공간이 없어 %d 포인트 반환", GameConst::$inheritItemRandomPoint), "inheritPoint");
|
$userLogger->push(sprintf("유니크를 얻을 공간이 없어 %d 포인트 반환", GameConst::$inheritItemRandomPoint), "inheritPoint");
|
||||||
}
|
}
|
||||||
|
tryRollbackInheritUniqueItem($general);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$inheritUnique = $general->getAuxVar('inheritUniqueTrial');
|
||||||
|
if ($acquireType != '설문조사' && $inheritUnique && count($inheritUnique)) {
|
||||||
|
$trialResult = tryInheritUniqueItem($general, $acquireType);
|
||||||
|
if ($trialResult) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$scenario = $gameStor->scenario;
|
$scenario = $gameStor->scenario;
|
||||||
$genCount = $db->queryFirstField('SELECT count(*) FROM general WHERE npc<2');
|
$genCount = $db->queryFirstField('SELECT count(*) FROM general WHERE npc<2');
|
||||||
@@ -1899,7 +1923,7 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템
|
|||||||
$prob = 1;
|
$prob = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Util::range($trialCnt) as $_idx) {
|
foreach (Util::range($maxCnt) as $_idx) {
|
||||||
if (Util::randBool($prob)) {
|
if (Util::randBool($prob)) {
|
||||||
$result = true;
|
$result = true;
|
||||||
break;
|
break;
|
||||||
@@ -1907,10 +1931,10 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템
|
|||||||
$prob *= $moreProb;
|
$prob *= $moreProb;
|
||||||
}
|
}
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
LogText("{$general->getName()}, {$general->getID()} 유니크 실패 {$trialCnt}", $prob);
|
LogText("{$general->getName()}, {$general->getID()} 유니크 실패 {$maxCnt}", $prob);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LogText("{$general->getName()}, {$general->getID()} 유니크 성공 {$trialCnt}", $prob);
|
LogText("{$general->getName()}, {$general->getID()} 유니크 성공 {$maxCnt}", $prob);
|
||||||
|
|
||||||
return giveRandomUniqueItem($general, $acquireType);
|
return giveRandomUniqueItem($general, $acquireType);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -357,31 +357,6 @@ function buildNationCommandClass(?string $type, General $generalObj, array $env,
|
|||||||
return new $class($generalObj, $env, $lastTurn, $arg);
|
return new $class($generalObj, $env, $lastTurn, $arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAPIExecutorClass($path){
|
|
||||||
|
|
||||||
static $basePath = __NAMESPACE__.'\\API\\';
|
|
||||||
if(is_string($path)){
|
|
||||||
}
|
|
||||||
else if(is_array($path)){
|
|
||||||
$path = join('\\', $path);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
throw new \InvalidArgumentException("{$path}는 올바른 API 지시자가 아님");
|
|
||||||
}
|
|
||||||
|
|
||||||
$classPath = str_replace('/', '\\', $basePath.$path);
|
|
||||||
|
|
||||||
if(class_exists($classPath)){
|
|
||||||
return $classPath;
|
|
||||||
}
|
|
||||||
throw new \InvalidArgumentException("{$path}는 올바른 API 경로가 아님");
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildAPIExecutorClass($type, string $rootPath, array $args):\sammo\BaseAPI{
|
|
||||||
$class = getAPIExecutorClass($type);
|
|
||||||
return new $class($rootPath, $args);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getWarUnitTriggerClass(string $type){
|
function getWarUnitTriggerClass(string $type){
|
||||||
static $basePath = __NAMESPACE__.'\\WarUnitTrigger\\';
|
static $basePath = __NAMESPACE__.'\\WarUnitTrigger\\';
|
||||||
$classPath = ($basePath.$type);
|
$classPath = ($basePath.$type);
|
||||||
|
|||||||
+63
-44
@@ -167,14 +167,15 @@ function checkSupply()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateGeneralNumber(){
|
function updateGeneralNumber()
|
||||||
|
{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
foreach($db->queryAllLists('SELECT nation, count(*) FROM general WHERE npc != 5 GROUP BY nation') as [$nationID, $gennum]){
|
foreach ($db->queryAllLists('SELECT nation, count(*) FROM general WHERE npc != 5 GROUP BY nation') as [$nationID, $gennum]) {
|
||||||
if($nationID === 0){
|
if ($nationID === 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$db->update('nation', [
|
$db->update('nation', [
|
||||||
'gennum'=>$gennum
|
'gennum' => $gennum
|
||||||
], 'nation=%i', $nationID);
|
], 'nation=%i', $nationID);
|
||||||
}
|
}
|
||||||
refreshNationStaticInfo();
|
refreshNationStaticInfo();
|
||||||
@@ -370,7 +371,11 @@ function postUpdateMonthly()
|
|||||||
sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop_max+agri_max+comm_max+secu_max+wall_max+def_max)/100
|
sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop_max+agri_max+comm_max+secu_max+wall_max+def_max)/100
|
||||||
) from city where nation=A.nation and supply=1
|
) from city where nation=A.nation and supply=1
|
||||||
))
|
))
|
||||||
+(select sum(leadership+strength+intel) from general where nation=A.nation)
|
+(select SUM((ra.value + 1000)/(rb.value + 1000)*(CASE WHEN g.`npc` < 2 THEN 1.5 ELSE 1 END)*(CASE WHEN g.`leadership` >= 40 THEN g.`leadership` ELSE 0 END)*2 + (SQRT(g.intel * g.strength) * 2 + g.leadership / 2)/2)
|
||||||
|
FROM general AS g
|
||||||
|
LEFT JOIN `rank_data` AS ra ON g.`no` = ra.general_id AND ra.`type` = \'killcrew_person\'
|
||||||
|
LEFT JOIN `rank_data` AS rb ON g.`no` = rb.general_id AND rb.`type` = \'deathcrew_person\'
|
||||||
|
WHERE g.nation = A.nation)
|
||||||
+(select round(sum(dex1+dex2+dex3+dex4+dex5)/1000) from general where nation=A.nation)
|
+(select round(sum(dex1+dex2+dex3+dex4+dex5)/1000) from general where nation=A.nation)
|
||||||
+(select round(sum(experience+dedication)/100) from general where nation=A.nation)
|
+(select round(sum(experience+dedication)/100) from general where nation=A.nation)
|
||||||
+(select round(avg(connect)) from general where nation=A.nation)
|
+(select round(avg(connect)) from general where nation=A.nation)
|
||||||
@@ -386,7 +391,7 @@ function postUpdateMonthly()
|
|||||||
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
||||||
$genNum[$nationID] = $nation['gennum'];
|
$genNum[$nationID] = $nation['gennum'];
|
||||||
|
|
||||||
$powerValues = $maxPowerValues[$nationID]??[];
|
$powerValues = $maxPowerValues[$nationID] ?? [];
|
||||||
|
|
||||||
//약간의 랜덤치 부여 (95% ~ 105%)
|
//약간의 랜덤치 부여 (95% ~ 105%)
|
||||||
|
|
||||||
@@ -405,7 +410,7 @@ function postUpdateMonthly()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 전쟁기한 세팅
|
// 전쟁기한 세팅
|
||||||
foreach($db->query('SELECT me, you, dead, term FROM diplomacy WHERE state = 0') as $dip) {
|
foreach ($db->query('SELECT me, you, dead, term FROM diplomacy WHERE state = 0') as $dip) {
|
||||||
$genCount = $genNum[$dip['me']];
|
$genCount = $genNum[$dip['me']];
|
||||||
// 25% 참여율일때 두당 10턴에 4000명 소모한다고 계산
|
// 25% 참여율일때 두당 10턴에 4000명 소모한다고 계산
|
||||||
// 4000 / 10 * 0.25 = 100
|
// 4000 / 10 * 0.25 = 100
|
||||||
@@ -420,7 +425,7 @@ function postUpdateMonthly()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//개전국 로그
|
//개전국 로그
|
||||||
foreach($db->query('SELECT me, you FROM diplomacy WHERE state = 1 AND term <= 1 AND me < you') as $dip){
|
foreach ($db->query('SELECT me, you FROM diplomacy WHERE state = 1 AND term <= 1 AND me < you') as $dip) {
|
||||||
$nation1 = getNationStaticInfo($dip['me']);
|
$nation1 = getNationStaticInfo($dip['me']);
|
||||||
$name1 = $nation1['name'];
|
$name1 = $nation1['name'];
|
||||||
$nation2 = getNationStaticInfo($dip['you']);
|
$nation2 = getNationStaticInfo($dip['you']);
|
||||||
@@ -432,14 +437,13 @@ function postUpdateMonthly()
|
|||||||
}
|
}
|
||||||
//휴전국 로그
|
//휴전국 로그
|
||||||
$stopWarList = [];
|
$stopWarList = [];
|
||||||
foreach($db->queryAllLists('SELECT me,you FROM diplomacy WHERE state=0 AND term <= 1 ORDER BY me desc, you desc') as [$me, $you]){
|
foreach ($db->queryAllLists('SELECT me,you FROM diplomacy WHERE state=0 AND term <= 1 ORDER BY me desc, you desc') as [$me, $you]) {
|
||||||
if($me < $you){
|
if ($me < $you) {
|
||||||
$key = "{$me}_{$you}";
|
$key = "{$me}_{$you}";
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$key = "{$you}_{$me}";
|
$key = "{$you}_{$me}";
|
||||||
}
|
}
|
||||||
if(!key_exists($key, $stopWarList)){
|
if (!key_exists($key, $stopWarList)) {
|
||||||
$stopWarList[$key] = true;
|
$stopWarList[$key] = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -455,8 +459,8 @@ function postUpdateMonthly()
|
|||||||
|
|
||||||
$globalLogger->pushGlobalHistoryLog("<R><b>【휴전】</b></><D><b>$name1</b></>{$josaWa} <D><b>$name2</b></>{$josaYi} <S>휴전</>합니다.");
|
$globalLogger->pushGlobalHistoryLog("<R><b>【휴전】</b></><D><b>$name1</b></>{$josaWa} <D><b>$name2</b></>{$josaYi} <S>휴전</>합니다.");
|
||||||
$db->update('diplomacy', [
|
$db->update('diplomacy', [
|
||||||
'state'=>2,
|
'state' => 2,
|
||||||
'term'=>0,
|
'term' => 0,
|
||||||
], '(me=%i AND you=%i) OR (you=%i AND me=%i)', $me, $you, $me, $you);
|
], '(me=%i AND you=%i) OR (you=%i AND me=%i)', $me, $you, $me, $you);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,17 +468,17 @@ function postUpdateMonthly()
|
|||||||
|
|
||||||
//사상자 초기화, 외교 기한-1
|
//사상자 초기화, 외교 기한-1
|
||||||
$db->update('diplomacy', [
|
$db->update('diplomacy', [
|
||||||
'dead'=>$db->sqleval('if(state!=0, 0, dead)'),
|
'dead' => $db->sqleval('if(state!=0, 0, dead)'),
|
||||||
'term'=>$db->sqleval('greatest(0, term-1)'),
|
'term' => $db->sqleval('greatest(0, term-1)'),
|
||||||
], true);
|
], true);
|
||||||
//불가침 끝나면 통상으로
|
//불가침 끝나면 통상으로
|
||||||
$db->update('diplomacy', [
|
$db->update('diplomacy', [
|
||||||
'state'=>2,
|
'state' => 2,
|
||||||
], 'state = 7 AND term = 0');
|
], 'state = 7 AND term = 0');
|
||||||
//선포 끝나면 교전으로
|
//선포 끝나면 교전으로
|
||||||
$db->update('diplomacy', [
|
$db->update('diplomacy', [
|
||||||
'state'=>0,
|
'state' => 0,
|
||||||
'term'=>6,
|
'term' => 6,
|
||||||
], 'state = 1 AND term = 0');
|
], 'state = 1 AND term = 0');
|
||||||
|
|
||||||
//초반이후 방랑군 자동 해체
|
//초반이후 방랑군 자동 해체
|
||||||
@@ -567,8 +571,8 @@ function updateNationState()
|
|||||||
|
|
||||||
$updateVals = [
|
$updateVals = [
|
||||||
'level' => $nationlevel,
|
'level' => $nationlevel,
|
||||||
'gold'=>$db->sqleval('gold + %i', $nationlevel*1000),
|
'gold' => $db->sqleval('gold + %i', $nationlevel * 1000),
|
||||||
'rice'=>$db->sqleval('rice + %i', $nationlevel*1000),
|
'rice' => $db->sqleval('rice + %i', $nationlevel * 1000),
|
||||||
];
|
];
|
||||||
|
|
||||||
switch ($nationlevel) {
|
switch ($nationlevel) {
|
||||||
@@ -624,14 +628,25 @@ function updateNationState()
|
|||||||
$targetKillTurn
|
$targetKillTurn
|
||||||
);
|
);
|
||||||
$nationGenList = General::createGeneralObjListFromDB($nationGenIDList, ['belong', 'npc', 'aux'], 2);
|
$nationGenList = General::createGeneralObjListFromDB($nationGenIDList, ['belong', 'npc', 'aux'], 2);
|
||||||
$chiefObj = null;
|
$chiefID = null;
|
||||||
|
|
||||||
$uniqueLotteryWeightList = [];
|
$uniqueLotteryWeightList = [];
|
||||||
|
|
||||||
|
[$startYear, $year] = $gameStor->getValuesAsArray(['startyear', 'year']);
|
||||||
|
$relYear = $year - $startYear;
|
||||||
|
$maxTrialCountByYear = 1;
|
||||||
|
foreach (GameConst::$maxUniqueItemLimit as $tmpVals) {
|
||||||
|
[$targetYear, $targetTrialCnt] = $tmpVals;
|
||||||
|
if ($relYear < $targetYear) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$maxTrialCountByYear = $targetTrialCnt;
|
||||||
|
}
|
||||||
foreach ($nationGenList as $nationGen) {
|
foreach ($nationGenList as $nationGen) {
|
||||||
if ($nationGen->getVar('officer_level') == 12) {
|
if ($nationGen->getVar('officer_level') == 12) {
|
||||||
$chiefObj = $nationGen;
|
$chiefID = $nationGen->getID();
|
||||||
}
|
}
|
||||||
$trialCnt = count(GameConst::$allItems);
|
$trialCnt = min($maxTrialCountByYear, count(GameConst::$allItems));
|
||||||
|
|
||||||
foreach ($nationGen->getItems() as $item) {
|
foreach ($nationGen->getItems() as $item) {
|
||||||
if (!$item->isBuyable()) {
|
if (!$item->isBuyable()) {
|
||||||
@@ -670,8 +685,10 @@ function updateNationState()
|
|||||||
$winnerObj->applyDB($db);
|
$winnerObj->applyDB($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($chiefObj){
|
if ($chiefID) {
|
||||||
|
$chiefObj = General::createGeneralObjFromDB($chiefID, ['belong', 'npc', 'aux'], 2);
|
||||||
$chiefObj->increaseInheritancePoint('unifier', 250 * $levelDiff);
|
$chiefObj->increaseInheritancePoint('unifier', 250 * $levelDiff);
|
||||||
|
$chiefObj->applyDB($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -699,9 +716,9 @@ function updateNationState()
|
|||||||
$nation['nation']
|
$nation['nation']
|
||||||
);
|
);
|
||||||
$npcObj->setAffinity(999)->setStat(10, 10, 10)
|
$npcObj->setAffinity(999)->setStat(10, 10, 10)
|
||||||
->setSpecialSingle('척사')->setEgo('che_은둔')
|
->setSpecialSingle('척사')->setEgo('che_은둔')
|
||||||
->setKillturn(70)->setGoldRice(0, 0)
|
->setKillturn(70)->setGoldRice(0, 0)
|
||||||
->setNPCType(5)->fillRemainSpecAsZero($admin);
|
->setNPCType(5)->fillRemainSpecAsZero($admin);
|
||||||
$npcObj->build($admin);
|
$npcObj->build($admin);
|
||||||
$npcID = $npcObj->getGeneralID();
|
$npcID = $npcObj->getGeneralID();
|
||||||
|
|
||||||
@@ -990,9 +1007,9 @@ function checkEmperior()
|
|||||||
$nationLogger = new ActionLogger(0, $nationID, $admin['year'], $admin['month']);
|
$nationLogger = new ActionLogger(0, $nationID, $admin['year'], $admin['month']);
|
||||||
$nationLogger->pushNationalHistoryLog("<D><b>{$nationName}</b></>{$josaYi} 전토를 통일");
|
$nationLogger->pushNationalHistoryLog("<D><b>{$nationName}</b></>{$josaYi} 전토를 통일");
|
||||||
|
|
||||||
foreach(General::createGeneralObjListFromDB($db->queryFirstColumn('SELECT `no` FROM general WHERE npc = 0')) as $genObj){
|
foreach (General::createGeneralObjListFromDB($db->queryFirstColumn('SELECT `no` FROM general WHERE npc = 0')) as $genObj) {
|
||||||
if($genObj->getNationID() == $nationID){
|
if ($genObj->getNationID() == $nationID) {
|
||||||
if($genObj->getVar('officer_level') > 4){
|
if ($genObj->getVar('officer_level') > 4) {
|
||||||
$genObj->increaseInheritancePoint('unifier', 2000);
|
$genObj->increaseInheritancePoint('unifier', 2000);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1008,7 +1025,7 @@ function checkEmperior()
|
|||||||
|
|
||||||
[$totalPop, $totalMaxPop] = $db->queryFirstList('SELECT SUM(pop), SUM(pop_max) FROM city');
|
[$totalPop, $totalMaxPop] = $db->queryFirstList('SELECT SUM(pop), SUM(pop_max) FROM city');
|
||||||
$pop = "{$totalPop} / {$totalMaxPop}";
|
$pop = "{$totalPop} / {$totalMaxPop}";
|
||||||
$poprate = round($totalPop / $totalMaxPop * 100, 2). " %";
|
$poprate = round($totalPop / $totalMaxPop * 100, 2) . " %";
|
||||||
|
|
||||||
$chiefs = Util::convertArrayToDict(
|
$chiefs = Util::convertArrayToDict(
|
||||||
$db->query(
|
$db->query(
|
||||||
@@ -1150,29 +1167,30 @@ function checkEmperior()
|
|||||||
LogHistory();
|
LogHistory();
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetInheritanceUser(int $userID, bool $isRebirth=false):float{
|
function resetInheritanceUser(int $userID, bool $isRebirth = false): float
|
||||||
|
{
|
||||||
$rebirthDegraded = [
|
$rebirthDegraded = [
|
||||||
'dex'=>0.5,
|
'dex' => 0.5,
|
||||||
];
|
];
|
||||||
|
|
||||||
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$userID}");
|
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$userID}");
|
||||||
$totalPoint = 0;
|
$totalPoint = 0;
|
||||||
$allPoints = $inheritStor->getAll();
|
$allPoints = $inheritStor->getAll();
|
||||||
if(!$allPoints || count($allPoints) == 0){
|
if (!$allPoints || count($allPoints) == 0) {
|
||||||
//비었으므로 리셋 안함
|
//비었으므로 리셋 안함
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if(count($allPoints) == 1 && key_exists('previous', $allPoints)){
|
if (count($allPoints) == 1 && key_exists('previous', $allPoints)) {
|
||||||
//이미 리셋되었으므로 리셋 안함
|
//이미 리셋되었으므로 리셋 안함
|
||||||
return $allPoints['previous'][0];
|
return $allPoints['previous'][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
$userLogger = new UserLogger($userID);
|
$userLogger = new UserLogger($userID);
|
||||||
|
|
||||||
$previousPoint = ($allPoints['previous']??[0,0])[0];
|
$previousPoint = ($allPoints['previous'] ?? [0, 0])[0];
|
||||||
|
|
||||||
foreach($allPoints as $key=>[$value,]){
|
foreach ($allPoints as $key => [$value,]) {
|
||||||
if($isRebirth && key_exists($key, $rebirthDegraded)){
|
if ($isRebirth && key_exists($key, $rebirthDegraded)) {
|
||||||
$value *= $rebirthDegraded[$key];
|
$value *= $rebirthDegraded[$key];
|
||||||
}
|
}
|
||||||
$keyText = General::INHERITANCE_KEY[$key][2];
|
$keyText = General::INHERITANCE_KEY[$key][2];
|
||||||
@@ -1188,13 +1206,14 @@ function resetInheritanceUser(int $userID, bool $isRebirth=false):float{
|
|||||||
return $totalPoint;
|
return $totalPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateMaxDomesticCritical(General $general, $score){
|
function updateMaxDomesticCritical(General $general, $score)
|
||||||
$maxDomesticCritical = $general->getAuxVar('max_domestic_critical')??0;
|
{
|
||||||
|
$maxDomesticCritical = $general->getAuxVar('max_domestic_critical') ?? 0;
|
||||||
$maxDomesticCritical += $score / 2;
|
$maxDomesticCritical += $score / 2;
|
||||||
$general->setAuxVar('max_domestic_critical', $maxDomesticCritical);
|
$general->setAuxVar('max_domestic_critical', $maxDomesticCritical);
|
||||||
|
|
||||||
$oldMaxDomesticCritical = $general->getInheritancePoint('max_domestic_critical');
|
$oldMaxDomesticCritical = $general->getInheritancePoint('max_domestic_critical');
|
||||||
if($maxDomesticCritical > $oldMaxDomesticCritical){
|
if ($maxDomesticCritical > $oldMaxDomesticCritical) {
|
||||||
$general->setInheritancePoint('max_domestic_critical', $maxDomesticCritical);
|
$general->setInheritancePoint('max_domestic_critical', $maxDomesticCritical);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-25
@@ -77,12 +77,6 @@ function pushProcessLog($log) {
|
|||||||
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_processlog.txt", $log);
|
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_processlog.txt", $log);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function pushStepLog($log) {
|
|
||||||
$date = date('Y_m_d');
|
|
||||||
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_steplog.txt", $log);
|
|
||||||
}
|
|
||||||
|
|
||||||
function pushLockLog($log) {
|
function pushLockLog($log) {
|
||||||
$date = date('Y_m_d');
|
$date = date('Y_m_d');
|
||||||
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_locklog.txt", $log);
|
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_locklog.txt", $log);
|
||||||
@@ -105,15 +99,15 @@ function formatHistoryToHTML(array $history, ?string $type=null):string{
|
|||||||
$result = [];
|
$result = [];
|
||||||
if($type){
|
if($type){
|
||||||
foreach($history as $seq=>$item){
|
foreach($history as $seq=>$item){
|
||||||
$result[] = "<div class='log_{$type}' id='log_{$type}_{$seq}' data-seq='{$seq}'>".ConvertLog($item).'</div>';
|
$result[] = "<div class='log_{$type}' id='log_{$type}_{$seq}' data-seq='{$seq}'>".ConvertLog($item).'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
foreach($history as $seq=>$item){
|
foreach($history as $seq=>$item){
|
||||||
$result[] = '<div>'.ConvertLog($item).'</div>';
|
$result[] = '<div>'.ConvertLog($item).'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return join('', $result);
|
return join('', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,7 +236,7 @@ function pushGeneralHistoryLog(int $generalID, ?array $history, $year=null, $mon
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
if($year === null || $month === null){
|
if($year === null || $month === null){
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
|
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
|
||||||
@@ -278,7 +272,7 @@ function pushNationHistoryLog(int $nationID, ?array $history, ?int $year=null, ?
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
if($year === null || $month === null){
|
if($year === null || $month === null){
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
|
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
|
||||||
@@ -304,7 +298,7 @@ function pushGlobalHistoryLog(?array $history, $year=null, $month=null) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
if($year === null || $month === null){
|
if($year === null || $month === null){
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
|
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
|
||||||
@@ -325,8 +319,8 @@ function getGlobalHistoryLogWithDate(int $year, int $month):array {
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
$texts = $db->queryFirstColumn(
|
$texts = $db->queryFirstColumn(
|
||||||
'SELECT `text` from world_history where nation_id = 0 AND year = %i and month = %i order by id desc',
|
'SELECT `text` from world_history where nation_id = 0 AND year = %i and month = %i order by id desc',
|
||||||
$year,
|
$year,
|
||||||
$month
|
$month
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -342,7 +336,7 @@ function pushGlobalActionLog(?array $history, ?int $year=null, ?int $month=null)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
if($year === null || $month === null){
|
if($year === null || $month === null){
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
|
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
|
||||||
@@ -366,8 +360,8 @@ function getGlobalActionLogWithDate(int $year, int $month):array {
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
$texts = $db->queryFirstColumn(
|
$texts = $db->queryFirstColumn(
|
||||||
'SELECT `text` from general_record where general_id = 0 AND log_type = "history" AND year = %i and month = %i order by id desc',
|
'SELECT `text` from general_record where general_id = 0 AND log_type = "history" AND year = %i and month = %i order by id desc',
|
||||||
$year,
|
$year,
|
||||||
$month
|
$month
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -378,8 +372,6 @@ function getGlobalActionLogWithDate(int $year, int $month):array {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function LogHistory($isFirst=0) {
|
function LogHistory($isFirst=0) {
|
||||||
if(STEP_LOG) pushStepLog(TimeUtil::now().', LogHistory Start');
|
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$obj = $gameStor->getValues(['startyear', 'year', 'month']);
|
$obj = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||||
@@ -401,16 +393,16 @@ function LogHistory($isFirst=0) {
|
|||||||
if($map['month'] == 0){
|
if($map['month'] == 0){
|
||||||
$map['month'] = 12;
|
$map['month'] = 12;
|
||||||
$map['year'] -= 1;
|
$map['year'] -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$year = $map['year'];
|
$year = $map['year'];
|
||||||
$month = $map['month'];
|
$month = $map['month'];
|
||||||
|
|
||||||
|
|
||||||
$globalHistory = getGlobalHistoryLogWithDate($year, $month);
|
$globalHistory = getGlobalHistoryLogWithDate($year, $month);
|
||||||
$globalAction = getGlobalActionLogWithDate($year, $month);
|
$globalAction = getGlobalActionLogWithDate($year, $month);
|
||||||
|
|
||||||
$nations = getAllNationStaticInfo();
|
$nations = getAllNationStaticInfo();
|
||||||
$nations[0] = getNationStaticInfo(0);
|
$nations[0] = getNationStaticInfo(0);
|
||||||
|
|
||||||
@@ -426,8 +418,6 @@ function LogHistory($isFirst=0) {
|
|||||||
return -($lhs['power']<=>$rhs['power']);
|
return -($lhs['power']<=>$rhs['power']);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(STEP_LOG) pushStepLog(TimeUtil::now().', contents collected');
|
|
||||||
|
|
||||||
$db->insert('ng_history', [
|
$db->insert('ng_history', [
|
||||||
'server_id' => UniqueConst::$serverID,
|
'server_id' => UniqueConst::$serverID,
|
||||||
'year' => $year,
|
'year' => $year,
|
||||||
@@ -438,6 +428,5 @@ function LogHistory($isFirst=0) {
|
|||||||
'nations' => Json::encode($nations),
|
'nations' => Json::encode($nations),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if(STEP_LOG) pushStepLog(TimeUtil::now().', LogHistory Finish');
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
+130
-88
@@ -8,8 +8,7 @@ function processTournament() {
|
|||||||
|
|
||||||
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'tnmt_auto', 'tnmt_time']);
|
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'tnmt_auto', 'tnmt_time']);
|
||||||
$now = new \DateTime();
|
$now = new \DateTime();
|
||||||
$admin['now'] = $now->format('Y-m-d H:i:s');
|
$offset = $now->getTimestamp() - (new \DateTime($admin['tnmt_time']))->getTimestamp();
|
||||||
$admin['offset'] = $now->getTimestamp() - (new \DateTime($admin['tnmt_time']))->getTimestamp();
|
|
||||||
|
|
||||||
//수동일땐 무시
|
//수동일땐 무시
|
||||||
if($admin['tnmt_auto'] == 0) { return; }
|
if($admin['tnmt_auto'] == 0) { return; }
|
||||||
@@ -18,99 +17,102 @@ function processTournament() {
|
|||||||
$tnmt = $admin['tournament'];
|
$tnmt = $admin['tournament'];
|
||||||
$phase = $admin['phase'];
|
$phase = $admin['phase'];
|
||||||
|
|
||||||
|
if($offset < 0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//현시간이 스탬프 지나친경우
|
//현시간이 스탬프 지나친경우
|
||||||
if($admin['offset'] >= 0) {
|
switch($admin['tnmt_auto']) {
|
||||||
switch($admin['tnmt_auto']) {
|
case 1: $unit = 720; break;
|
||||||
case 1: $unit = 720; break;
|
case 2: $unit = 420; break;
|
||||||
case 2: $unit = 420; break;
|
case 3: $unit = 180; break;
|
||||||
case 3: $unit = 180; break;
|
case 4: $unit = 60; break;
|
||||||
case 4: $unit = 60; break;
|
case 5: $unit = 30; break;
|
||||||
case 5: $unit = 30; break;
|
case 6: $unit = 15; break;
|
||||||
case 6: $unit = 15; break;
|
case 7: $unit = 5; break;
|
||||||
case 7: $unit = 5; break;
|
default: throw new MustNotBeReachedException();
|
||||||
default: throw new MustNotBeReachedException();
|
}
|
||||||
|
|
||||||
|
//업데이트 횟수
|
||||||
|
$iter = intdiv($offset, $unit) + 1;
|
||||||
|
|
||||||
|
for($i=0; $i < $iter; $i++) {
|
||||||
|
switch($tnmt) {
|
||||||
|
case 1: //신청 마감
|
||||||
|
fillLowGenAll();
|
||||||
|
$tnmt = 2; $phase = 0;
|
||||||
|
break;
|
||||||
|
case 2: //예선중
|
||||||
|
qualify($type, $tnmt, $phase); $phase++;
|
||||||
|
if($phase >= 56) { $tnmt = 3; $phase = 0; }
|
||||||
|
break;
|
||||||
|
case 3: //추첨중
|
||||||
|
selectionAll($type, $tnmt, $phase); $phase+=8;
|
||||||
|
if($phase >= 32) { $tnmt = 4; $phase = 0; }
|
||||||
|
break;
|
||||||
|
case 4: //본선중
|
||||||
|
finallySingle($type, $tnmt, $phase); $phase++;
|
||||||
|
if($phase >= 6) { $tnmt = 5; $phase = 0; }
|
||||||
|
break;
|
||||||
|
case 5: //배정중
|
||||||
|
final16set();
|
||||||
|
$tnmt = 6; $phase = 0;
|
||||||
|
startBetting();
|
||||||
|
break;
|
||||||
|
case 6: //베팅중
|
||||||
|
$tnmt = 7; $phase = 0;
|
||||||
|
break;
|
||||||
|
case 7: //16강중
|
||||||
|
finalFight($type, $tnmt, $phase, 16); $phase++;
|
||||||
|
if($phase >= 8) { $tnmt = 8; $phase = 0; }
|
||||||
|
break;
|
||||||
|
case 8: //8강중
|
||||||
|
finalFight($type, $tnmt, $phase, 8); $phase++;
|
||||||
|
if($phase >= 4) { $tnmt = 9; $phase = 0; }
|
||||||
|
break;
|
||||||
|
case 9: //4강중
|
||||||
|
finalFight($type, $tnmt, $phase, 4); $phase++;
|
||||||
|
if($phase >= 2) { $tnmt = 10; $phase = 0; }
|
||||||
|
break;
|
||||||
|
case 10: //결승중
|
||||||
|
finalFight($type, $tnmt, $phase, 2);
|
||||||
|
$tnmt = 0; $phase = 0;
|
||||||
|
setGift($type, $tnmt, $phase);
|
||||||
|
$i = $iter;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//업데이트 횟수
|
//베팅은 무조건 60페이즈후 진행(최대 1시간)
|
||||||
$iter = intdiv($admin['offset'], $unit) + 1;
|
if($tnmt == 6) {
|
||||||
|
$betTerm = $unit * 60;
|
||||||
|
if($betTerm > 3600) { $betTerm = 3600; }
|
||||||
|
//처리 초 더한 날짜
|
||||||
|
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i + $betTerm);
|
||||||
|
$gameStor->tournament = $tnmt;
|
||||||
|
$gameStor->phase = $phase;
|
||||||
|
$gameStor->tnmt_time = $dt;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for($i=0; $i < $iter; $i++) {
|
if($admin['tnmt_auto'] == 1) {
|
||||||
switch($tnmt) {
|
//처리 초 더한 날짜
|
||||||
case 1: //신청 마감
|
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i);
|
||||||
fillLowGenAll();
|
$hr = substr($dt, 11, 2);
|
||||||
$tnmt = 2; $phase = 0;
|
//지정시간대 넘어가면 중단 20~24시
|
||||||
break;
|
if($hr < 20) {
|
||||||
case 2: //예선중
|
$dt = substr($dt, 0, 11)."20:00:00";
|
||||||
qualify($type, $tnmt, $phase); $phase++;
|
|
||||||
if($phase >= 56) { $tnmt = 3; $phase = 0; }
|
|
||||||
break;
|
|
||||||
case 3: //추첨중
|
|
||||||
selectionAll($type, $tnmt, $phase); $phase+=8;
|
|
||||||
if($phase >= 32) { $tnmt = 4; $phase = 0; }
|
|
||||||
break;
|
|
||||||
case 4: //본선중
|
|
||||||
finallySingle($type, $tnmt, $phase); $phase++;
|
|
||||||
if($phase >= 6) { $tnmt = 5; $phase = 0; }
|
|
||||||
break;
|
|
||||||
case 5: //배정중
|
|
||||||
final16set();
|
|
||||||
$tnmt = 6; $phase = 0;
|
|
||||||
break;
|
|
||||||
case 6: //베팅중
|
|
||||||
$tnmt = 7; $phase = 0;
|
|
||||||
break;
|
|
||||||
case 7: //16강중
|
|
||||||
finalFight($type, $tnmt, $phase, 16); $phase++;
|
|
||||||
if($phase >= 8) { $tnmt = 8; $phase = 0; }
|
|
||||||
break;
|
|
||||||
case 8: //8강중
|
|
||||||
finalFight($type, $tnmt, $phase, 8); $phase++;
|
|
||||||
if($phase >= 4) { $tnmt = 9; $phase = 0; }
|
|
||||||
break;
|
|
||||||
case 9: //4강중
|
|
||||||
finalFight($type, $tnmt, $phase, 4); $phase++;
|
|
||||||
if($phase >= 2) { $tnmt = 10; $phase = 0; }
|
|
||||||
break;
|
|
||||||
case 10: //결승중
|
|
||||||
finalFight($type, $tnmt, $phase, 2);
|
|
||||||
$tnmt = 0; $phase = 0;
|
|
||||||
setGift($type, $tnmt, $phase);
|
|
||||||
$i = $iter;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//베팅은 무조건 60페이즈후 진행(최대 1시간)
|
|
||||||
if($tnmt == 6) {
|
|
||||||
$betTerm = $unit * 60;
|
|
||||||
if($betTerm > 3600) { $betTerm = 3600; }
|
|
||||||
//처리 초 더한 날짜
|
|
||||||
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i + $betTerm);
|
|
||||||
$gameStor->tournament = $tnmt;
|
$gameStor->tournament = $tnmt;
|
||||||
$gameStor->phase = $phase;
|
$gameStor->phase = $phase;
|
||||||
$gameStor->tnmt_time = $dt;
|
$gameStor->tnmt_time = $dt;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($admin['tnmt_auto'] == 1) {
|
|
||||||
//처리 초 더한 날짜
|
|
||||||
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i);
|
|
||||||
$hr = substr($dt, 11, 2);
|
|
||||||
//지정시간대 넘어가면 중단 20~24시
|
|
||||||
if($hr < 20) {
|
|
||||||
$dt = substr($dt, 0, 11)."20:00:00";
|
|
||||||
$gameStor->tournament = $tnmt;
|
|
||||||
$gameStor->phase = $phase;
|
|
||||||
$gameStor->tnmt_time = $dt;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$second = $unit * $iter;
|
|
||||||
$gameStor->tournament = $tnmt;
|
|
||||||
$gameStor->phase = $phase;
|
|
||||||
$gameStor->tnmt_time = (new \DateTimeImmutable($admin['tnmt_time']))->add(new \DateInterval("PT{$second}S"))->format('Y-m-d H:i:s');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$second = $unit * $iter;
|
||||||
|
$gameStor->tournament = $tnmt;
|
||||||
|
$gameStor->phase = $phase;
|
||||||
|
$gameStor->tnmt_time = (new \DateTimeImmutable($admin['tnmt_time']))->add(new \DateInterval("PT{$second}S"))->format('Y-m-d H:i:s');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTournamentTerm() {
|
function getTournamentTerm() {
|
||||||
@@ -296,11 +298,51 @@ function startTournament($auto, $type) {
|
|||||||
['설전','책사'],
|
['설전','책사'],
|
||||||
][$type];
|
][$type];
|
||||||
|
|
||||||
$history[] = "<S>◆</>{$admin['year']}년 {$admin['month']}월:{$openerText}<C>{$typeText}</> 대회가 개최됩니다! 천하의 <span class='ev_highlight'>{$genTypeText}</span>들을 모집하고 있습니다!";
|
$history[] = "<S>◆</>{$admin['year']}년 {$admin['month']}월:<B><b>【대회】</b></>{$openerText}<C>{$typeText}</> 대회가 개최됩니다! 천하의 <span class='ev_highlight'>{$genTypeText}</span>들을 모집하고 있습니다!";
|
||||||
|
|
||||||
pushGlobalHistoryLog($history, $admin['year'], $admin['month']);
|
pushGlobalHistoryLog($history, $admin['year'], $admin['month']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function startBetting(){
|
||||||
|
$db = DB::db();
|
||||||
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
|
||||||
|
pushGlobalHistoryLog([
|
||||||
|
"<S>◆</>{$year}년 {$month}월:<B><b>【대회】</b></>우승자를 예상하는 <C>내기</>가 진행중입니다! 호사가의 참여를 기다립니다!"
|
||||||
|
], $year, $month);
|
||||||
|
|
||||||
|
$betGold = 10;
|
||||||
|
|
||||||
|
$npcList = $db->queryFirstColumn('SELECT no FROM general WHERE npc >= 2 AND gold >= (500 + %i)', $betGold);
|
||||||
|
$npcBet = [];
|
||||||
|
$betSum = [
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach($npcList as $npcID){
|
||||||
|
$target = Util::randRangeInt(0, 15);
|
||||||
|
$betSum[$target] += $betGold;
|
||||||
|
$npcBet[] = [$npcID, $target];
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->update('general', [
|
||||||
|
'gold'=>$db->sqleval('gold - %i', $betGold),
|
||||||
|
], 'no IN %li', $npcList);
|
||||||
|
foreach($npcBet as [$npcID, $betTarget]){
|
||||||
|
$targetKey = "bet{$betTarget}";
|
||||||
|
$db->update('betting', [
|
||||||
|
"bet{$betTarget}"=>$db->sqleval('%b + %i', $targetKey, $betGold),
|
||||||
|
], 'general_id = %i', $npcID);
|
||||||
|
}
|
||||||
|
foreach($betSum as $betTarget=>$betSumGold){
|
||||||
|
$targetKey = "bet{$betTarget}";
|
||||||
|
$db->update('betting', [
|
||||||
|
"bet{$betTarget}"=>$db->sqleval('%b + %i', $targetKey, $betSumGold),
|
||||||
|
], 'general_id = 0');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function fillLowGenAll() {
|
function fillLowGenAll() {
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
@@ -785,8 +827,8 @@ function setGift($tnmt_type, $tnmt, $phase) {
|
|||||||
$josaYiWinner = JosaUtil::pick($winner['name'], '이');
|
$josaYiWinner = JosaUtil::pick($winner['name'], '이');
|
||||||
$josaYiRunnerUp = JosaUtil::pick($runnerUp['name'], '이');
|
$josaYiRunnerUp = JosaUtil::pick($runnerUp['name'], '이');
|
||||||
|
|
||||||
$winnerLogger->pushGlobalHistoryLog("<C>{$tp}</> 대회에서 <Y>{$winner['name']}</>{$josaYiWinner} <C>우승</>, <Y>{$runnerUp['name']}</>{$josaYiRunnerUp} <C>준우승</>을 차지하여 천하에 이름을 떨칩니다!", ActionLogger::EVENT_YEAR_MONTH);
|
$winnerLogger->pushGlobalHistoryLog("<B><b>【대회】</b></><C>{$tp}</> 대회에서 <Y>{$winner['name']}</>{$josaYiWinner} <C>우승</>, <Y>{$runnerUp['name']}</>{$josaYiRunnerUp} <C>준우승</>을 차지하여 천하에 이름을 떨칩니다!", ActionLogger::EVENT_YEAR_MONTH);
|
||||||
$winnerLogger->pushGlobalHistoryLog("<C>{$tp}</> 대회의 <S>우승자</>에게는 <C>{$winnerRewardText}</>, <S>준우승자</>에겐 <C>{$runnerUpRewardText}</>의 <S>상금</>과 약간의 <S>명성</>이 주어집니다!", ActionLogger::EVENT_YEAR_MONTH);
|
$winnerLogger->pushGlobalHistoryLog("<B><b>【대회】</b></><C>{$tp}</> 대회의 <S>우승자</>에게는 <C>{$winnerRewardText}</>, <S>준우승자</>에겐 <C>{$runnerUpRewardText}</>의 <S>상금</>과 약간의 <S>명성</>이 주어집니다!", ActionLogger::EVENT_YEAR_MONTH);
|
||||||
|
|
||||||
$generalObjList = General::createGeneralObjListFromDB(array_keys($resultHelper));
|
$generalObjList = General::createGeneralObjListFromDB(array_keys($resultHelper));
|
||||||
|
|
||||||
@@ -1132,7 +1174,7 @@ function fight($tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
|
|||||||
$gen1resKey = 'd';
|
$gen1resKey = 'd';
|
||||||
$gen2resKey = 'd';
|
$gen2resKey = 'd';
|
||||||
break;
|
break;
|
||||||
default: new MustNotBeReachedException();
|
default: throw new MustNotBeReachedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->update('rank_data', [
|
$db->update('rank_data', [
|
||||||
|
|||||||
@@ -21,9 +21,11 @@ foreach($rawTurn as [$turn_idx, $action, $arg, $brief]){
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[$turnTerm, $year, $month, $lastExecute] = $gameStor->getValuesAsArray(['turnterm', 'year', 'month', 'turntime']);
|
[$turnTerm, $year, $month, $lastExecute] = $gameStor->getValuesAsArray(['turnterm', 'year', 'month', 'turntime']);
|
||||||
|
|
||||||
$turnTime = $db->queryFirstField('SELECT turntime FROM general WHERE no=%i', $generalID);
|
[$turnTime, $rawGeneralAux] = $db->queryFirstList('SELECT turntime, aux FROM general WHERE no=%i', $generalID);
|
||||||
|
$generalAux = Json::decode($rawGeneralAux??'{}');
|
||||||
|
|
||||||
if(cutTurn($turnTime, $turnTerm) > cutTurn($lastExecute, $turnTerm)){
|
if(cutTurn($turnTime, $turnTerm) > cutTurn($lastExecute, $turnTerm)){
|
||||||
//이미 이번달에 실행된 턴이다.
|
//이미 이번달에 실행된 턴이다.
|
||||||
@@ -42,5 +44,6 @@ Json::die([
|
|||||||
'year'=>$year,
|
'year'=>$year,
|
||||||
'month'=>$month,
|
'month'=>$month,
|
||||||
'date'=>TimeUtil::now(true),
|
'date'=>TimeUtil::now(true),
|
||||||
'turn'=>$commandList
|
'turn'=>$commandList,
|
||||||
|
'autorun_limit'=> $generalAux['autorun_limit']??null,
|
||||||
]);
|
]);
|
||||||
@@ -39,7 +39,7 @@ $db = DB::db();
|
|||||||
$me = General::createGeneralObjFromDB($generalID);
|
$me = General::createGeneralObjFromDB($generalID);
|
||||||
|
|
||||||
|
|
||||||
if($defence_train != $me->getVar('defence_train')){
|
if($defence_train !== $me->getVar('defence_train')){
|
||||||
if($defence_train == 999){
|
if($defence_train == 999){
|
||||||
$me->increaseVar('myset', -1);
|
$me->increaseVar('myset', -1);
|
||||||
$me->setVar('defence_train', $defence_train);
|
$me->setVar('defence_train', $defence_train);
|
||||||
@@ -53,14 +53,8 @@ if($defence_train != $me->getVar('defence_train')){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$me->setAuxVar('use_treatment', Util::valueFit($use_treatment, 10, 100));
|
$me->setAuxVar('use_treatment', Util::valueFit($use_treatment, 10, 100));
|
||||||
|
$me->setAuxVar('use_auto_nation_turn', $use_auto_nation_turn);
|
||||||
if($use_auto_nation_turn != $me->getAuxVar('use_auto_nation_turn')){
|
$me->setVar('tnmt', $tnmt);
|
||||||
$me->setAuxVar('use_auto_nation_turn', $use_auto_nation_turn);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($me->getVar('tnmt') != $tnmt){
|
|
||||||
$me->setVar('tnmt', $tnmt);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($me->getNPCType() == 1 && $detachNPC){
|
if($me->getNPCType() == 1 && $detachNPC){
|
||||||
$turnterm = $gameStor->turnterm;
|
$turnterm = $gameStor->turnterm;
|
||||||
|
|||||||
+69
-57
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
@@ -21,18 +22,18 @@ $availableTypes = [
|
|||||||
'nationPolicy',
|
'nationPolicy',
|
||||||
];
|
];
|
||||||
|
|
||||||
if(!in_array($type, $availableTypes)){
|
if (!in_array($type, $availableTypes)) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reason'=>'올바른 타입이 아닙니다.',
|
'reason' => '올바른 타입이 아닙니다.',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = Json::decode($data);
|
$data = Json::decode($data);
|
||||||
if(!$data || !is_array($data)){
|
if (!$data || !is_array($data)) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reason'=>'올바른 입력이 아닙니다.',
|
'reason' => '올바른 입력이 아닙니다.',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,94 +45,95 @@ $me = $db->queryFirstRow('SELECT no, name, npc, nation, city, officer_level, con
|
|||||||
$nationID = $me['nation'];
|
$nationID = $me['nation'];
|
||||||
if (!$nationID) {
|
if (!$nationID) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reason'=>'국가에 소속되어있지 않습니다.',
|
'reason' => '국가에 소속되어있지 않습니다.',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$permission = checkSecretPermission($me);
|
$permission = checkSecretPermission($me);
|
||||||
if ($permission < 3) {
|
if ($permission < 3) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reason'=>'권한이 부족합니다. 군주, 외교권자, 조언자가 아닙니다.'
|
'reason' => '권한이 부족합니다. 군주, 외교권자, 조언자가 아닙니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyNationPolicy($policy, $nationID, $generalName):?string{
|
function applyNationPolicy($policy, $nationID, $generalName): ?string
|
||||||
|
{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
||||||
|
|
||||||
$defaultPolicy = AutorunNationPolicy::$defaultPolicy;
|
$defaultPolicy = AutorunNationPolicy::$defaultPolicy;
|
||||||
$troopCache = null;
|
$troopCache = null;
|
||||||
foreach($db->queryFirstColumn('SELECT troop_leader FROM troop WHERE nation=%i',$nationID) as $troopID){
|
foreach ($db->queryFirstColumn('SELECT troop_leader FROM troop WHERE nation=%i', $nationID) as $troopID) {
|
||||||
$troopCache[$troopID] = 'Neutral';
|
$troopCache[$troopID] = 'Neutral';
|
||||||
}
|
}
|
||||||
$cityList = CityConst::all();
|
$cityList = CityConst::all();
|
||||||
$nationPolicyRoot = $nationStor->npc_nation_policy;
|
$nationPolicyRoot = $nationStor->npc_nation_policy;
|
||||||
$nationPolicy = $nationPolicyRoot['values']??[];
|
$nationPolicy = $nationPolicyRoot['values'] ?? [];
|
||||||
foreach($policy as $key=>$val){
|
foreach ($policy as $key => $val) {
|
||||||
|
|
||||||
if($key === 'CombatForce'){
|
if ($key === 'CombatForce') {
|
||||||
if(!is_array($val)){
|
if (!is_array($val)) {
|
||||||
return "{$key}는 올바른 정책값이 아닙니다.";
|
return "{$key}는 올바른 정책값이 아닙니다.";
|
||||||
}
|
}
|
||||||
foreach($val as $troopID=>$troopTarget){
|
foreach ($val as $troopID => $troopTarget) {
|
||||||
if(!key_exists($troopID, $troopCache)){
|
if (!key_exists($troopID, $troopCache)) {
|
||||||
return "{$troopID}는 국가의 부대가 아닙니다.";
|
return "{$troopID}는 국가의 부대가 아닙니다.";
|
||||||
}
|
}
|
||||||
if($troopCache[$troopID] != 'Neutral'){
|
if ($troopCache[$troopID] != 'Neutral') {
|
||||||
return "부대({$troopID}는 하나의 역할만 지정할 수 있습니다.";
|
return "부대({$troopID}는 하나의 역할만 지정할 수 있습니다.";
|
||||||
}
|
}
|
||||||
if(!is_array($troopTarget) || count($troopTarget)!=2){
|
if (!is_array($troopTarget) || count($troopTarget) != 2) {
|
||||||
return "{$troopID}의 입력양식이 올바르지 않습니다.";
|
return "{$troopID}의 입력양식이 올바르지 않습니다.";
|
||||||
}
|
}
|
||||||
[$fromCity, $toCity] = $troopCache;
|
[$fromCity, $toCity] = $troopCache;
|
||||||
if(!key_exists($fromCity, $cityList) || !key_exists($toCity, $cityList)){
|
if (!key_exists($fromCity, $cityList) || !key_exists($toCity, $cityList)) {
|
||||||
return "{$troopID}의 도시 {$fromCity}, {$toCity}가 올바른 도시 번호가 아닙니다.";
|
return "{$troopID}의 도시 {$fromCity}, {$toCity}가 올바른 도시 번호가 아닙니다.";
|
||||||
}
|
}
|
||||||
$troopCache[$troopID]=$key;
|
$troopCache[$troopID] = $key;
|
||||||
}
|
}
|
||||||
$nationPolicy[$key]=$val;
|
$nationPolicy[$key] = $val;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(in_array($key, ['SupportForce', 'DevelopForce'])){
|
if (in_array($key, ['SupportForce', 'DevelopForce'])) {
|
||||||
if(!is_array($val)){
|
if (!is_array($val)) {
|
||||||
return "{$key}는 올바른 정책값이 아닙니다.";
|
return "{$key}는 올바른 정책값이 아닙니다.";
|
||||||
}
|
}
|
||||||
foreach($val as $troopID){
|
foreach ($val as $troopID) {
|
||||||
if(!key_exists($troopID, $troopCache)){
|
if (!key_exists($troopID, $troopCache)) {
|
||||||
return "{$troopID}는 국가의 부대가 아닙니다.";
|
return "{$troopID}는 국가의 부대가 아닙니다.";
|
||||||
}
|
}
|
||||||
if($troopCache[$troopID] != 'Neutral'){
|
if ($troopCache[$troopID] != 'Neutral') {
|
||||||
return "부대({$troopID}는 하나의 역할만 지정할 수 있습니다.";
|
return "부대({$troopID}는 하나의 역할만 지정할 수 있습니다.";
|
||||||
}
|
}
|
||||||
$troopCache[$troopID]=$key;
|
$troopCache[$troopID] = $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
$nationPolicy[$key]=array_values($val);
|
$nationPolicy[$key] = array_values($val);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!key_exists($key, $defaultPolicy)){
|
if (!key_exists($key, $defaultPolicy)) {
|
||||||
return "{$key}는 올바른 정책값이 아닙니다.";
|
return "{$key}는 올바른 정책값이 아닙니다.";
|
||||||
}
|
}
|
||||||
$defaultValue = $defaultPolicy[$key];
|
$defaultValue = $defaultPolicy[$key];
|
||||||
if(is_numeric($defaultValue) != is_numeric($val)){
|
if (is_numeric($defaultValue) != is_numeric($val)) {
|
||||||
return "{$key}는 올바른 값이 아닙니다.";
|
return "{$key}는 올바른 값이 아닙니다.";
|
||||||
}
|
}
|
||||||
if(is_integer($defaultValue) != is_integer($val)){
|
if (is_integer($defaultValue) != is_integer($val)) {
|
||||||
return "{$key}는 올바른 값이 아닙니다.";
|
return "{$key}는 올바른 값이 아닙니다.";
|
||||||
}
|
}
|
||||||
if(is_array($defaultValue) != is_array($val)){
|
if (is_array($defaultValue) != is_array($val)) {
|
||||||
return "{$key}는 올바른 값이 아닙니다.";
|
return "{$key}는 올바른 값이 아닙니다.";
|
||||||
}
|
}
|
||||||
if(is_integer($val) && $val < 0){
|
if (is_integer($val) && $val < 0) {
|
||||||
$val = 0;
|
$val = 0;
|
||||||
}
|
}
|
||||||
$nationPolicy[$key] = $val;
|
$nationPolicy[$key] = $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
$nationPolicyRoot['values'] = $nationPolicy;
|
$nationPolicyRoot['values'] = $nationPolicy;
|
||||||
$nationPolicyRoot['valueSetter'] = $generalName;
|
$nationPolicyRoot['valueSetter'] = $generalName;
|
||||||
$nationPolicyRoot['valueSetTime'] = TimeUtil::now();
|
$nationPolicyRoot['valueSetTime'] = TimeUtil::now();
|
||||||
@@ -139,14 +141,15 @@ function applyNationPolicy($policy, $nationID, $generalName):?string{
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyNationPriority($priority, $nationID, $generalName):?string{
|
function applyNationPriority($priority, $nationID, $generalName): ?string
|
||||||
|
{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
||||||
$nationPolicyRoot = $nationStor->npc_nation_policy;
|
$nationPolicyRoot = $nationStor->npc_nation_policy;
|
||||||
|
|
||||||
$defaultPriority = AutorunNationPolicy::$defaultPriority;
|
$defaultPriority = AutorunNationPolicy::$defaultPriority;
|
||||||
foreach($priority as $item){
|
foreach ($priority as $item) {
|
||||||
if(!in_array($item, $defaultPriority)){
|
if (!in_array($item, $defaultPriority)) {
|
||||||
return "{$item}은 올바른 명령이 아닙니다.";
|
return "{$item}은 올바른 명령이 아닙니다.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,17 +160,29 @@ function applyNationPriority($priority, $nationID, $generalName):?string{
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyGeneralPriority($priority, $nationID, $generalName):?string{
|
function applyGeneralPriority($priority, $nationID, $generalName): ?string
|
||||||
|
{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
||||||
$generalPolicyRoot = $nationStor->npc_general_policy;
|
$generalPolicyRoot = $nationStor->npc_general_policy;
|
||||||
|
|
||||||
$defaultPriority = AutorunGeneralPolicy::$default_priority;
|
$defaultPriority = AutorunGeneralPolicy::$default_priority;
|
||||||
foreach($priority as $item){
|
$mustHaveActions = ['출병' => 1];
|
||||||
if(!in_array($item, $defaultPriority)){
|
foreach ($priority as $item) {
|
||||||
|
if (key_exists($item, $mustHaveActions)) {
|
||||||
|
$mustHaveActions[$item] = 0;
|
||||||
|
}
|
||||||
|
if (!in_array($item, $defaultPriority)) {
|
||||||
return "{$item}은 올바른 명령이 아닙니다.";
|
return "{$item}은 올바른 명령이 아닙니다.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($mustHaveActions as $actionKey => $unset) {
|
||||||
|
if ($unset) {
|
||||||
|
return "{$actionKey}은 항상 사용해야 합니다.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$generalPolicyRoot['priority'] = $priority;
|
$generalPolicyRoot['priority'] = $priority;
|
||||||
$generalPolicyRoot['prioritySetter'] = $generalName;
|
$generalPolicyRoot['prioritySetter'] = $generalName;
|
||||||
$generalPolicyRoot['prioritySetTime'] = TimeUtil::now();
|
$generalPolicyRoot['prioritySetTime'] = TimeUtil::now();
|
||||||
@@ -175,26 +190,23 @@ function applyGeneralPriority($priority, $nationID, $generalName):?string{
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($type == 'nationPolicy'){
|
if ($type == 'nationPolicy') {
|
||||||
$result = applyNationPolicy($data, $nationID, $me['name']);
|
$result = applyNationPolicy($data, $nationID, $me['name']);
|
||||||
}
|
} else if ($type == 'generalPriority') {
|
||||||
else if($type == 'generalPriority'){
|
|
||||||
$result = applyGeneralPriority($data, $nationID, $me['name']);
|
$result = applyGeneralPriority($data, $nationID, $me['name']);
|
||||||
}
|
} else if ($type == 'nationPriority') {
|
||||||
else if($type == 'nationPriority'){
|
|
||||||
$result = applyNationPriority($data, $nationID, $me['name']);
|
$result = applyNationPriority($data, $nationID, $me['name']);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
throw new MustNotBeReachedException();
|
throw new MustNotBeReachedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($result!==null){
|
if ($result !== null) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reason'=>$result,
|
'reason' => $result,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>true,
|
'result' => true,
|
||||||
'reason'=>'success',
|
'reason' => 'success',
|
||||||
]);
|
]);
|
||||||
|
|||||||
+1
-5
@@ -20,10 +20,6 @@ $loader->addClassMap((function () {
|
|||||||
//디버그용 매크로
|
//디버그용 매크로
|
||||||
ini_set("session.cache_expire", 10080); // minutes
|
ini_set("session.cache_expire", 10080); // minutes
|
||||||
|
|
||||||
// 각종 변수
|
|
||||||
define('STEP_LOG', true);
|
|
||||||
define('PROCESS_LOG', true);
|
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
// 에러 메세지 출력
|
// 에러 메세지 출력
|
||||||
@@ -69,6 +65,6 @@ function prepareDir(string $dirPath, bool $forceCreate=true):bool{
|
|||||||
}
|
}
|
||||||
return mkdir($dirPath);
|
return mkdir($dirPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
return mkdir($dirPath, 0777, true);
|
return mkdir($dirPath, 0777, true);
|
||||||
}
|
}
|
||||||
+31
-29
@@ -19,7 +19,7 @@ function processWar(General $attackerGeneral, array $rawAttackerNation, array $r
|
|||||||
'rice'=>10000,
|
'rice'=>10000,
|
||||||
'type'=>GameConst::$neutralNationType,
|
'type'=>GameConst::$neutralNationType,
|
||||||
'tech'=>0,
|
'tech'=>0,
|
||||||
'gennum'=>1
|
'gennum'=>1
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -89,7 +89,7 @@ function processWar(General $attackerGeneral, array $rawAttackerNation, array $r
|
|||||||
$rice *= getTechCost($rawDefenderNation['tech']);
|
$rice *= getTechCost($rawDefenderNation['tech']);
|
||||||
$rice *= $cityRate / 100 - 0.2;
|
$rice *= $cityRate / 100 - 0.2;
|
||||||
Util::setRound($rice);
|
Util::setRound($rice);
|
||||||
|
|
||||||
$updateDefenderNation['rice'] = max(0, $rawDefenderNation['rice'] - $rice);
|
$updateDefenderNation['rice'] = max(0, $rawDefenderNation['rice'] - $rice);
|
||||||
}
|
}
|
||||||
else if($conquerCity){
|
else if($conquerCity){
|
||||||
@@ -169,7 +169,7 @@ function processWar(General $attackerGeneral, array $rawAttackerNation, array $r
|
|||||||
if(!$conquerCity){
|
if(!$conquerCity){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConquerCity([
|
ConquerCity([
|
||||||
'startyear'=>$startYear,
|
'startyear'=>$startYear,
|
||||||
'year'=>$year,
|
'year'=>$year,
|
||||||
@@ -207,7 +207,7 @@ function extractBattleOrder(General $general){
|
|||||||
|
|
||||||
function processWar_NG(
|
function processWar_NG(
|
||||||
WarUnitGeneral $attacker,
|
WarUnitGeneral $attacker,
|
||||||
callable $getNextDefender,
|
callable $getNextDefender,
|
||||||
WarUnitCity $city,
|
WarUnitCity $city,
|
||||||
int $relYear
|
int $relYear
|
||||||
):bool{
|
):bool{
|
||||||
@@ -216,7 +216,7 @@ function processWar_NG(
|
|||||||
$logger = $attacker->getLogger();
|
$logger = $attacker->getLogger();
|
||||||
|
|
||||||
//$attacker->useBattleInitItem();
|
//$attacker->useBattleInitItem();
|
||||||
|
|
||||||
$date = $attacker->getGeneral()->getTurnTime(General::TURNTIME_HM);
|
$date = $attacker->getGeneral()->getTurnTime(General::TURNTIME_HM);
|
||||||
|
|
||||||
$attackerNationUpdate = [];
|
$attackerNationUpdate = [];
|
||||||
@@ -224,7 +224,7 @@ function processWar_NG(
|
|||||||
|
|
||||||
$defender = ($getNextDefender)(null, true);
|
$defender = ($getNextDefender)(null, true);
|
||||||
$conquerCity = false;
|
$conquerCity = false;
|
||||||
|
|
||||||
$josaRo = JosaUtil::pick($city->getName(), '로');
|
$josaRo = JosaUtil::pick($city->getName(), '로');
|
||||||
$josaYi = JosaUtil::pick($attacker->getName(), '이');
|
$josaYi = JosaUtil::pick($attacker->getName(), '이');
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@ function processWar_NG(
|
|||||||
for($currPhase = 0; $currPhase < $attacker->getMaxPhase(); $currPhase+=1){
|
for($currPhase = 0; $currPhase < $attacker->getMaxPhase(); $currPhase+=1){
|
||||||
if($defender === null){
|
if($defender === null){
|
||||||
$defender = $city;
|
$defender = $city;
|
||||||
|
|
||||||
if($city->getNationVar('rice') <= 0 && $city->getVar('supply')){
|
if($city->getNationVar('rice') <= 0 && $city->getVar('supply')){
|
||||||
//병량 패퇴
|
//병량 패퇴
|
||||||
$attacker->setOppose($defender);
|
$attacker->setOppose($defender);
|
||||||
@@ -261,15 +261,17 @@ function processWar_NG(
|
|||||||
|
|
||||||
$attacker->addTrain(1);
|
$attacker->addTrain(1);
|
||||||
$defender->addTrain(1);
|
$defender->addTrain(1);
|
||||||
|
|
||||||
$attackerCrewTypeCoef = $attacker->getCrewType()->getAttackCoef($defender->getCrewType()) * $defender->getCrewType()->getDefenceCoef($attacker->getCrewType());
|
$attackerCrewTypeCoef = $attacker->getCrewType()->getAttackCoef($defender->getCrewType()) * $defender->getCrewType()->getDefenceCoef($attacker->getCrewType());
|
||||||
$defenderCrewTypeCoef = $defender->getCrewType()->getAttackCoef($attacker->getCrewType()) * $attacker->getCrewType()->getDefenceCoef($defender->getCrewType());
|
$defenderCrewTypeCoef = $defender->getCrewType()->getAttackCoef($attacker->getCrewType()) * $attacker->getCrewType()->getDefenceCoef($defender->getCrewType());
|
||||||
|
/*
|
||||||
if($attackerCrewTypeCoef > $defenderCrewTypeCoef && $attacker instanceof WarUnitGeneral){
|
if($attackerCrewTypeCoef > $defenderCrewTypeCoef && $attacker instanceof WarUnitGeneral){
|
||||||
$attacker->getGeneral()->increaseInheritancePoint('snipe_combat', 1);
|
$attacker->getGeneral()->increaseInheritancePoint('snipe_combat', 1);
|
||||||
}
|
}
|
||||||
if($defenderCrewTypeCoef > $attackerCrewTypeCoef && $defender instanceof WarUnitGeneral){
|
if($defenderCrewTypeCoef > $attackerCrewTypeCoef && $defender instanceof WarUnitGeneral){
|
||||||
$defender->getGeneral()->increaseInheritancePoint('snipe_combat', 1);
|
$defender->getGeneral()->increaseInheritancePoint('snipe_combat', 1);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
$attackerName = $attacker->getName();
|
$attackerName = $attacker->getName();
|
||||||
$attackerCrewTypeName = $attacker->getCrewTypeName();
|
$attackerCrewTypeName = $attacker->getCrewTypeName();
|
||||||
@@ -315,7 +317,7 @@ function processWar_NG(
|
|||||||
$battleCaller->merge($defender->getGeneral()->getBattlePhaseSkillTriggerList($defender));
|
$battleCaller->merge($defender->getGeneral()->getBattlePhaseSkillTriggerList($defender));
|
||||||
|
|
||||||
$battleCaller->fire([], [$attacker, $defender]);
|
$battleCaller->fire([], [$attacker, $defender]);
|
||||||
|
|
||||||
$deadDefender = $attacker->calcDamage();
|
$deadDefender = $attacker->calcDamage();
|
||||||
$deadAttacker = $defender->calcDamage();
|
$deadAttacker = $defender->calcDamage();
|
||||||
|
|
||||||
@@ -339,7 +341,7 @@ function processWar_NG(
|
|||||||
}
|
}
|
||||||
|
|
||||||
$deadAttacker = min(ceil($deadAttacker), $attackerHP);
|
$deadAttacker = min(ceil($deadAttacker), $attackerHP);
|
||||||
$deadDefender = min(ceil($deadDefender), $defenderHP);
|
$deadDefender = min(ceil($deadDefender), $defenderHP);
|
||||||
|
|
||||||
$attacker->decreaseHP($deadAttacker);
|
$attacker->decreaseHP($deadAttacker);
|
||||||
$defender->decreaseHP($deadDefender);
|
$defender->decreaseHP($deadDefender);
|
||||||
@@ -353,12 +355,12 @@ function processWar_NG(
|
|||||||
$attacker->getLogger()->pushGeneralBattleDetailLog(
|
$attacker->getLogger()->pushGeneralBattleDetailLog(
|
||||||
"$phaseNickname : <Y1>【{$attacker->getName()}】</> <C>{$attacker->getHP()} (-$deadAttacker)</> VS <C>{$defender->getHP()} (-$deadDefender)</> <Y1>【{$defender->getName()}】</>"
|
"$phaseNickname : <Y1>【{$attacker->getName()}】</> <C>{$attacker->getHP()} (-$deadAttacker)</> VS <C>{$defender->getHP()} (-$deadDefender)</> <Y1>【{$defender->getName()}】</>"
|
||||||
);
|
);
|
||||||
|
|
||||||
$defender->getLogger()->pushGeneralBattleDetailLog(
|
$defender->getLogger()->pushGeneralBattleDetailLog(
|
||||||
"$phaseNickname : <Y1>【{$defender->getName()}】</> <C>{$defender->getHP()} (-$deadDefender)</> VS <C>{$attacker->getHP()} (-$deadAttacker)</> <Y1>【{$attacker->getName()}】</>"
|
"$phaseNickname : <Y1>【{$defender->getName()}】</> <C>{$defender->getHP()} (-$deadDefender)</> VS <C>{$attacker->getHP()} (-$deadAttacker)</> <Y1>【{$attacker->getName()}】</>"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$attacker->addPhase();
|
$attacker->addPhase();
|
||||||
$defender->addPhase();
|
$defender->addPhase();
|
||||||
@@ -369,7 +371,7 @@ function processWar_NG(
|
|||||||
|
|
||||||
$attacker->addLose();
|
$attacker->addLose();
|
||||||
$defender->addWin();
|
$defender->addWin();
|
||||||
|
|
||||||
$attacker->tryWound();
|
$attacker->tryWound();
|
||||||
$defender->tryWound();
|
$defender->tryWound();
|
||||||
|
|
||||||
@@ -404,7 +406,7 @@ function processWar_NG(
|
|||||||
}
|
}
|
||||||
|
|
||||||
$josaYi = JosaUtil::pick($defender->getCrewTypeName(), '이');
|
$josaYi = JosaUtil::pick($defender->getCrewTypeName(), '이');
|
||||||
|
|
||||||
if($noRice){
|
if($noRice){
|
||||||
$logger->pushGlobalActionLog("<Y>{$defender->getName()}</>의 {$defender->getCrewTypeName()}{$josaYi} 패퇴했습니다.");
|
$logger->pushGlobalActionLog("<Y>{$defender->getName()}</>의 {$defender->getCrewTypeName()}{$josaYi} 패퇴했습니다.");
|
||||||
$attacker->getLogger()->pushGeneralActionLog("<Y>{$defender->getName()}</>의 {$defender->getCrewTypeName()}{$josaYi} 패퇴했습니다.", ActionLogger::PLAIN);
|
$attacker->getLogger()->pushGeneralActionLog("<Y>{$defender->getName()}</>의 {$defender->getCrewTypeName()}{$josaYi} 패퇴했습니다.", ActionLogger::PLAIN);
|
||||||
@@ -426,9 +428,9 @@ function processWar_NG(
|
|||||||
if($defender !== null && !($defender instanceof WarUnitGeneral)){
|
if($defender !== null && !($defender instanceof WarUnitGeneral)){
|
||||||
throw new \RuntimeException('다음 수비자를 받아오는데 실패');
|
throw new \RuntimeException('다음 수비자를 받아오는데 실패');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($currPhase == $attacker->getMaxPhase()){
|
if($currPhase == $attacker->getMaxPhase()){
|
||||||
@@ -442,7 +444,7 @@ function processWar_NG(
|
|||||||
|
|
||||||
$attacker->finishBattle();
|
$attacker->finishBattle();
|
||||||
$defender->finishBattle();
|
$defender->finishBattle();
|
||||||
|
|
||||||
if($defender instanceof WarUnitCity){
|
if($defender instanceof WarUnitCity){
|
||||||
$newConflict = $defender->addConflict();
|
$newConflict = $defender->addConflict();
|
||||||
if($newConflict){
|
if($newConflict){
|
||||||
@@ -501,7 +503,7 @@ function ConquerCity(array $admin, General $general, array $city) {
|
|||||||
$defenderNationID = $city['nation'];
|
$defenderNationID = $city['nation'];
|
||||||
$defenderStaticNation = getNationStaticInfo($defenderNationID);
|
$defenderStaticNation = getNationStaticInfo($defenderNationID);
|
||||||
$defenderNationName = $defenderStaticNation['name'];
|
$defenderNationName = $defenderStaticNation['name'];
|
||||||
|
|
||||||
$defenderNationLogger = new ActionLogger(0, $defenderNationID, $year, $month);
|
$defenderNationLogger = new ActionLogger(0, $defenderNationID, $year, $month);
|
||||||
|
|
||||||
if($defenderNationID) {
|
if($defenderNationID) {
|
||||||
@@ -535,7 +537,7 @@ function ConquerCity(array $admin, General $general, array $city) {
|
|||||||
$defenderNationID,
|
$defenderNationID,
|
||||||
12
|
12
|
||||||
), null, $city, $loseNation, $year, $month, false);
|
), null, $city, $loseNation, $year, $month, false);
|
||||||
|
|
||||||
$josaUl = JosaUtil::pick($defenderNationName, '을');
|
$josaUl = JosaUtil::pick($defenderNationName, '을');
|
||||||
$attackerLogger->pushNationalHistoryLog("<D><b>{$defenderNationName}</b></>{$josaUl} 정복");
|
$attackerLogger->pushNationalHistoryLog("<D><b>{$defenderNationName}</b></>{$josaUl} 정복");
|
||||||
$attackerLogger->flush();
|
$attackerLogger->flush();
|
||||||
@@ -585,19 +587,19 @@ function ConquerCity(array $admin, General $general, array $city) {
|
|||||||
// 승전국 보상
|
// 승전국 보상
|
||||||
$loseNationGold = Util::valueFit($loseNation['gold'] - GameConst::$basegold, 0);
|
$loseNationGold = Util::valueFit($loseNation['gold'] - GameConst::$basegold, 0);
|
||||||
$loseNationRice = Util::valueFit($loseNation['rice'] - GameConst::$baserice, 0);
|
$loseNationRice = Util::valueFit($loseNation['rice'] - GameConst::$baserice, 0);
|
||||||
|
|
||||||
$loseNationGold += $loseGeneralGold;
|
$loseNationGold += $loseGeneralGold;
|
||||||
$loseNationRice += $loseGeneralRice;
|
$loseNationRice += $loseGeneralRice;
|
||||||
|
|
||||||
$loseNationGold = intdiv($loseNationGold, 2);
|
$loseNationGold = intdiv($loseNationGold, 2);
|
||||||
$loseNationRice = intdiv($loseNationRice, 2);
|
$loseNationRice = intdiv($loseNationRice, 2);
|
||||||
|
|
||||||
// 기본량 제외 금쌀50% + 장수들 분실 금쌀50% 흡수
|
// 기본량 제외 금쌀50% + 장수들 분실 금쌀50% 흡수
|
||||||
$db->update('nation', [
|
$db->update('nation', [
|
||||||
'gold'=>$db->sqleval('gold + %i', $loseNationGold),
|
'gold'=>$db->sqleval('gold + %i', $loseNationGold),
|
||||||
'rice'=>$db->sqleval('rice + %i', $loseNationRice),
|
'rice'=>$db->sqleval('rice + %i', $loseNationRice),
|
||||||
], 'nation=%i', $attackerNationID);
|
], 'nation=%i', $attackerNationID);
|
||||||
|
|
||||||
//아국 수뇌부에게 로그 전달
|
//아국 수뇌부에게 로그 전달
|
||||||
$loseNationGoldText = number_format($loseNationGold);
|
$loseNationGoldText = number_format($loseNationGold);
|
||||||
$loseNationRiceText = number_format($loseNationRice);
|
$loseNationRiceText = number_format($loseNationRice);
|
||||||
@@ -622,7 +624,7 @@ function ConquerCity(array $admin, General $general, array $city) {
|
|||||||
'officer_level'=>1,
|
'officer_level'=>1,
|
||||||
'officer_city'=>0,
|
'officer_city'=>0,
|
||||||
], 'officer_city = %i',$cityID);
|
], 'officer_city = %i',$cityID);
|
||||||
|
|
||||||
//수도였으면 긴급 천도
|
//수도였으면 긴급 천도
|
||||||
if($defenderNationID && $defenderStaticNation['capital'] == $cityID) {
|
if($defenderNationID && $defenderStaticNation['capital'] == $cityID) {
|
||||||
$minCity = findNextCapital($cityID, $defenderNationID);
|
$minCity = findNextCapital($cityID, $defenderNationID);
|
||||||
@@ -686,7 +688,7 @@ function ConquerCity(array $admin, General $general, array $city) {
|
|||||||
$conquerNationLogger->pushNationalHistoryLog("<D><b>{$attackerNationName}</b></>에서 <G><b>{$city['name']}</b></>{$josaUl} <S>양도</> 받음");
|
$conquerNationLogger->pushNationalHistoryLog("<D><b>{$attackerNationName}</b></>에서 <G><b>{$city['name']}</b></>{$josaUl} <S>양도</> 받음");
|
||||||
$attackerLogger->pushNationalHistoryLog("<G><b>{$city['name']}</b></>{$josaUl} <D><b>{$conquerNationName}</b></>에 <Y>양도</>");
|
$attackerLogger->pushNationalHistoryLog("<G><b>{$city['name']}</b></>{$josaUl} <D><b>{$conquerNationName}</b></>에 <Y>양도</>");
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = [
|
$query = [
|
||||||
'supply'=>1,
|
'supply'=>1,
|
||||||
'term'=>0,
|
'term'=>0,
|
||||||
@@ -704,7 +706,7 @@ function ConquerCity(array $admin, General $general, array $city) {
|
|||||||
$query['def'] = $db->sqleval('def_max/2');
|
$query['def'] = $db->sqleval('def_max/2');
|
||||||
$query['wall'] = $db->sqleval('wall_max/2');
|
$query['wall'] = $db->sqleval('wall_max/2');
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->update('city', $query, 'city=%i', $cityID);
|
$db->update('city', $query, 'city=%i', $cityID);
|
||||||
//전방설정
|
//전방설정
|
||||||
|
|
||||||
@@ -726,8 +728,8 @@ function findNextCapital(int $capitalID, int $nationID):int{
|
|||||||
$cities = [];
|
$cities = [];
|
||||||
foreach(
|
foreach(
|
||||||
DB::db()->query(
|
DB::db()->query(
|
||||||
'SELECT city, pop FROM city WHERE nation=%i and city!=%i',
|
'SELECT city, pop FROM city WHERE nation=%i and city!=%i',
|
||||||
$nationID,
|
$nationID,
|
||||||
$capitalID
|
$capitalID
|
||||||
) as $row
|
) as $row
|
||||||
){
|
){
|
||||||
@@ -737,7 +739,7 @@ function findNextCapital(int $capitalID, int $nationID):int{
|
|||||||
foreach($distList as $dist=>$distSubList){
|
foreach($distList as $dist=>$distSubList){
|
||||||
$maxCityPop = 0;
|
$maxCityPop = 0;
|
||||||
$minCity = 0;
|
$minCity = 0;
|
||||||
|
|
||||||
foreach($distSubList as $cityID){
|
foreach($distSubList as $cityID){
|
||||||
if(!key_exists($cityID, $cities)){
|
if(!key_exists($cityID, $cities)){
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class BuySpecificUnique extends \sammo\BaseAPI
|
|||||||
{
|
{
|
||||||
public function validateArgs(): ?string
|
public function validateArgs(): ?string
|
||||||
{
|
{
|
||||||
|
$availableItems = [];
|
||||||
foreach (GameConst::$allItems as $items) {
|
foreach (GameConst::$allItems as $items) {
|
||||||
foreach ($items as $itemKey => $amount) {
|
foreach ($items as $itemKey => $amount) {
|
||||||
if ($amount == 0) {
|
if ($amount == 0) {
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ class ResetTurnTime extends \sammo\BaseAPI
|
|||||||
|
|
||||||
$userLogger = new UserLogger($userID);
|
$userLogger = new UserLogger($userID);
|
||||||
if($afterTurn >= 0){
|
if($afterTurn >= 0){
|
||||||
$userLogger->push(sprintf("{$reqPoint} 포인트로 턴 시간을 바꾼 결과 %02d:%02d 뒤로 밀림", intdiv($afterTurn, 60), $afterTurn%60), "inheritPoint");
|
$userLogger->push(sprintf("{$reqPoint} 포인트로 턴 시간을 바꾼 결과 %02d:%02d 뒤로 밀림", intdiv(Util::toInt($afterTurn), 60), $afterTurn%60), "inheritPoint");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$userLogger->push(sprintf("{$reqPoint} 포인트로 턴 시간을 바꾼 결과 %02d:%02d 앞으로 당김", intdiv(-$afterTurn, 60), (-$afterTurn)%60), "inheritPoint");
|
$userLogger->push(sprintf("{$reqPoint} 포인트로 턴 시간을 바꾼 결과 %02d:%02d 앞으로 당김", intdiv(Util::toInt(-$afterTurn), 60), (-$afterTurn)%60), "inheritPoint");
|
||||||
}
|
}
|
||||||
$userLogger->flush();
|
$userLogger->flush();
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class che_반계_백우선 extends \sammo\BaseItem{
|
|||||||
protected $id = 45;
|
protected $id = 45;
|
||||||
protected $rawName = '백우선';
|
protected $rawName = '백우선';
|
||||||
protected $name = '백우선(반계)';
|
protected $name = '백우선(반계)';
|
||||||
protected $info = '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 40% 확률로 되돌림';
|
protected $info = '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 20% 확률로 되돌림';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ class che_반계_백우선 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*301),
|
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*301, 0.2),
|
||||||
new che_반계발동($unit)
|
new che_반계발동($unit)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class che_반계_파초선 extends \sammo\BaseItem{
|
|||||||
protected $id = 45;
|
protected $id = 45;
|
||||||
protected $rawName = '파초선';
|
protected $rawName = '파초선';
|
||||||
protected $name = '파초선(반계)';
|
protected $name = '파초선(반계)';
|
||||||
protected $info = '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 40% 확률로 되돌림';
|
protected $info = '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 20% 확률로 되돌림';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ class che_반계_파초선 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*302),
|
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*302, 0.2),
|
||||||
new che_반계발동($unit)
|
new che_반계발동($unit)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ class che_서적_07_사마법 extends \sammo\BaseStatItem{
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->info .= "<br>[전투] 상대의 계략을 20% 확률로 되돌림";
|
$this->info .= "<br>[전투] 상대의 계략을 10% 확률로 되돌림";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*207, 0.2),
|
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*207, 0.1),
|
||||||
new che_반계발동($unit)
|
new che_반계발동($unit)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ class che_서적_12_산해경 extends \sammo\BaseStatItem{
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->info .= "<br>[전투] 상대의 계략을 20% 확률로 되돌림";
|
$this->info .= "<br>[전투] 상대의 계략을 10% 확률로 되돌림";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM, 0.2),
|
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM, 0.1),
|
||||||
new che_반계발동($unit)
|
new che_반계발동($unit)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,25 +11,29 @@ class event_전투특기_무쌍 extends \sammo\BaseItem{
|
|||||||
protected $id = 61;
|
protected $id = 61;
|
||||||
protected $rawName = '비급';
|
protected $rawName = '비급';
|
||||||
protected $name = '비급(무쌍)';
|
protected $name = '비급(무쌍)';
|
||||||
protected $info = '[전투] 대미지 +10%, 피해 -5%, 공격 시 필살 확률 +10%p, <br>승리 수만큼 대미지 0.20%씩 추가 상승(최대40%)<br>승리 수만큼 피해 0.05%씩 감소(최대30%)';
|
protected $info = '[전투] 대미지 +5%, 피해 -2%, 공격 시 필살 확률 +10%p, <br>승리 수의 로그 비례로 대미지 상승(10회 ⇒ +5%, 40회 ⇒ +15%)<br>승리 수의 로그 비례로 피해 감소(10회 ⇒ -2%, 40회 ⇒ -6%)';
|
||||||
protected $cost = 100;
|
protected $cost = 100;
|
||||||
protected $buyable = true;
|
protected $buyable = true;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
protected $reqSecu = 3000;
|
protected $reqSecu = 3000;
|
||||||
|
|
||||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||||
if($statName === 'warCriticalRatio' && $aux['isAttacker']??false){
|
if($statName === 'warCriticalRatio' && ($aux['isAttacker']??false)){
|
||||||
return $value += 0.1;
|
return $value += 0.1;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWarPowerMultiplier(WarUnit $unit):array{
|
public function getWarPowerMultiplier(WarUnit $unit):array{
|
||||||
$attackMultiplier = 1.1;
|
$generalWarSpecial = $unit->getGeneral()->getSpecialWar();
|
||||||
$defenceMultiplier = 0.95;
|
if($generalWarSpecial !== null && $generalWarSpecial->getName() == '무쌍'){
|
||||||
|
return [1, 1];
|
||||||
|
}
|
||||||
|
$attackMultiplier = 1.05;
|
||||||
|
$defenceMultiplier = 0.98;
|
||||||
$killnum = $unit->getGeneral()->getRankVar('killnum');
|
$killnum = $unit->getGeneral()->getRankVar('killnum');
|
||||||
$attackMultiplier += Util::valueFit($killnum * 0.01 * 0.2, null, 0.4);
|
$attackMultiplier += log(max(1, $killnum / 5), 2) / 20;
|
||||||
$defenceMultiplier -= Util::valueFit($killnum * 0.01 * 0.05, null, 0.3);
|
$defenceMultiplier -= log(max(1, $killnum / 5), 2) / 50;
|
||||||
return [$attackMultiplier, $defenceMultiplier];
|
return [$attackMultiplier, $defenceMultiplier];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@ class che_종횡가 extends \sammo\BaseNation{
|
|||||||
if($varType == 'score') return $value * 0.9;
|
if($varType == 'score') return $value * 0.9;
|
||||||
if($varType == 'cost') return $value * 1.2;
|
if($varType == 'cost') return $value * 1.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,13 +29,13 @@ class che_종횡가 extends \sammo\BaseNation{
|
|||||||
if($type == 'gold'){
|
if($type == 'gold'){
|
||||||
return $amount * 0.9;
|
return $amount * 0.9;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 Util::round($value / 2);
|
return Util::round($value * 3 / 4);
|
||||||
}
|
}
|
||||||
if($varType == 'globalDelay'){
|
if($varType == 'globalDelay'){
|
||||||
return Util::round($value / 2);
|
return Util::round($value / 2);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class che_event_무쌍 extends \sammo\BaseSpecial{
|
|||||||
|
|
||||||
protected $id = 61;
|
protected $id = 61;
|
||||||
protected $name = '무쌍';
|
protected $name = '무쌍';
|
||||||
protected $info = '[전투] 대미지 +10%, 피해 -5%, 공격 시 필살 확률 +10%p, <br>승리 수만큼 대미지 0.20%씩 추가 상승(최대40%)<br>승리 수만큼 피해 0.05%씩 감소(최대30%)';
|
protected $info = '[전투] 대미지 +5%, 피해 -2%, 공격 시 필살 확률 +10%p, <br>승리 수의 로그 비례로 대미지 상승(10회 ⇒ +5%, 40회 ⇒ +15%)<br>승리 수의 로그 비례로 피해 감소(10회 ⇒ -2%, 40회 ⇒ -6%)';
|
||||||
|
|
||||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||||
static $selectWeight = 1;
|
static $selectWeight = 1;
|
||||||
@@ -19,18 +19,22 @@ class che_event_무쌍 extends \sammo\BaseSpecial{
|
|||||||
];
|
];
|
||||||
|
|
||||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||||
if($statName === 'warCriticalRatio' && $aux['isAttacker']??false){
|
if($statName === 'warCriticalRatio' && ($aux['isAttacker']??false)){
|
||||||
return $value += 0.1;
|
return $value += 0.1;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWarPowerMultiplier(WarUnit $unit):array{
|
public function getWarPowerMultiplier(WarUnit $unit):array{
|
||||||
$attackMultiplier = 1.1;
|
$generalWarSpecial = $unit->getGeneral()->getSpecialWar();
|
||||||
$defenceMultiplier = 1;
|
if($generalWarSpecial !== null && $generalWarSpecial->getName() == '무쌍'){
|
||||||
|
return [1, 1];
|
||||||
|
}
|
||||||
|
$attackMultiplier = 1.05;
|
||||||
|
$defenceMultiplier = 0.98;
|
||||||
$killnum = $unit->getGeneral()->getRankVar('killnum');
|
$killnum = $unit->getGeneral()->getRankVar('killnum');
|
||||||
$attackMultiplier += Util::valueFit($killnum * 0.01 * 0.2, null, 0.4);
|
$attackMultiplier += log(max(1, $killnum / 5), 2) / 20;
|
||||||
$defenceMultiplier -= Util::valueFit($killnum * 0.01 * 0.05, null, 0.3);
|
$defenceMultiplier -= log(max(1, $killnum / 5), 2) / 50;
|
||||||
return [$attackMultiplier, $defenceMultiplier];
|
return [$attackMultiplier, $defenceMultiplier];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ class che_무쌍 extends \sammo\BaseSpecial{
|
|||||||
|
|
||||||
protected $id = 61;
|
protected $id = 61;
|
||||||
protected $name = '무쌍';
|
protected $name = '무쌍';
|
||||||
protected $info = '[전투] 대미지 +10%, 피해 -5%, 공격 시 필살 확률 +10%p, <br>승리 수만큼 대미지 0.20%씩 추가 상승(최대40%)<br>승리 수만큼 피해 0.05%씩 감소(최대30%)';
|
protected $info = '[전투] 대미지 +5%, 피해 -2%, 공격 시 필살 확률 +10%p, <br>승리 수의 로그 비례로 대미지 상승(10회 ⇒ +5%, 40회 ⇒ +15%)<br>승리 수의 로그 비례로 피해 감소(10회 ⇒ -2%, 40회 ⇒ -6%)';
|
||||||
|
|
||||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||||
static $selectWeight = 1;
|
static $selectWeight = 1;
|
||||||
@@ -19,18 +19,18 @@ class che_무쌍 extends \sammo\BaseSpecial{
|
|||||||
];
|
];
|
||||||
|
|
||||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||||
if($statName === 'warCriticalRatio' && $aux['isAttacker']??false){
|
if($statName === 'warCriticalRatio' && ($aux['isAttacker']??false)){
|
||||||
return $value += 0.1;
|
return $value += 0.1;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWarPowerMultiplier(WarUnit $unit):array{
|
public function getWarPowerMultiplier(WarUnit $unit):array{
|
||||||
$attackMultiplier = 1.1;
|
$attackMultiplier = 1.05;
|
||||||
$defenceMultiplier = 0.95;
|
$defenceMultiplier = 0.98;
|
||||||
$killnum = $unit->getGeneral()->getRankVar('killnum');
|
$killnum = $unit->getGeneral()->getRankVar('killnum');
|
||||||
$attackMultiplier += Util::valueFit($killnum * 0.01 * 0.2, null, 0.4);
|
$attackMultiplier += log(max(1, $killnum / 5), 2) / 20;
|
||||||
$defenceMultiplier -= Util::valueFit($killnum * 0.01 * 0.05, null, 0.3);
|
$defenceMultiplier -= log(max(1, $killnum / 5), 2) / 50;
|
||||||
return [$attackMultiplier, $defenceMultiplier];
|
return [$attackMultiplier, $defenceMultiplier];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,6 +137,7 @@ class AutorunNationPolicy {
|
|||||||
public $reqNPCDevelRice = 500;
|
public $reqNPCDevelRice = 500;
|
||||||
|
|
||||||
public $minimumResourceActionAmount = 1000;
|
public $minimumResourceActionAmount = 1000;
|
||||||
|
public $maximumResourceActionAmount = 10000;
|
||||||
|
|
||||||
public $minNPCWarLeadership = 40;
|
public $minNPCWarLeadership = 40;
|
||||||
public $minWarCrew = 1500;
|
public $minWarCrew = 1500;
|
||||||
@@ -164,6 +165,7 @@ class AutorunNationPolicy {
|
|||||||
'reqNPCDevelRice'=>500,
|
'reqNPCDevelRice'=>500,
|
||||||
|
|
||||||
'minimumResourceActionAmount'=>1000,
|
'minimumResourceActionAmount'=>1000,
|
||||||
|
'maximumResourceActionAmount'=>10000,
|
||||||
|
|
||||||
'minNPCWarLeadership'=>40,
|
'minNPCWarLeadership'=>40,
|
||||||
'minWarCrew'=>1500,
|
'minWarCrew'=>1500,
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ namespace sammo;
|
|||||||
|
|
||||||
class CityHelper{
|
class CityHelper{
|
||||||
//Just Helper
|
//Just Helper
|
||||||
private static $list = null;
|
private static ?array $list = null;
|
||||||
private static $listInv = null;
|
private static ?array $listInv = null;
|
||||||
private static $listByNation = null;
|
private static ?array $listByNation = null;
|
||||||
|
|
||||||
private function __construct(){
|
private function __construct(){
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ class CityHelper{
|
|||||||
'@phan-var array<int,mixed>|null $list';
|
'@phan-var array<int,mixed>|null $list';
|
||||||
'@phan-var array<string,mixed>|null $listInv';
|
'@phan-var array<string,mixed>|null $listInv';
|
||||||
'@phan-var array<int,mixed>|null $listByNation';
|
'@phan-var array<int,mixed>|null $listByNation';
|
||||||
|
|
||||||
foreach (DB::db()->query('SELECT `city` as `id`, `name`, `level`, `nation` from city') as $city) {
|
foreach (DB::db()->query('SELECT `city` as `id`, `name`, `level`, `nation` from city') as $city) {
|
||||||
$id = $city['id'];
|
$id = $city['id'];
|
||||||
$name = $city['name'];
|
$name = $city['name'];
|
||||||
@@ -83,5 +83,5 @@ class CityHelper{
|
|||||||
return $city;
|
return $city;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -162,6 +162,7 @@ class che_거병 extends Command\GeneralCommand{
|
|||||||
$exp = 100;
|
$exp = 100;
|
||||||
$ded = 100;
|
$ded = 100;
|
||||||
|
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$general->addExperience($exp);
|
$general->addExperience($exp);
|
||||||
$general->addDedication($ded);
|
$general->addDedication($ded);
|
||||||
$general->setVar('belong', 1);
|
$general->setVar('belong', 1);
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ class che_건국 extends Command\GeneralCommand
|
|||||||
|
|
||||||
refreshNationStaticInfo();
|
refreshNationStaticInfo();
|
||||||
|
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryUniqueItemLottery($general, '건국');
|
tryUniqueItemLottery($general, '건국');
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ class che_등용수락 extends Command\GeneralCommand{
|
|||||||
public function getCost():array{
|
public function getCost():array{
|
||||||
return [0, 0];
|
return [0, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreReqTurn():int{
|
public function getPreReqTurn():int{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,7 @@ class che_등용수락 extends Command\GeneralCommand{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$isTroopLeader = ($generalID == $general->getVar('troop'));
|
$isTroopLeader = ($generalID == $general->getVar('troop'));
|
||||||
|
|
||||||
$destGeneral->addExperience(100);
|
$destGeneral->addExperience(100);
|
||||||
$destGeneral->addDedication(100);
|
$destGeneral->addDedication(100);
|
||||||
|
|
||||||
@@ -188,13 +188,13 @@ class che_등용수락 extends Command\GeneralCommand{
|
|||||||
$destLogger->pushGeneralHistoryLog("<Y>{$generalName}</> 등용에 성공");
|
$destLogger->pushGeneralHistoryLog("<Y>{$generalName}</> 등용에 성공");
|
||||||
|
|
||||||
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <D><b>{$destNationName}</b></>{$josaRo} <S>망명</>하였습니다.");
|
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <D><b>{$destNationName}</b></>{$josaRo} <S>망명</>하였습니다.");
|
||||||
|
|
||||||
if($nationID != 0){
|
if($nationID != 0){
|
||||||
$db->update('nation', $setOriginalNationValues, 'nation=%i', $nationID);
|
$db->update('nation', $setOriginalNationValues, 'nation=%i', $nationID);
|
||||||
}
|
}
|
||||||
$db->update('nation', $setScoutNationValues, 'nation=%i', $destNationID);
|
$db->update('nation', $setScoutNationValues, 'nation=%i', $destNationID);
|
||||||
|
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$general->setVar('permission', 'normal');
|
$general->setVar('permission', 'normal');
|
||||||
$general->setVar('belong', 1);
|
$general->setVar('belong', 1);
|
||||||
$general->setVar('officer_level', 1);
|
$general->setVar('officer_level', 1);
|
||||||
|
|||||||
@@ -181,51 +181,44 @@ class che_랜덤임관 extends Command\GeneralCommand
|
|||||||
|
|
||||||
$generalsCnt = [];
|
$generalsCnt = [];
|
||||||
if ($notIn) {
|
if ($notIn) {
|
||||||
|
|
||||||
$rawGeneralsCnt = $db->query(
|
$rawGeneralsCnt = $db->query(
|
||||||
'SELECT general.nation as nation, nation.gennum, nation.name, npc, count(*) as cnt FROM general JOIN nation ON general.nation = nation.nation WHERE npc != 9 AND nation.gennum < %i AND nation.scout=0 AND nation.nation NOT IN %li GROUP BY general.nation, general.npc',
|
"SELECT g.`nation`, n.`gennum`, n.name, SUM((ra.value + 1000)/(rb.value + 1000)*(CASE WHEN g.`npc` < 2 THEN 1.5 ELSE 1 END)*(CASE WHEN g.`leadership` >= 40 THEN g.`leadership` ELSE 0 END)) AS warpower, SUM(SQRT(g.intel * g.strength) * 2 + g.leadership / 2)/5 AS develpower
|
||||||
|
FROM general AS g
|
||||||
|
LEFT JOIN `rank_data` AS ra ON g.`no` = ra.general_id AND ra.`type` = 'killcrew_person'
|
||||||
|
LEFT JOIN `rank_data` AS rb ON g.`no` = rb.general_id AND rb.`type` = 'deathcrew_person'
|
||||||
|
LEFT JOIN `nation` AS n ON g.`nation` = n.`nation`
|
||||||
|
WHERE g.`npc` IN (0, 1, 2, 3, 6) AND g.nation != 0 AND n.scout=0 AND n.gennum < %i AND n.nation NOT IN %li
|
||||||
|
GROUP BY g.`nation`",
|
||||||
$genLimit,
|
$genLimit,
|
||||||
$notIn
|
$notIn
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$rawGeneralsCnt = $db->query(
|
$rawGeneralsCnt = $db->query(
|
||||||
'SELECT general.nation as nation, nation.gennum, nation.name, npc, count(*) as cnt FROM general JOIN nation ON general.nation = nation.nation WHERE npc != 9 AND nation.gennum < %i AND nation.scout=0 GROUP BY general.nation, general.npc',
|
"SELECT g.`nation`, n.`gennum`, n.name, SUM((ra.value + 100)/(rb.value + 100)*(CASE WHEN g.`npc` < 2 THEN 1.5 ELSE 1 END)*(CASE WHEN g.`leadership` >= 40 THEN g.`leadership` ELSE 0 END)) AS warpower, SUM(SQRT(g.intel * g.strength) * 2 + g.leadership / 2)/5 AS develpower
|
||||||
|
FROM general AS g
|
||||||
|
LEFT JOIN `rank_data` AS ra ON g.`no` = ra.general_id AND ra.`type` = 'killcrew_person'
|
||||||
|
LEFT JOIN `rank_data` AS rb ON g.`no` = rb.general_id AND rb.`type` = 'deathcrew_person'
|
||||||
|
LEFT JOIN `nation` AS n ON g.`nation` = n.`nation`
|
||||||
|
WHERE g.`npc` IN (0, 1, 2, 3, 6) AND g.nation != 0 AND n.scout=0 AND n.gennum < %i
|
||||||
|
GROUP BY g.`nation`",
|
||||||
$genLimit
|
$genLimit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach ($rawGeneralsCnt as $nation) {
|
foreach ($rawGeneralsCnt as $nation) {
|
||||||
$nationID = $nation['nation'];
|
$calcCnt = $nation['warpower'] + $nation['develpower'];
|
||||||
if (!\key_exists($nationID, $generalsCnt)) {
|
|
||||||
$generalsCnt[$nationID] = [
|
|
||||||
'nation' => $nationID,
|
|
||||||
'gennum' => $nation['gennum'],
|
|
||||||
'name' => $nation['name'],
|
|
||||||
'cnt' => 0,
|
|
||||||
];
|
|
||||||
$generalsCnt[$nationID]['cnt'] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($nation['npc'] <= 2) {
|
|
||||||
$calcCnt = $nation['cnt'];
|
|
||||||
} else {
|
|
||||||
$calcCnt = $nation['cnt'] / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($general->getNPCType() < 2 && Util::starts_with($nation['name'], 'ⓤ')) {
|
if ($general->getNPCType() < 2 && Util::starts_with($nation['name'], 'ⓤ')) {
|
||||||
$calcCnt *= 100;
|
$calcCnt *= 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
$generalsCnt[$nationID]['cnt'] += $calcCnt;
|
$generalsCnt[] = [$nation, (1 / $calcCnt)**3];
|
||||||
}
|
}
|
||||||
|
|
||||||
$randVals = [];
|
if ($generalsCnt) {
|
||||||
foreach ($generalsCnt as $testNation) {
|
$destNation = Util::choiceRandomUsingWeightPair($generalsCnt);
|
||||||
$randVals[] = [$testNation, 1 / $testNation['cnt']];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($randVals) {
|
|
||||||
$destNation = Util::choiceRandomUsingWeightPair($randVals);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,6 +285,7 @@ class che_랜덤임관 extends Command\GeneralCommand
|
|||||||
$general->setAuxVar('joinedNations', $joinedNations);
|
$general->setAuxVar('joinedNations', $joinedNations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$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();
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ class che_모반시도 extends Command\GeneralCommand{
|
|||||||
$lordLogger->pushGeneralHistoryLog("<D><b>{$generalName}</b></>의 모반으로 인해 <D><b>{$nationName}</b></>의 군주자리를 박탈당함");
|
$lordLogger->pushGeneralHistoryLog("<D><b>{$generalName}</b></>의 모반으로 인해 <D><b>{$nationName}</b></>의 군주자리를 박탈당함");
|
||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryRollbackInheritUniqueItem($general);
|
tryRollbackInheritUniqueItem($general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class che_방랑 extends Command\GeneralCommand{
|
|||||||
], 'me=%i OR you=%i', $nationID, $nationID);
|
], 'me=%i OR you=%i', $nationID, $nationID);
|
||||||
|
|
||||||
refreshNationStaticInfo();
|
refreshNationStaticInfo();
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
tryRollbackInheritUniqueItem($general);
|
tryRollbackInheritUniqueItem($general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ class che_선양 extends Command\GeneralCommand
|
|||||||
$logger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>의 군주자리를 <Y>{$destGeneralName}</>에게 선양");
|
$logger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>의 군주자리를 <Y>{$destGeneralName}</>에게 선양");
|
||||||
$destLogger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>의 군주자리를 물려 받음");
|
$destLogger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>의 군주자리를 물려 받음");
|
||||||
|
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
tryRollbackInheritUniqueItem($general);
|
tryRollbackInheritUniqueItem($general);
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ class che_인재탐색 extends Command\GeneralCommand
|
|||||||
|
|
||||||
$exp = 100 * (sqrt(1 / $foundProp) + 1);
|
$exp = 100 * (sqrt(1 / $foundProp) + 1);
|
||||||
$ded = 150 * (sqrt(1 / $foundProp) + 1);
|
$ded = 150 * (sqrt(1 / $foundProp) + 1);
|
||||||
|
|
||||||
$scoutType = "발견";
|
$scoutType = "발견";
|
||||||
|
|
||||||
$age = Util::randRangeInt(20, 25);
|
$age = Util::randRangeInt(20, 25);
|
||||||
@@ -172,7 +172,7 @@ class che_인재탐색 extends Command\GeneralCommand
|
|||||||
avg(dex1+dex2+dex3+dex4) as dex_t, avg(age) as age, avg(dex5) as dex5
|
avg(dex1+dex2+dex3+dex4) as dex_t, avg(age) as age, avg(dex5) as dex5
|
||||||
from general where npc < 4'
|
from general where npc < 4'
|
||||||
);
|
);
|
||||||
|
|
||||||
$pickTypeList = ['무' => 6, '지' => 6, '무지' => 3];
|
$pickTypeList = ['무' => 6, '지' => 6, '무지' => 3];
|
||||||
|
|
||||||
$pickedNPC = pickGeneralFromPool($db, 0, 1)[0];
|
$pickedNPC = pickGeneralFromPool($db, 0, 1)[0];
|
||||||
@@ -210,6 +210,7 @@ class che_인재탐색 extends Command\GeneralCommand
|
|||||||
$exp = 200;
|
$exp = 200;
|
||||||
$ded = 300;
|
$ded = 300;
|
||||||
|
|
||||||
|
$general->increaseInheritancePoint('active_action', Util::valueFit(sqrt(1 / $foundProp), 1));
|
||||||
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||||
$general->increaseVarWithLimit('rice', -$reqRice, 0);
|
$general->increaseVarWithLimit('rice', -$reqRice, 0);
|
||||||
$general->addExperience($exp);
|
$general->addExperience($exp);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ namespace sammo\Command\General;
|
|||||||
|
|
||||||
use \sammo\{
|
use \sammo\{
|
||||||
DB, Util, JosaUtil,
|
DB, Util, JosaUtil,
|
||||||
General,
|
General,
|
||||||
ActionLogger,
|
ActionLogger,
|
||||||
GameConst, GameUnitConst,
|
GameConst, GameUnitConst,
|
||||||
LastTurn,
|
LastTurn,
|
||||||
@@ -46,7 +46,7 @@ class che_임관 extends Command\GeneralCommand{
|
|||||||
$this->arg = [
|
$this->arg = [
|
||||||
'destNationID' => $destNationID
|
'destNationID' => $destNationID
|
||||||
];
|
];
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ class che_임관 extends Command\GeneralCommand{
|
|||||||
ConstraintHelper::BeNeutral(),
|
ConstraintHelper::BeNeutral(),
|
||||||
ConstraintHelper::AllowJoinAction()
|
ConstraintHelper::AllowJoinAction()
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCommandDetailTitle():string{
|
public function getCommandDetailTitle():string{
|
||||||
@@ -99,7 +99,7 @@ class che_임관 extends Command\GeneralCommand{
|
|||||||
public function getCost():array{
|
public function getCost():array{
|
||||||
return [0, 0];
|
return [0, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreReqTurn():int{
|
public function getPreReqTurn():int{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -150,7 +150,7 @@ class che_임관 extends Command\GeneralCommand{
|
|||||||
$general->setVar('officer_level', 1);
|
$general->setVar('officer_level', 1);
|
||||||
$general->setVar('officer_city', 0);
|
$general->setVar('officer_city', 0);
|
||||||
$general->setVar('belong', 1);
|
$general->setVar('belong', 1);
|
||||||
|
|
||||||
if($this->destGeneralObj !== null){
|
if($this->destGeneralObj !== null){
|
||||||
$general->setVar('city', $this->destGeneralObj->getCityID());
|
$general->setVar('city', $this->destGeneralObj->getCityID());
|
||||||
}
|
}
|
||||||
@@ -171,6 +171,7 @@ class che_임관 extends Command\GeneralCommand{
|
|||||||
$general->setAuxVar('joinedNations', $joinedNations);
|
$general->setAuxVar('joinedNations', $joinedNations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$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();
|
||||||
@@ -221,17 +222,17 @@ class che_임관 extends Command\GeneralCommand{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($nation);
|
unset($nation);
|
||||||
ob_start();
|
ob_start();
|
||||||
?>
|
?>
|
||||||
국가에 임관합니다.<br>
|
국가에 임관합니다.<br>
|
||||||
이미 임관/등용되었던 국가는 다시 임관할 수 없습니다.<br>
|
이미 임관/등용되었던 국가는 다시 임관할 수 없습니다.<br>
|
||||||
바로 군주의 위치로 이동합니다.<br>
|
바로 군주의 위치로 이동합니다.<br>
|
||||||
임관할 국가를 목록에서 선택하세요.<br>
|
임관할 국가를 목록에서 선택하세요.<br>
|
||||||
<select class='formInput' name="destNationID" id="destNationID" size='1' style='color:white;background-color:black;'>
|
<select class='formInput' name="destNationID" id="destNationID" size='1' style='color:white;background-color:black;'>
|
||||||
<?php foreach($nationList as $nation): ?>
|
<?php foreach($nationList as $nation): ?>
|
||||||
<?php if(key_exists($nation['nation'], $hiddenItems)){ continue; } ?>
|
<?php if(key_exists($nation['nation'], $hiddenItems)){ continue; } ?>
|
||||||
<option
|
<option
|
||||||
value='<?=$nation['nation']?>'
|
value='<?=$nation['nation']?>'
|
||||||
style='<?=$nation['availableJoin']?'':'background-color:red;'?>'
|
style='<?=$nation['availableJoin']?'':'background-color:red;'?>'
|
||||||
>【<?=$nation['name']?> 】</option>
|
>【<?=$nation['name']?> 】</option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ class che_장비매매 extends Command\GeneralCommand{
|
|||||||
else if($itemCode == $general->getVar($itemType)){
|
else if($itemCode == $general->getVar($itemType)){
|
||||||
$this->fullConditionConstraints[] = ConstraintHelper::AlwaysFail('이미 가지고 있습니다.');
|
$this->fullConditionConstraints[] = ConstraintHelper::AlwaysFail('이미 가지고 있습니다.');
|
||||||
}
|
}
|
||||||
else if($itemType != 'item' && !buildItemClass($general->getVar($itemType))->isBuyable()){
|
else if(!buildItemClass($general->getVar($itemType))->isBuyable()){
|
||||||
$this->fullConditionConstraints[] = ConstraintHelper::AlwaysFail('이미 진귀한 것을 가지고 있습니다.');
|
$this->fullConditionConstraints[] = ConstraintHelper::AlwaysFail('이미 진귀한 것을 가지고 있습니다.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ namespace sammo\Command\General;
|
|||||||
|
|
||||||
use \sammo\{
|
use \sammo\{
|
||||||
DB, Util, JosaUtil,
|
DB, Util, JosaUtil,
|
||||||
General,
|
General,
|
||||||
ActionLogger,
|
ActionLogger,
|
||||||
GameConst, GameUnitConst,
|
GameConst, GameUnitConst,
|
||||||
LastTurn,
|
LastTurn,
|
||||||
@@ -73,7 +73,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
|
|||||||
ConstraintHelper::BeNeutral(),
|
ConstraintHelper::BeNeutral(),
|
||||||
ConstraintHelper::AllowJoinAction()
|
ConstraintHelper::AllowJoinAction()
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCommandDetailTitle():string{
|
public function getCommandDetailTitle():string{
|
||||||
@@ -105,7 +105,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
|
|||||||
public function getCost():array{
|
public function getCost():array{
|
||||||
return [0, 0];
|
return [0, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreReqTurn():int{
|
public function getPreReqTurn():int{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -155,7 +155,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
|
|||||||
$general->setVar('officer_level', 1);
|
$general->setVar('officer_level', 1);
|
||||||
$general->setVar('officer_city', 0);
|
$general->setVar('officer_city', 0);
|
||||||
$general->setVar('belong', 1);
|
$general->setVar('belong', 1);
|
||||||
|
|
||||||
if($this->destGeneralObj !== null){
|
if($this->destGeneralObj !== null){
|
||||||
$general->setVar('city', $this->destGeneralObj->getCityID());
|
$general->setVar('city', $this->destGeneralObj->getCityID());
|
||||||
}
|
}
|
||||||
@@ -176,6 +176,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
|
|||||||
$general->setAuxVar('joinedNations', $joinedNations);
|
$general->setAuxVar('joinedNations', $joinedNations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$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();
|
||||||
@@ -229,12 +230,12 @@ class che_장수대상임관 extends Command\GeneralCommand{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($nation);
|
unset($nation);
|
||||||
ob_start();
|
ob_start();
|
||||||
?>
|
?>
|
||||||
장수를 따라 임관합니다.<br>
|
장수를 따라 임관합니다.<br>
|
||||||
이미 임관/등용되었던 국가는 다시 임관할 수 없습니다.<br>
|
이미 임관/등용되었던 국가는 다시 임관할 수 없습니다.<br>
|
||||||
바로 군주의 위치로 이동합니다.<br>
|
바로 군주의 위치로 이동합니다.<br>
|
||||||
임관할 국가를 목록에서 선택하세요.<br>
|
임관할 국가를 목록에서 선택하세요.<br>
|
||||||
<select class='formInput' name="destGeneralID" id="destGeneralID" size='1' style='color:white;background-color:black;'>
|
<select class='formInput' name="destGeneralID" id="destGeneralID" size='1' style='color:white;background-color:black;'>
|
||||||
<?php foreach($generalList as $targetGeneral): ?>
|
<?php foreach($generalList as $targetGeneral): ?>
|
||||||
<?php if(key_exists($targetGeneral['nation'], $hiddenItems)){ continue; } ?>
|
<?php if(key_exists($targetGeneral['nation'], $hiddenItems)){ continue; } ?>
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ class che_첩보 extends Command\GeneralCommand
|
|||||||
$ded = Util::randRangeInt(1, 70);
|
$ded = Util::randRangeInt(1, 70);
|
||||||
|
|
||||||
[$reqGold, $reqRice] = $this->getCost();
|
[$reqGold, $reqRice] = $this->getCost();
|
||||||
|
$general->increaseInheritancePoint('active_action', 0.5);//NOTE: 첩보만 예외!
|
||||||
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||||
$general->increaseVarWithLimit('rice', -$reqRice, 0);
|
$general->increaseVarWithLimit('rice', -$reqRice, 0);
|
||||||
$general->addExperience($exp);
|
$general->addExperience($exp);
|
||||||
|
|||||||
@@ -223,9 +223,13 @@ class che_출병 extends Command\GeneralCommand
|
|||||||
$this->destCity['term'] = 3;
|
$this->destCity['term'] = 3;
|
||||||
|
|
||||||
$general->addDex($general->getCrewTypeObj(), $general->getVar('crew') / 100);
|
$general->addDex($general->getCrewTypeObj(), $general->getVar('crew') / 100);
|
||||||
|
if($general->getVar('crew') > 500 && $general->getVar('train') * $general->getVar('atmos') > 70 * 70){
|
||||||
|
//500명 이상, 모훈출, 모사출
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
|
}
|
||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
processWar($general, $this->nation, $this->destCity);
|
processWar($general, $this->nation, $this->destCity);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ namespace sammo\Command\General;
|
|||||||
|
|
||||||
use \sammo\{
|
use \sammo\{
|
||||||
DB, Util, JosaUtil,
|
DB, Util, JosaUtil,
|
||||||
General,
|
General,
|
||||||
ActionLogger,
|
ActionLogger,
|
||||||
GameConst, GameUnitConst,
|
GameConst, GameUnitConst,
|
||||||
Command
|
Command
|
||||||
@@ -31,18 +31,20 @@ class che_탈취 extends che_화계{
|
|||||||
$commandName = $this->getName();
|
$commandName = $this->getName();
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
// 탈취 최대 800 * 8 * sqrt(1 + (year - startyear) / 5) / 2
|
// 탈취 최대 800 * 8 * sqrt(1 + (year - startyear) / 4) / 2
|
||||||
$yearCoef = sqrt(1 + ($this->env['year'] - $this->env['startyear']) / 5) / 2;
|
$yearCoef = sqrt(1 + ($this->env['year'] - $this->env['startyear']) / 4) / 2;
|
||||||
$gold = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'] * $yearCoef;
|
$commRatio = $destCity['comm'] / $destCity['comm_max'];
|
||||||
$rice = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'] * $yearCoef;
|
$agriRatio = $destCity['agri'] / $destCity['agri_max'];
|
||||||
|
$gold = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'] * $yearCoef * (0.25 + $commRatio / 4);
|
||||||
|
$rice = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'] * $yearCoef * (0.25 + $agriRatio / 4);
|
||||||
|
|
||||||
if($destCity['supply']){
|
if($destCity['supply']){
|
||||||
[$destNationGold, $destNationRice] = $db->queryFirstList('SELECT gold,rice FROM nation WHERE nation=%i', $destNationID);
|
[$destNationGold, $destNationRice] = $db->queryFirstList('SELECT gold,rice FROM nation WHERE nation=%i', $destNationID);
|
||||||
|
|
||||||
$destNationGold -= $gold;
|
$destNationGold -= $gold;
|
||||||
$destNationRice -= $rice;
|
$destNationRice -= $rice;
|
||||||
|
|
||||||
if($destNationGold < GameConst::$minNationalGold) {
|
if($destNationGold < GameConst::$minNationalGold) {
|
||||||
$gold += $destNationGold - GameConst::$minNationalGold;
|
$gold += $destNationGold - GameConst::$minNationalGold;
|
||||||
$destNationGold = GameConst::$minNationalGold;
|
$destNationGold = GameConst::$minNationalGold;
|
||||||
}
|
}
|
||||||
@@ -50,7 +52,7 @@ class che_탈취 extends che_화계{
|
|||||||
$rice += $destNationRice - GameConst::$minNationalRice;
|
$rice += $destNationRice - GameConst::$minNationalRice;
|
||||||
$destNationRice = GameConst::$minNationalRice;
|
$destNationRice = GameConst::$minNationalRice;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->update('nation', [
|
$db->update('nation', [
|
||||||
'gold'=>$destNationGold,
|
'gold'=>$destNationGold,
|
||||||
'rice'=>$destNationRice
|
'rice'=>$destNationRice
|
||||||
@@ -96,5 +98,5 @@ class che_탈취 extends che_화계{
|
|||||||
|
|
||||||
$logger->pushGeneralActionLog("금<C>{$goldText}</> 쌀<C>{$riceText}</>을 획득했습니다.", ActionLogger::PLAIN);
|
$logger->pushGeneralActionLog("금<C>{$goldText}</> 쌀<C>{$riceText}</>을 획득했습니다.", ActionLogger::PLAIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -101,6 +101,7 @@ class che_하야 extends Command\GeneralCommand{
|
|||||||
$general->setVar('officer_city', 0);
|
$general->setVar('officer_city', 0);
|
||||||
$general->setVar('belong', 0);
|
$general->setVar('belong', 0);
|
||||||
$general->setVar('makelimit', 12);
|
$general->setVar('makelimit', 12);
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class che_감축 extends Command\NationCommand{
|
|||||||
|
|
||||||
$this->setCity();
|
$this->setCity();
|
||||||
$this->setNation(['gold', 'rice', 'capset', 'capital']);
|
$this->setNation(['gold', 'rice', 'capset', 'capital']);
|
||||||
|
|
||||||
if(!$this->nation['capital']){
|
if(!$this->nation['capital']){
|
||||||
$this->fullConditionConstraints=[
|
$this->fullConditionConstraints=[
|
||||||
ConstraintHelper::AlwaysFail('방랑상태에서는 불가능합니다.')
|
ConstraintHelper::AlwaysFail('방랑상태에서는 불가능합니다.')
|
||||||
@@ -55,7 +55,7 @@ class che_감축 extends Command\NationCommand{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->setDestCity($this->nation['capital']);
|
$this->setDestCity($this->nation['capital']);
|
||||||
|
|
||||||
[$reqGold, $reqRice] = $this->getCost();
|
[$reqGold, $reqRice] = $this->getCost();
|
||||||
|
|
||||||
$origCityLevel = CityConst::byID($this->nation['capital'])->level;
|
$origCityLevel = CityConst::byID($this->nation['capital'])->level;
|
||||||
@@ -78,10 +78,10 @@ class che_감축 extends Command\NationCommand{
|
|||||||
|
|
||||||
return "{$name}/{$reqTurn}턴(금 {$reqGold}, 쌀 {$reqRice} 회수)";
|
return "{$name}/{$reqTurn}턴(금 {$reqGold}, 쌀 {$reqRice} 회수)";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCost():array{
|
public function getCost():array{
|
||||||
$amount = $this->env['develcost'] * GameConst::$expandCityCostCoef + GameConst::$expandCityDefaultCost / 2;
|
$amount = $this->env['develcost'] * GameConst::$expandCityCostCoef + GameConst::$expandCityDefaultCost / 2;
|
||||||
|
|
||||||
return [$amount, $amount];
|
return [$amount, $amount];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,10 +157,10 @@ class che_감축 extends Command\NationCommand{
|
|||||||
$nationID = $general->getNationID();
|
$nationID = $general->getNationID();
|
||||||
$nationName = $this->nation['name'];
|
$nationName = $this->nation['name'];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$logger = $general->getLogger();
|
$logger = $general->getLogger();
|
||||||
|
|
||||||
|
|
||||||
$general->addExperience(5 * ($this->getPreReqTurn() + 1));
|
$general->addExperience(5 * ($this->getPreReqTurn() + 1));
|
||||||
$general->addDedication(5 * ($this->getPreReqTurn() + 1));
|
$general->addDedication(5 * ($this->getPreReqTurn() + 1));
|
||||||
@@ -192,13 +192,14 @@ class che_감축 extends Command\NationCommand{
|
|||||||
'gold' => $db->sqleval('gold + %i', $reqGold),
|
'gold' => $db->sqleval('gold + %i', $reqGold),
|
||||||
'rice' => $db->sqleval('rice + %i', $reqRice),
|
'rice' => $db->sqleval('rice + %i', $reqRice),
|
||||||
], 'nation=%i', $nationID);
|
], 'nation=%i', $nationID);
|
||||||
|
|
||||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaUl} 감축했습니다. <1>$date</>");
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaUl} 감축했습니다. <1>$date</>");
|
||||||
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaUl} <M>감축</>");
|
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaUl} <M>감축</>");
|
||||||
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>감축</>");
|
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>감축</>");
|
||||||
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>감축</>하였습니다.");
|
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>감축</>하였습니다.");
|
||||||
$logger->pushGlobalHistoryLog("<M><b>【감축】</b></><D><b>{$nationName}</b></>{$josaYiNation} <G><b>{$destCityName}</b></>{$josaUl} <M>감축</>하였습니다.");
|
$logger->pushGlobalHistoryLog("<M><b>【감축】</b></><D><b>{$nationName}</b></>{$josaYiNation} <G><b>{$destCityName}</b></>{$josaUl} <M>감축</>하였습니다.");
|
||||||
|
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0));
|
$this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0));
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ class che_국기변경 extends Command\NationCommand
|
|||||||
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <span style='color:{$color};'><b>국기</b></span>를 변경하였습니다");
|
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <span style='color:{$color};'><b>국기</b></span>를 변경하였습니다");
|
||||||
$logger->pushGlobalHistoryLog("<S><b>【국기변경】</b></><D><b>{$nationName}</b></>{$josaYiNation} <span style='color:{$color};'><b>국기</b></span>를 변경하였습니다.");
|
$logger->pushGlobalHistoryLog("<S><b>【국기변경】</b></><D><b>{$nationName}</b></>{$josaYiNation} <span style='color:{$color};'><b>국기</b></span>를 변경하였습니다.");
|
||||||
|
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0));
|
$this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0));
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ class che_국호변경 extends Command\NationCommand
|
|||||||
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} 국호를 <D><b>{$newNationName}</b></>{$josaRo} 변경합니다.");
|
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} 국호를 <D><b>{$newNationName}</b></>{$josaRo} 변경합니다.");
|
||||||
$logger->pushGlobalHistoryLog("<S><b>【국호변경】</b></><D><b>{$nationName}</b></>{$josaYiNation} 국호를 <D><b>{$newNationName}</b></>{$josaRo} 변경합니다.");
|
$logger->pushGlobalHistoryLog("<S><b>【국호변경】</b></><D><b>{$nationName}</b></>{$josaYiNation} 국호를 <D><b>{$newNationName}</b></>{$josaRo} 변경합니다.");
|
||||||
|
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0));
|
$this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0));
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ class che_물자원조 extends Command\NationCommand{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$josaRoSrc = JosaUtil::pick($nationName, '로');
|
$josaRoSrc = JosaUtil::pick($nationName, '로');
|
||||||
$destNationLogger = new ActionLogger(0, $destChiefID, $year, $month);
|
$destNationLogger = new ActionLogger(0, $destNationID, $year, $month);
|
||||||
$destNationLogger->pushNationalHistoryLog("<D><b>{$nationName}</b></>{$josaRoSrc}부터 금<C>{$goldAmountText}</> 쌀<C>{$riceAmountText}</>을 지원 받음");
|
$destNationLogger->pushNationalHistoryLog("<D><b>{$nationName}</b></>{$josaRoSrc}부터 금<C>{$goldAmountText}</> 쌀<C>{$riceAmountText}</>을 지원 받음");
|
||||||
|
|
||||||
$destNationStor = KVStorage::getStorage(DB::db(), $destNationID, 'nation_env');
|
$destNationStor = KVStorage::getStorage(DB::db(), $destNationID, 'nation_env');
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ class che_증축 extends Command\NationCommand{
|
|||||||
];
|
];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setDestCity($this->nation['capital']);
|
$this->setDestCity($this->nation['capital']);
|
||||||
|
|
||||||
[$reqGold, $reqRice] = $this->getCost();
|
[$reqGold, $reqRice] = $this->getCost();
|
||||||
|
|
||||||
$this->fullConditionConstraints=[
|
$this->fullConditionConstraints=[
|
||||||
@@ -76,10 +76,10 @@ class che_증축 extends Command\NationCommand{
|
|||||||
|
|
||||||
return "{$name}/{$reqTurn}턴(금 {$reqGold}, 쌀 {$reqRice})";
|
return "{$name}/{$reqTurn}턴(금 {$reqGold}, 쌀 {$reqRice})";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCost():array{
|
public function getCost():array{
|
||||||
$amount = $this->env['develcost'] * GameConst::$expandCityCostCoef + GameConst::$expandCityDefaultCost;
|
$amount = $this->env['develcost'] * GameConst::$expandCityCostCoef + GameConst::$expandCityDefaultCost;
|
||||||
|
|
||||||
return [$amount, $amount];
|
return [$amount, $amount];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,13 +155,14 @@ class che_증축 extends Command\NationCommand{
|
|||||||
$nationID = $general->getNationID();
|
$nationID = $general->getNationID();
|
||||||
$nationName = $this->nation['name'];
|
$nationName = $this->nation['name'];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$logger = $general->getLogger();
|
$logger = $general->getLogger();
|
||||||
|
|
||||||
|
|
||||||
$general->addExperience(5 * ($this->getPreReqTurn() + 1));
|
$general->addExperience(5 * ($this->getPreReqTurn() + 1));
|
||||||
$general->addDedication(5 * ($this->getPreReqTurn() + 1));
|
$general->addDedication(5 * ($this->getPreReqTurn() + 1));
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
|
|
||||||
$josaUl = JosaUtil::pick($destCityName, '을');
|
$josaUl = JosaUtil::pick($destCityName, '을');
|
||||||
$josaYi = JosaUtil::pick($generalName, '이');
|
$josaYi = JosaUtil::pick($generalName, '이');
|
||||||
@@ -183,7 +184,7 @@ class che_증축 extends Command\NationCommand{
|
|||||||
'gold' => $db->sqleval('gold - %i', $reqGold),
|
'gold' => $db->sqleval('gold - %i', $reqGold),
|
||||||
'rice' => $db->sqleval('rice - %i', $reqRice),
|
'rice' => $db->sqleval('rice - %i', $reqRice),
|
||||||
], 'nation=%i', $nationID);
|
], 'nation=%i', $nationID);
|
||||||
|
|
||||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaUl} 증축했습니다. <1>$date</>");
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaUl} 증축했습니다. <1>$date</>");
|
||||||
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaUl} <M>증축</>");
|
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaUl} <M>증축</>");
|
||||||
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>증축</>");
|
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>증축</>");
|
||||||
|
|||||||
@@ -218,6 +218,7 @@ class che_천도 extends Command\NationCommand
|
|||||||
'capset' => $db->sqleval('capset + 1'),
|
'capset' => $db->sqleval('capset + 1'),
|
||||||
], 'nation=%i', $nationID);
|
], 'nation=%i', $nationID);
|
||||||
|
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaRo} 천도했습니다. <1>$date</>");
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaRo} 천도했습니다. <1>$date</>");
|
||||||
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaRo} <M>천도</>명령");
|
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaRo} <M>천도</>명령");
|
||||||
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaRo} <M>천도</> 명령");
|
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaRo} <M>천도</> 명령");
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ class che_초토화 extends Command\NationCommand{
|
|||||||
\sammo\refreshNationStaticInfo();
|
\sammo\refreshNationStaticInfo();
|
||||||
\sammo\SetNationFront($nationID);
|
\sammo\SetNationFront($nationID);
|
||||||
|
|
||||||
|
$general->increaseInheritancePoint('active_action', 1);
|
||||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaUl} 초토화했습니다. <1>$date</>");
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaUl} 초토화했습니다. <1>$date</>");
|
||||||
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaUl} <M>초토화</> 명령");
|
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaUl} <M>초토화</> 명령");
|
||||||
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>초토화</> 명령");
|
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>초토화</> 명령");
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ class che_피장파장 extends Command\NationCommand{
|
|||||||
if(!key_exists('destNationID', $this->arg)){
|
if(!key_exists('destNationID', $this->arg)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if(!key_exists('commandType', $this->arg)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$destNationID = $this->arg['destNationID'];
|
$destNationID = $this->arg['destNationID'];
|
||||||
$commandType = $this->arg['commandType'];
|
$commandType = $this->arg['commandType'];
|
||||||
|
|
||||||
@@ -129,6 +132,7 @@ class che_피장파장 extends Command\NationCommand{
|
|||||||
$nextTerm = Util::round(sqrt($genCount*2)*10);
|
$nextTerm = Util::round(sqrt($genCount*2)*10);
|
||||||
|
|
||||||
$nextTerm = $this->generalObj->onCalcStrategic($this->getName(), 'delay', $nextTerm);
|
$nextTerm = $this->generalObj->onCalcStrategic($this->getName(), 'delay', $nextTerm);
|
||||||
|
$nextTerm = Util::valueFit($nextTerm, Util::round(static::$delayCnt * 1.2));
|
||||||
return $nextTerm;
|
return $nextTerm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,22 @@ class DummyGeneral extends General{
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getInheritancePoint(string $key, &$aux = null, bool $forceCalc = false){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setInheritancePoint(string $key, $value, $aux = null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function increaseInheritancePoint(string $key, $value, $aux = null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function mergeTotalInheritancePoint(){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
function applyDB($db):bool{
|
function applyDB($db):bool{
|
||||||
if($this->logger){
|
if($this->logger){
|
||||||
$this->initLogger(1, 1);
|
$this->initLogger(1, 1);
|
||||||
|
|||||||
@@ -9,9 +9,11 @@ use function sammo\pickGeneralFromPool;
|
|||||||
//기존 event_3.php
|
//기존 event_3.php
|
||||||
class CreateManyNPC extends \sammo\Event\Action{
|
class CreateManyNPC extends \sammo\Event\Action{
|
||||||
protected $npcCount;
|
protected $npcCount;
|
||||||
|
protected $fillCnt;
|
||||||
protected $avgGen;
|
protected $avgGen;
|
||||||
public function __construct($npcCount = 10){
|
public function __construct($npcCount = 10, $fillCnt = 0){
|
||||||
$this->npcCount = $npcCount;
|
$this->npcCount = $npcCount;
|
||||||
|
$this->fillCnt = $fillCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function generateNPC($env, int $cnt){
|
protected function generateNPC($env, int $cnt){
|
||||||
@@ -41,13 +43,23 @@ class CreateManyNPC extends \sammo\Event\Action{
|
|||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function run(array $env){
|
public function run(array $env){
|
||||||
if($this->npcCount <= 0){
|
if($this->npcCount <= 0 && $this->fillCnt <= 0){
|
||||||
return [__CLASS__, []];
|
return [__CLASS__, []];
|
||||||
}
|
}
|
||||||
$result = $this->generateNPC($env, $this->npcCount);
|
|
||||||
|
|
||||||
|
$moreGenCnt = 0;
|
||||||
|
if($this->fillCnt){
|
||||||
|
$db = DB::db();
|
||||||
|
$nations = $db->queryFirstColumn('SELECT nation FROM general WHERE npc < 2 AND officer_level = 12');
|
||||||
|
$regGens = $db->queryFirstField('SELECT count(*) FROM general WHERE nation IN %li AND npc < 4', $nations);
|
||||||
|
$moreGenCnt = count($nations) * $this->fillCnt - $regGens;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $this->generateNPC($env, $this->npcCount + $moreGenCnt);
|
||||||
|
|
||||||
$logger = new \sammo\ActionLogger(0, 0, $env['year'], $env['month']);
|
$logger = new \sammo\ActionLogger(0, 0, $env['year'], $env['month']);
|
||||||
$genCnt = count($result);
|
$genCnt = count($result);
|
||||||
@@ -62,6 +74,6 @@ class CreateManyNPC extends \sammo\Event\Action{
|
|||||||
$logger->pushGlobalHistoryLog("장수 <C>{$genCnt}</>명이 <S>등장</>했습니다.", \sammo\ActionLogger::NOTICE_YEAR_MONTH);
|
$logger->pushGlobalHistoryLog("장수 <C>{$genCnt}</>명이 <S>등장</>했습니다.", \sammo\ActionLogger::NOTICE_YEAR_MONTH);
|
||||||
$logger->flush();
|
$logger->flush();
|
||||||
|
|
||||||
return [__CLASS__, $result];
|
return [__CLASS__, $result];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,14 +195,21 @@ class GameConstBase
|
|||||||
'che_은둔', 'None'
|
'che_은둔', 'None'
|
||||||
];
|
];
|
||||||
|
|
||||||
public static $inheritBornSpecialPoint = 12000;
|
public static $maxUniqueItemLimit = [
|
||||||
|
[-1, 1],
|
||||||
|
[3, 2],
|
||||||
|
[10, 3],
|
||||||
|
[20, 4]
|
||||||
|
];
|
||||||
|
|
||||||
|
public static $inheritBornSpecialPoint = 6000;
|
||||||
public static $inheritBornTurntimePoint = 3000;
|
public static $inheritBornTurntimePoint = 3000;
|
||||||
public static $inheritBornCityPoint = 1000;
|
public static $inheritBornCityPoint = 1000;
|
||||||
public static $inheritBornStatPoint = 1000;
|
public static $inheritBornStatPoint = 1000;
|
||||||
public static $inheritItemUniqueMinPoint = 5000;
|
public static $inheritItemUniqueMinPoint = 5000;
|
||||||
public static $inheritItemRandomPoint = 3000;
|
public static $inheritItemRandomPoint = 3000;
|
||||||
public static $inheritBuffPoints = [0, 250, 750, 1500, 2500, 3750];
|
public static $inheritBuffPoints = [0, 200, 600, 1200, 2000, 3000];
|
||||||
public static $inheritSpecificSpecialPoint = 5000;
|
public static $inheritSpecificSpecialPoint = 4000;
|
||||||
public static $inheritResetAttrPointBase = [1000, 1000, 2000, 3000];//필요하면 늘려서 쓰기
|
public static $inheritResetAttrPointBase = [1000, 1000, 2000, 3000];//필요하면 늘려서 쓰기
|
||||||
|
|
||||||
public static $allItems = [
|
public static $allItems = [
|
||||||
|
|||||||
@@ -58,7 +58,8 @@ class General implements iAction
|
|||||||
'lived_month' => [true, 1, '생존'],
|
'lived_month' => [true, 1, '생존'],
|
||||||
'max_belong' => [false, 10, '최대 임관년 수'],
|
'max_belong' => [false, 10, '최대 임관년 수'],
|
||||||
'max_domestic_critical' => [true, 1, '최대 연속 내정 성공'],
|
'max_domestic_critical' => [true, 1, '최대 연속 내정 성공'],
|
||||||
'snipe_combat' => [true, 10, '병종 상성 우위 횟수'],
|
'active_action' => [true, 3, '능동 행동 수'],
|
||||||
|
//'snipe_combat' => [true, 10, '병종 상성 우위 횟수'],
|
||||||
'combat' => [['rank', 'warnum'], 5, '전투 횟수'],
|
'combat' => [['rank', 'warnum'], 5, '전투 횟수'],
|
||||||
'sabotage' => [['rank', 'firenum'], 20, '계략 성공 횟수'],
|
'sabotage' => [['rank', 'firenum'], 20, '계략 성공 횟수'],
|
||||||
'unifier' => [true, 1, '천통 기여'],
|
'unifier' => [true, 1, '천통 기여'],
|
||||||
|
|||||||
+862
-822
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@ class che_도시치료 extends BaseGeneralTrigger{
|
|||||||
/** @var \sammo\General $general */
|
/** @var \sammo\General $general */
|
||||||
$general = $this->object;
|
$general = $this->object;
|
||||||
$logger = $general->getLogger();
|
$logger = $general->getLogger();
|
||||||
|
|
||||||
if($general->getVar('injury') > 0){
|
if($general->getVar('injury') > 0){
|
||||||
$general->updateVar('injury', 0);
|
$general->updateVar('injury', 0);
|
||||||
$general->activateSkill('pre.부상경감', 'pre.치료');
|
$general->activateSkill('pre.부상경감', 'pre.치료');
|
||||||
@@ -25,8 +25,8 @@ class che_도시치료 extends BaseGeneralTrigger{
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
$patients = $db->queryAllLists(
|
$patients = $db->queryAllLists(
|
||||||
'SELECT no,name,nation FROM general WHERE city=%i AND injury > 10 AND no != %i',
|
'SELECT no,name,nation FROM general WHERE city=%i AND injury > 10 AND no != %i',
|
||||||
$general->getCityID(),
|
$general->getCityID(),
|
||||||
$general->getID()
|
$general->getID()
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ class che_도시치료 extends BaseGeneralTrigger{
|
|||||||
return $env;
|
return $env;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(count($cureList) == 1){
|
if(count($cureList) == 1){
|
||||||
$josaUl = JosaUtil::pick($curedPatientName, "을");
|
$josaUl = JosaUtil::pick($curedPatientName, "을");
|
||||||
$logger->pushGeneralActionLog("<C>의술</>을 펼쳐 도시의 장수 <Y>{$curedPatientName}</>{$josaUl} 치료합니다!", ActionLogger::PLAIN);
|
$logger->pushGeneralActionLog("<C>의술</>을 펼쳐 도시의 장수 <Y>{$curedPatientName}</>{$josaUl} 치료합니다!", ActionLogger::PLAIN);
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class ResetHelper{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($mysqli_obj->multi_query(file_get_contents($servRoot.'/sql/schema.sql'))){
|
if($mysqli_obj->multi_query(file_get_contents($servRoot.'/sql/schema.sql'))){
|
||||||
@@ -128,7 +128,7 @@ class ResetHelper{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
opcache_reset();
|
//opcache_reset();
|
||||||
|
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$gameStor->resetValues();
|
$gameStor->resetValues();
|
||||||
@@ -180,7 +180,7 @@ class ResetHelper{
|
|||||||
|
|
||||||
$serverID = $clearResult['serverID'];
|
$serverID = $clearResult['serverID'];
|
||||||
$seasonIdx = $clearResult['seasonIdx'];
|
$seasonIdx = $clearResult['seasonIdx'];
|
||||||
|
|
||||||
$scenarioObj = new Scenario($scenario, true);
|
$scenarioObj = new Scenario($scenario, true);
|
||||||
$scenarioObj->buildConf();
|
$scenarioObj->buildConf();
|
||||||
$scenarioObj->initFull();
|
$scenarioObj->initFull();
|
||||||
@@ -316,7 +316,7 @@ class ResetHelper{
|
|||||||
}
|
}
|
||||||
$db->insert('general_turn', $turnRows);
|
$db->insert('general_turn', $turnRows);
|
||||||
|
|
||||||
|
|
||||||
$rank_data = [];
|
$rank_data = [];
|
||||||
foreach(array_keys(General::RANK_COLUMN) as $rankColumn){
|
foreach(array_keys(General::RANK_COLUMN) as $rankColumn){
|
||||||
$rank_data[] = [
|
$rank_data[] = [
|
||||||
@@ -345,7 +345,7 @@ class ResetHelper{
|
|||||||
'scenario'=>$scenario,
|
'scenario'=>$scenario,
|
||||||
'scenario_name'=>$scenarioObj->getTitle(),
|
'scenario_name'=>$scenarioObj->getTitle(),
|
||||||
'env'=>Json::encode($env)
|
'env'=>Json::encode($env)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$scenarioObj->build($env);
|
$scenarioObj->build($env);
|
||||||
|
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ class GeneralBuilder{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$this->dex1 && in_array('dex_t', $avgGen)){
|
if(!$this->dex1 && key_exists('dex_t', $avgGen)){
|
||||||
$dexTotal = $avgGen['dex_t'];
|
$dexTotal = $avgGen['dex_t'];
|
||||||
if ($pickType == '무') {
|
if ($pickType == '무') {
|
||||||
$dexVal = Util::choiceRandom([
|
$dexVal = Util::choiceRandom([
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class SpecialityHelper{
|
|||||||
if($leadership > GameConst::$chiefStatMin){
|
if($leadership > GameConst::$chiefStatMin){
|
||||||
$myCond |= self::STAT_LEADERSHIP;
|
$myCond |= self::STAT_LEADERSHIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($strength >= $intel * 0.95 && $strength > GameConst::$chiefStatMin){
|
if($strength >= $intel * 0.95 && $strength > GameConst::$chiefStatMin){
|
||||||
$myCond |= self::STAT_STRENGTH;
|
$myCond |= self::STAT_STRENGTH;
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ class SpecialityHelper{
|
|||||||
}
|
}
|
||||||
if($strength < GameConst::$chiefStatMin){
|
if($strength < GameConst::$chiefStatMin){
|
||||||
$myCond |= self::STAT_NOT_STRENGTH;
|
$myCond |= self::STAT_NOT_STRENGTH;
|
||||||
}
|
}
|
||||||
if($intel < GameConst::$chiefStatMin){
|
if($intel < GameConst::$chiefStatMin){
|
||||||
$myCond |= self::STAT_NOT_INTEL;
|
$myCond |= self::STAT_NOT_INTEL;
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ class SpecialityHelper{
|
|||||||
$myCond |= self::STAT_INTEL;
|
$myCond |= self::STAT_INTEL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $myCond;
|
return $myCond;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ class SpecialityHelper{
|
|||||||
$specialObj = buildGeneralSpecialWarClass(GameConst::$defaultSpecialWar);
|
$specialObj = buildGeneralSpecialWarClass(GameConst::$defaultSpecialWar);
|
||||||
$result[GameConst::$defaultSpecialWar] = $specialObj;
|
$result[GameConst::$defaultSpecialWar] = $specialObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(GameConst::$availableSpecialWar as $specialID){
|
foreach(GameConst::$availableSpecialWar as $specialID){
|
||||||
$specialObj = buildGeneralSpecialWarClass($specialID);
|
$specialObj = buildGeneralSpecialWarClass($specialID);
|
||||||
$result[$specialID] = $specialObj;
|
$result[$specialID] = $specialObj;
|
||||||
@@ -220,7 +220,7 @@ class SpecialityHelper{
|
|||||||
if(in_array($specialID, $prevSpecials)){
|
if(in_array($specialID, $prevSpecials)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($weightType === static::WEIGHT_PERCENT){
|
if($weightType === static::WEIGHT_PERCENT){
|
||||||
$pAbs[$specialID] = $weight;
|
$pAbs[$specialID] = $weight;
|
||||||
@@ -229,7 +229,7 @@ class SpecialityHelper{
|
|||||||
$pRel[$specialID] = $weight;
|
$pRel[$specialID] = $weight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($pAbs){
|
if($pAbs){
|
||||||
if($pRel){
|
if($pRel){
|
||||||
$pAbs[0] = max(0, 100 - array_sum($pAbs));
|
$pAbs[0] = max(0, 100 - array_sum($pAbs));
|
||||||
@@ -280,7 +280,7 @@ class SpecialityHelper{
|
|||||||
if(in_array($specialID, $prevSpecials)){
|
if(in_array($specialID, $prevSpecials)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($cond & self::REQ_DEXTERITY){
|
if($cond & self::REQ_DEXTERITY){
|
||||||
$reqDex[$specialID] = $weight;
|
$reqDex[$specialID] = $weight;
|
||||||
@@ -296,7 +296,7 @@ class SpecialityHelper{
|
|||||||
if($reqDex){
|
if($reqDex){
|
||||||
return Util::choiceRandomUsingWeight($reqDex);
|
return Util::choiceRandomUsingWeight($reqDex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($pAbs){
|
if($pAbs){
|
||||||
if($pRel){
|
if($pRel){
|
||||||
$pAbs[0] = max(0, 100 - array_sum($pAbs));
|
$pAbs[0] = max(0, 100 - array_sum($pAbs));
|
||||||
|
|||||||
@@ -238,6 +238,7 @@ class TurnExecutionHelper
|
|||||||
$turnObj = new static($general);
|
$turnObj = new static($general);
|
||||||
|
|
||||||
$env = $gameStor->getAll(true);
|
$env = $gameStor->getAll(true);
|
||||||
|
[$startYear, $year, $month, $turnterm] = $gameStor->getValuesAsArray(['startyear', 'year', 'month', 'turnterm']);
|
||||||
|
|
||||||
$hasNationTurn = false;
|
$hasNationTurn = false;
|
||||||
if ($general->getVar('nation') != 0 && $general->getVar('officer_level') >= 5) {
|
if ($general->getVar('nation') != 0 && $general->getVar('officer_level') >= 5) {
|
||||||
@@ -263,13 +264,22 @@ class TurnExecutionHelper
|
|||||||
|
|
||||||
$turnObj->preprocessCommand($env);
|
$turnObj->preprocessCommand($env);
|
||||||
|
|
||||||
if ($general->getNPCType() >= 2 || ($autorun_user['limit_minutes'] ?? false)) {
|
if ($general->getNPCType() >= 2){
|
||||||
$ai = new GeneralAI($turnObj->getGeneral());
|
$ai = new GeneralAI($turnObj->getGeneral());
|
||||||
|
} else {
|
||||||
|
$limitYearMonth = $general->getAuxVar('autorun_limit')??Util::joinYearMonth($year-2, $month);
|
||||||
|
if(Util::joinYearMonth($year, $month) < $limitYearMonth){
|
||||||
|
$ai = new GeneralAI($turnObj->getGeneral());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
$hasReservedTurn = false;
|
||||||
|
|
||||||
if (!$turnObj->processBlocked()) {
|
if (!$turnObj->processBlocked()) {
|
||||||
|
|
||||||
if ($hasNationTurn) {
|
if ($hasNationTurn) {
|
||||||
|
if (!($nationCommandObj instanceof Command\Nation\휴식)) {
|
||||||
|
$hasReservedTurn = true;
|
||||||
|
}
|
||||||
if ($ai && ($general->getAuxVar('use_auto_nation_turn') ?? 1)) {
|
if ($ai && ($general->getAuxVar('use_auto_nation_turn') ?? 1)) {
|
||||||
$nationCommandObj = $ai->chooseNationTurn($nationCommandObj);
|
$nationCommandObj = $ai->chooseNationTurn($nationCommandObj);
|
||||||
$cityName = CityConst::byID($general->getCityID())->name;
|
$cityName = CityConst::byID($general->getCityID())->name;
|
||||||
@@ -283,6 +293,9 @@ class TurnExecutionHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
$generalCommandObj = $general->getReservedTurn(0, $env);
|
$generalCommandObj = $general->getReservedTurn(0, $env);
|
||||||
|
if (!($generalCommandObj instanceof Command\General\휴식)) {
|
||||||
|
$hasReservedTurn = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ($ai) {
|
if ($ai) {
|
||||||
$newGeneralCommandObj = $ai->chooseGeneralTurn($generalCommandObj); // npc AI 처리
|
$newGeneralCommandObj = $ai->chooseGeneralTurn($generalCommandObj); // npc AI 처리
|
||||||
@@ -302,6 +315,13 @@ class TurnExecutionHelper
|
|||||||
$currentTurn = $general->getTurnTime();
|
$currentTurn = $general->getTurnTime();
|
||||||
$general->increaseVarWithLimit('myset', 3, null, 9);
|
$general->increaseVarWithLimit('myset', 3, null, 9);
|
||||||
|
|
||||||
|
if(($autorun_user['limit_minutes']??false) && $general->getNPCType() < 2 && $hasReservedTurn){
|
||||||
|
$autorun_limit = Util::joinYearMonth($year, $month);
|
||||||
|
$autorun_limit += intdiv($autorun_user['limit_minutes'], $turnterm);
|
||||||
|
|
||||||
|
$general->setAuxVar('autorun_limit', $autorun_limit);
|
||||||
|
}
|
||||||
|
|
||||||
$turnObj->updateTurnTime();
|
$turnObj->updateTurnTime();
|
||||||
$turnObj->applyDB();
|
$turnObj->applyDB();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ class WarUnitGeneral extends WarUnit
|
|||||||
$semiTurn = $general->getTurnTime();
|
$semiTurn = $general->getTurnTime();
|
||||||
} else if ($oppose !== null) {
|
} else if ($oppose !== null) {
|
||||||
$semiTurn = $oppose->getGeneral()->getTurnTime();
|
$semiTurn = $oppose->getGeneral()->getTurnTime();
|
||||||
|
} else {
|
||||||
|
LogText("WarUnitGeneral::setOppose", "defender인데 oppose가 null {$general->getID()}, {$general->getTurnTime()}");
|
||||||
|
$semiTurn = $general->getTurnTime();
|
||||||
}
|
}
|
||||||
$phase = $this->getRealPhase();
|
$phase = $this->getRealPhase();
|
||||||
$semiTurn = substr($semiTurn, 0, strlen($semiTurn) - 2);
|
$semiTurn = substr($semiTurn, 0, strlen($semiTurn) - 2);
|
||||||
@@ -154,7 +157,13 @@ class WarUnitGeneral extends WarUnit
|
|||||||
$general->increaseRankVar('occupied', 1);
|
$general->increaseRankVar('occupied', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$general->multiplyVarWithLimit('atmos', 1.1, null, GameConst::$maxAtmosByWar);
|
if($this->isAttacker()){
|
||||||
|
$general->multiplyVarWithLimit('atmos', 1.1, null, GameConst::$maxAtmosByWar);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$general->multiplyVarWithLimit('atmos', 1.05, null, GameConst::$maxAtmosByWar);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->addStatExp(1);
|
$this->addStatExp(1);
|
||||||
}
|
}
|
||||||
@@ -205,7 +214,7 @@ class WarUnitGeneral extends WarUnit
|
|||||||
if ($this->isAttacker) {
|
if ($this->isAttacker) {
|
||||||
if ($officerLevel == 12) {
|
if ($officerLevel == 12) {
|
||||||
$warPower *= 1.10;
|
$warPower *= 1.10;
|
||||||
} else if ($officerLevel == 11 | $officerLevel == 10 || $officerLevel == 8 || $officerLevel == 6) {
|
} else if ($officerLevel == 11 || $officerLevel == 10 || $officerLevel == 8 || $officerLevel == 6) {
|
||||||
$warPower *= 1.05;
|
$warPower *= 1.05;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class che_전투치료발동 extends BaseWarUnitTrigger{
|
|||||||
}
|
}
|
||||||
$selfEnv['치료발동'] = true;
|
$selfEnv['치료발동'] = true;
|
||||||
|
|
||||||
$oppose->getLogger()->pushGeneralBattleDetailLog("상대가 <C>치료</>했다!", ActionLogger::PLAIN);
|
$oppose->getLogger()->pushGeneralBattleDetailLog("상대가 <R>치료</>했다!", ActionLogger::PLAIN);
|
||||||
$self->getLogger()->pushGeneralBattleDetailLog("<C>치료</>했다!", ActionLogger::PLAIN);
|
$self->getLogger()->pushGeneralBattleDetailLog("<C>치료</>했다!", ActionLogger::PLAIN);
|
||||||
|
|
||||||
$oppose->multiplyWarPowerMultiply(0.5);
|
$oppose->multiplyWarPowerMultiply(0.5);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"events":[
|
"events":[
|
||||||
[
|
[
|
||||||
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
|
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
|
||||||
["CreateManyNPC", 30],
|
["CreateManyNPC", 10, 10],
|
||||||
["DeleteEvent"]
|
["DeleteEvent"]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"events":[
|
"events":[
|
||||||
[
|
[
|
||||||
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
|
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
|
||||||
["CreateManyNPC", 30],
|
["CreateManyNPC", 10, 10],
|
||||||
["DeleteEvent"]
|
["DeleteEvent"]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
"events":[
|
"events":[
|
||||||
[
|
[
|
||||||
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
|
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
|
||||||
["CreateManyNPC", 30],
|
["CreateManyNPC", 10, 10],
|
||||||
["DeleteEvent"]
|
["DeleteEvent"]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"title": "【가상모드19b】 진유저무쌍! (대형 지도)",
|
"title": "【가상모드19b】 진유저무쌍! (대형 지도)",
|
||||||
"startYear": 180,
|
"startYear": 180,
|
||||||
"history": [
|
"history": [
|
||||||
"<C>●</>180년 1월:<L><b>【가상모드19ㅠ】</b>진유저무쌍! (대형 지도)</>",
|
"<C>●</>180년 1월:<L><b>【가상모드19】</b>진유저무쌍! (대형 지도)</>",
|
||||||
"<C>●</>180년 1월:<L><b>【이벤트】</b></>고대장수 다 덤벼라! 유저가 최강이다!"
|
"<C>●</>180년 1월:<L><b>【이벤트】</b></>고대장수 다 덤벼라! 유저가 최강이다!"
|
||||||
],
|
],
|
||||||
"stat": {
|
"stat": {
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
{
|
||||||
|
"title": "【가상모드23】 CookieRun : Kingdom",
|
||||||
|
"startYear": 180,
|
||||||
|
"history": [
|
||||||
|
"<C>●</>180년 1월:<L><b>【가상모드23】</b>CookieRun : Kingdom</>",
|
||||||
|
"<C>●</>180년 1월:<L><b>【이벤트】</b></>쿠키들과 함께하는 삼모전"
|
||||||
|
],
|
||||||
|
"stat": {
|
||||||
|
"total": 200,
|
||||||
|
"min": 10,
|
||||||
|
"max": 90,
|
||||||
|
"npcTotal":180,
|
||||||
|
"npcMax":70,
|
||||||
|
"npcMin":10,
|
||||||
|
"chiefMin": 60
|
||||||
|
},
|
||||||
|
"iconPath": "쿠키런킹덤",
|
||||||
|
"fiction": 1,
|
||||||
|
"nation":[
|
||||||
|
|
||||||
|
],
|
||||||
|
"map":{
|
||||||
|
"mapName":"miniche",
|
||||||
|
"unitSet":"che"
|
||||||
|
},
|
||||||
|
"diplomacy":[],
|
||||||
|
"general":[
|
||||||
|
[30, "커스터드3세", null, 0, null, 60, 60, 60, 0, 160, 300, null, null, "새로운 백성이로구나. 반가워!"],
|
||||||
|
[30, "클로버", null, 0, null, 71, 49, 71, 0, 160, 300, null, null, "여러분의 모험에 행운이 깃들길..."],
|
||||||
|
[50, "마들렌", null, 0, null, 73, 57, 73, 0, 160, 300, null, null, "빛의 신께 세상을 구하라는 명을 받은 쿠키가 바로 나다!"],
|
||||||
|
[50, "호밀", null, 0, null, 73, 65, 65, 0, 160, 300, null, null, "애송이들! 그렇게 부드러워서야 되겠어?"],
|
||||||
|
[50, "에스프레소", null, 0, null, 75, 55, 75, 0, 160, 300, null, null, "커피마법이라고 다를 것 없습니다?"],
|
||||||
|
[50, "라떼", null, 0, null, 72, 58, 72, 0, 160, 300, null, null, "쓰디 쓴 실패라도 부드러운 우유 몇 방울이면 달콤해질거야"],
|
||||||
|
[50, "아몬드", null, 0, null, 69, 30, 100, 0, 160, 300, null, null, "당신을 마법 행정 규약 위반으로 체포합니다"],
|
||||||
|
[50, "블랙레이즌", null, 0, null, 65, 70, 60, 0, 160, 300, null, null, "깜깜한 어둠 속도 상관 없어. 난 전부 보이니까!"],
|
||||||
|
[60, "감초", null, 0, null, 70, 10, 120, 0, 160, 300, null, null, "나도 할 땐 하는 쿠키야!"],
|
||||||
|
[60, "독버섯", null, 0, null, 70, 60, 70, 0, 160, 300, null, null, "버서엇...?"],
|
||||||
|
[60, "딸기크레페", null, 0, null, 70, 60, 70, 0, 160, 300, null, null],
|
||||||
|
[70, "퓨어바닐라", null, 0, null, 90, 45, 90, 0, 160, 300, null, null, "힘들 땐 힘들다고 말해도 괜찮아요."],
|
||||||
|
[60, "다크초코", null, 0, null, 70, 60, 70, 0, 160, 300, null, null, "그저… 영웅이 되고 싶었을 뿐…"],
|
||||||
|
[60, "석류", null, 0, null, 75, 55, 75, 0, 160, 300, null, null, "영원히 그분만을 섬기리…"],
|
||||||
|
[999, "설탕노움", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[10, "The브레이브", null, 0, null, 69, 51, 69, 0, 160, 300, null, null, "모험은 이제부터 시작이야!"],
|
||||||
|
[10, "스트로베리", null, 0, null, 70, 50, 70, 0, 160, 300, null, null, "쿠키생은 혼자야…"],
|
||||||
|
[10, "매지션", null, 0, null, 66, 54, 66, 0, 160, 300, null, null, "가슴은 뜨겁게 머리는 앗 차거!"],
|
||||||
|
[10, "에인절", null, 0, null, 63, 57, 63, 0, 160, 300, null, null, "새처럼 날아가 볼까요…"],
|
||||||
|
[10, "비트", null, 0, null, 64, 56, 64, 0, 160, 300, null, null, "벌써 이곳에서 1000일을 버텼지!"],
|
||||||
|
[10, "The머슬", null, 0, null, 70, 50, 70, 0, 160, 300, null, null, "이번엔 스쿼트다! 하나! 둘!"],
|
||||||
|
[10, "닌자", null, 0, null, 63, 57, 63, 0, 160, 300, null, null, "허공을 가르고 바람을 밟는다!"],
|
||||||
|
[30, "용사", null, 0, null, 67, 58, 67, 0, 160, 300, null, null, "더 강해져야 해!"],
|
||||||
|
[30, "알케미스트", null, 0, null, 61, 64, 61, 0, 160, 300, null, null, "내가 어떤 걸 만들어 내는지 잘 보라구~!"],
|
||||||
|
[30, "체리", null, 0, null, 66, 59, 66, 0, 160, 300, null, null, "어랏? 터져버렸네~? 미안...일부러 그랬어~ 헤헷!"],
|
||||||
|
[30, "버블껌", null, 0, null, 65, 60, 65, 0, 160, 300, null, null, "껌은 씹는 것 보다 쏘는 게 더 재밌어!"],
|
||||||
|
[30, "블랙베리", null, 0, null, 65, 60, 65, 0, 160, 300, null, null, "맡기실 일이 있다면 뭐든 말씀하세요."],
|
||||||
|
[30, "팬케이크", null, 0, null, 52, 73, 52, 0, 160, 300, null, null, "나 도토리젤리 안 줄 거야?"],
|
||||||
|
[30, "The프린세스", null, 0, null, 60, 65, 60, 0, 160, 300, null, null, "나들이하기 좋은 날이네~!"],
|
||||||
|
[30, "아보카도", null, 0, null, 67, 58, 67, 0, 160, 300, null, null, "가장 맛있는 싸움은? 보쌈! 와하하!"],
|
||||||
|
[30, "어니언", null, 0, null, 72, 53, 72, 0, 160, 300, null, null, "으아아아아앙~"],
|
||||||
|
[30, "익스플로러", null, 0, null, 65, 60, 65, 0, 160, 300, null, null, "가보고 싶은 곳이 너무 많아!"],
|
||||||
|
[30, "캐롯", null, 0, null, 71, 54, 71, 0, 160, 300, null, null, "밭일하러 나갈 시간이야!"],
|
||||||
|
[60, "뱀파이어", null, 0, null, 58, 72, 58, 0, 160, 300, null, null, "나랑 포도주스 한 잔 어때?"],
|
||||||
|
[50, "스파클링", null, 0, null, 70, 60, 70, 0, 160, 300, null, null, "승리를 위한 한 잔이 필요하겠군요!"],
|
||||||
|
[50, "칠리", null, 0, null, 65, 65, 65, 0, 160, 300, null, null, "어이! 주머니 조심하라구!"],
|
||||||
|
[50, "자색고구마", null, 0, null, 65, 65, 65, 0, 160, 300, null, null, "나랑 싸울 쿠키 다 나와!"],
|
||||||
|
[50, "눈설탕", null, 0, null, 79, 51, 79, 0, 160, 300, null, null, "안녕? 반가워~ 나랑... 눈싸움할래?"],
|
||||||
|
[50, "정글전사", null, 0, null, 80, 50, 80, 0, 160, 300, null, null, "친구…들을… 지켜야… 해…"],
|
||||||
|
[50, "민트초코", null, 0, null, 76, 54, 76, 0, 160, 300, null, null, "어떤 음악을 들려드릴까요?"],
|
||||||
|
[50, "허브", null, 0, null, 71, 59, 71, 0, 160, 300, null, null, "무럭무럭 자라렴~"],
|
||||||
|
[50, "우유", null, 0, null, 72, 58, 72, 0, 160, 300, null, null, "평화를 위해 어둠과 맞서 싸우리라!"],
|
||||||
|
[50, "웨어울프", null, 0, null, 72, 58, 72, 0, 160, 300, null, null, "다가오지 마… 다쳐…"],
|
||||||
|
[50, "구미호", null, 0, null, 72, 58, 72, 0, 160, 300, null, null, "나한테 반하면 어떻게 되는지 궁금해?"],
|
||||||
|
[50, "슈크림", null, 0, null, 71, 59, 71, 0, 160, 300, null, null, "저도 이제 어엿한 마법사라구요!"],
|
||||||
|
[150, "케이크들개", null, 0, null, 40, 80, 40, 0, 160, 300, null, null],
|
||||||
|
[999, "곰젤리", null, 0, null, 40, 80, 40, 0, 160, 300, null, null],
|
||||||
|
[999, "곰젤리역장", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[999, "후르츠칸앵무", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[999, "순례자", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[999, "은행강도", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[999, "무녀", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[150, "역사선생님", null, 0, null, 85, 45, 85, 0, 160, 300, null, null, "오늘 확실히 가르쳐 주겠습니다! 도서관의 규칙을!"],
|
||||||
|
[150, "화학선생님", null, 0, null, 85, 45, 85, 0, 160, 300, null, null, "화학실에 멋대로 침입한 벌을 내리겠다!!"],
|
||||||
|
[150, "전술선생님", null, 0, null, 85, 45, 85, 0, 160, 300, null, null, "으하하하!! 그럼 어디 한 번 시험해 볼까! 너의 전술을!"],
|
||||||
|
[150, "꿈꾸는 바할로모트", null, 0, null, 90, 40, 90, 0, 160, 300, null, "환술", "난 이 학교의 교장이니까 말일세!"],
|
||||||
|
[999, "치료사", null, 0, null, 65, 55, 65, 0, 160, 300, null, null],
|
||||||
|
[999, "커스터드총리", null, 0, null, 63, 63, 63, 0, 160, 300, null, null],
|
||||||
|
[150, "3단케이크마녀", null, 0, null, 70, 70, 70, 0, 160, 300, null, null]
|
||||||
|
],
|
||||||
|
"general_ex":[
|
||||||
|
[999, "바람궁수", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[999, "달빛술사", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[999, "바다요정", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[999, "불꽃정령", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[150, "어둠마녀", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[999, "천년나무", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[999, "다크카카오", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[999, "세인트릴리", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[999, "홀리베리", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
|
||||||
|
[999, "골드치즈", null, 0, null, 60, 60, 60, 0, 160, 300, null, null]
|
||||||
|
],
|
||||||
|
"events":[
|
||||||
|
[
|
||||||
|
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
|
||||||
|
["CreateManyNPC", 10, 10],
|
||||||
|
["DeleteEvent"]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
["Date", "==", 181, 1],
|
||||||
|
["RaiseNPCNation"],
|
||||||
|
["DeleteEvent"]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
}
|
||||||
@@ -9,26 +9,26 @@
|
|||||||
"const": {
|
"const": {
|
||||||
"joinRuinedNPCProp":0,
|
"joinRuinedNPCProp":0,
|
||||||
"availableSpecialWar":[
|
"availableSpecialWar":[
|
||||||
"che_귀병", "che_신산", "che_환술", "che_집중", "che_신중", "che_반계",
|
"che_귀병", "che_신산", "che_환술", "che_집중", "che_신중", "che_반계",
|
||||||
"che_보병", "che_궁병", "che_기병", "che_공성",
|
"che_보병", "che_궁병", "che_기병", "che_공성",
|
||||||
"che_돌격", "che_무쌍", "che_위압",
|
"che_돌격", "che_무쌍", "che_위압",
|
||||||
"che_저격", "che_필살", "che_징병", "che_의술", "che_격노", "che_척사"
|
"che_저격", "che_필살", "che_징병", "che_의술", "che_격노", "che_척사"
|
||||||
],
|
],
|
||||||
"allItems":{
|
"allItems":{
|
||||||
"horse":{
|
"horse":{
|
||||||
"che_명마_01_노기":0, "che_명마_02_조랑":0, "che_명마_03_노새":0,
|
"che_명마_01_노기":0, "che_명마_02_조랑":0, "che_명마_03_노새":0,
|
||||||
"che_명마_04_나귀":0, "che_명마_05_갈색마":0, "che_명마_06_흑색마":0,
|
"che_명마_04_나귀":0, "che_명마_05_갈색마":0, "che_명마_06_흑색마":0,
|
||||||
|
|
||||||
"che_명마_07_백마":2, "che_명마_07_기주마":2,
|
"che_명마_07_백마":2, "che_명마_07_기주마":2,
|
||||||
"che_명마_08_양주마":2, "che_명마_09_과하마":2,
|
"che_명마_08_양주마":2, "che_명마_09_과하마":2,
|
||||||
"che_명마_10_대완마":2, "che_명마_11_서량마":2,
|
"che_명마_10_대완마":2, "che_명마_11_서량마":2,
|
||||||
"che_명마_12_사륜거":2, "che_명마_13_절영":1, "che_명마_13_적로":1,
|
"che_명마_12_사륜거":2, "che_명마_13_절영":1, "che_명마_13_적로":1,
|
||||||
"che_명마_14_적란마":1, "che_명마_14_조황비전":1, "che_명마_15_한혈마":1, "che_명마_15_적토마":1
|
"che_명마_14_적란마":1, "che_명마_14_조황비전":1, "che_명마_15_한혈마":1, "che_명마_15_적토마":1
|
||||||
},
|
},
|
||||||
"weapon":{
|
"weapon":{
|
||||||
"che_무기_01_단도":0, "che_무기_02_단궁":0, "che_무기_03_단극":0,
|
"che_무기_01_단도":0, "che_무기_02_단궁":0, "che_무기_03_단극":0,
|
||||||
"che_무기_04_목검":0, "che_무기_05_죽창":0, "che_무기_06_소부":0,
|
"che_무기_04_목검":0, "che_무기_05_죽창":0, "che_무기_06_소부":0,
|
||||||
|
|
||||||
"che_무기_07_동추":1, "che_무기_07_철편":1, "che_무기_07_철쇄":1, "che_무기_07_맥궁":1,
|
"che_무기_07_동추":1, "che_무기_07_철편":1, "che_무기_07_철쇄":1, "che_무기_07_맥궁":1,
|
||||||
"che_무기_08_유성추":1, "che_무기_08_철질여골":1, "che_무기_09_쌍철극":1, "che_무기_09_동호비궁":1,
|
"che_무기_08_유성추":1, "che_무기_08_철질여골":1, "che_무기_09_쌍철극":1, "che_무기_09_동호비궁":1,
|
||||||
"che_무기_10_삼첨도":1, "che_무기_10_대부":1, "che_무기_11_고정도":1, "che_무기_11_이광궁":1,
|
"che_무기_10_삼첨도":1, "che_무기_10_대부":1, "che_무기_11_고정도":1, "che_무기_11_이광궁":1,
|
||||||
@@ -37,18 +37,18 @@
|
|||||||
},
|
},
|
||||||
"book":{
|
"book":{
|
||||||
"che_서적_01_효경전":0, "che_서적_02_회남자":0, "che_서적_03_변도론":0,
|
"che_서적_01_효경전":0, "che_서적_02_회남자":0, "che_서적_03_변도론":0,
|
||||||
"che_서적_04_건상역주":0, "che_서적_05_여씨춘추":0, "che_서적_06_사민월령":0,
|
"che_서적_04_건상역주":0, "che_서적_05_여씨춘추":0, "che_서적_06_사민월령":0,
|
||||||
|
|
||||||
"che_서적_07_위료자":1, "che_서적_07_사마법":1, "che_서적_07_한서":1, "che_서적_07_논어":1,
|
"che_서적_07_위료자":1, "che_서적_07_사마법":1, "che_서적_07_한서":1, "che_서적_07_논어":1,
|
||||||
"che_서적_08_전론":1, "che_서적_08_사기":1, "che_서적_09_장자":1, "che_서적_09_역경":1,
|
"che_서적_08_전론":1, "che_서적_08_사기":1, "che_서적_09_장자":1, "che_서적_09_역경":1,
|
||||||
"che_서적_10_시경":1, "che_서적_10_구국론":1, "che_서적_11_상군서":1, "che_서적_11_춘추전":1,
|
"che_서적_10_시경":1, "che_서적_10_구국론":1, "che_서적_11_상군서":1, "che_서적_11_춘추전":1,
|
||||||
"che_서적_12_산해경":1, "che_서적_12_맹덕신서":1, "che_서적_13_관자":1, "che_서적_13_병법24편":1,
|
"che_서적_12_산해경":1, "che_서적_12_맹덕신서":1, "che_서적_13_관자":1, "che_서적_13_병법24편":1,
|
||||||
"che_서적_14_한비자":1, "che_서적_14_오자병법":1, "che_서적_15_노자":1, "che_서적_15_손자병법":1
|
"che_서적_14_한비자":1, "che_서적_14_오자병법":1, "che_서적_15_노자":1, "che_서적_15_손자병법":1
|
||||||
},
|
},
|
||||||
"item":{
|
"item":{
|
||||||
"che_치료_환약":0, "che_저격_수극":0, "che_사기_탁주":0,
|
"che_치료_환약":0, "che_저격_수극":0, "che_사기_탁주":0,
|
||||||
"che_훈련_청주":0, "che_계략_이추":0, "che_계략_향낭":0,
|
"che_훈련_청주":0, "che_계략_이추":0, "che_계략_향낭":0,
|
||||||
|
|
||||||
"event_전투특기_격노":0, "event_전투특기_공성":0, "event_전투특기_궁병":0,
|
"event_전투특기_격노":0, "event_전투특기_공성":0, "event_전투특기_궁병":0,
|
||||||
"event_전투특기_귀병":0, "event_전투특기_기병":0, "event_전투특기_돌격":0, "event_전투특기_무쌍":0,
|
"event_전투특기_귀병":0, "event_전투특기_기병":0, "event_전투특기_돌격":0, "event_전투특기_무쌍":0,
|
||||||
"event_전투특기_반계":0, "event_전투특기_보병":0, "event_전투특기_신산":0, "event_전투특기_신중":0,
|
"event_전투특기_반계":0, "event_전투특기_보병":0, "event_전투특기_신산":0, "event_전투특기_신중":0,
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
"events":[
|
"events":[
|
||||||
[
|
[
|
||||||
["Date", "==", null, 12],
|
["Date", "==", null, 12],
|
||||||
["CreateManyNPC", 30],
|
["CreateManyNPC", 10, 10],
|
||||||
["DeleteEvent"]
|
["DeleteEvent"]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"events": [
|
"events": [
|
||||||
[
|
[
|
||||||
["Date", "==", null, 12],
|
["Date", "==", null, 12],
|
||||||
["CreateManyNPC", 100],
|
["CreateManyNPC", 100, 0],
|
||||||
["DeleteEvent"]
|
["DeleteEvent"]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<div class="buttonPlate bg1">
|
<div class="buttonPlate bg1">
|
||||||
<div>
|
<div>
|
||||||
<a href="a_status.php" target="_blank"><button type="button" class="toolbarButton">세력도</button></a>
|
<a href="a_status.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">세력도</button></a>
|
||||||
<a href="a_kingdomList.php" target="_blank"><button type="button" class="toolbarButton">세력일람</button></a>
|
<a href="a_kingdomList.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">세력일람</button></a>
|
||||||
<a href="a_genList.php" target="_blank"><button type="button" class="toolbarButton">장수일람</button></a>
|
<a href="a_genList.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">장수일람</button></a>
|
||||||
<a href="a_bestGeneral.php" target="_blank"><button type="button" class="toolbarButton">명장일람</button></a>
|
<a href="a_bestGeneral.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">명장일람</button></a>
|
||||||
<a href="a_history.php" target="_blank"><button type="button" class="toolbarButton">연감</button></a>
|
<a href="a_history.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">연감</button></a>
|
||||||
<a href="a_hallOfFame.php" target="_blank"><button type="button" class="toolbarButton">명예의전당</button></a>
|
<a href="a_hallOfFame.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">명예의전당</button></a>
|
||||||
<a href="a_emperior.php" target="_blank"><button type="button" class="toolbarButton">왕조일람</button></a>
|
<a href="a_emperior.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">왕조일람</button></a>
|
||||||
<a href="a_traffic.php" target="_blank"><button type="button" class="toolbarButton">접속량정보</button></a>
|
<a href="a_traffic.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">접속량정보</button></a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a href="/bbs/board" target="_blank"><button type="button" class="toolbarButton2">삼모게시판</button></a>
|
<a href="/bbs/board" target="_blank"><button type="button" class="toolbarButton2">삼모게시판</button></a>
|
||||||
@@ -17,6 +17,6 @@
|
|||||||
<a href="/bbs/history3" target="_blank"><button type="button" class="toolbarButton">국가 열전</button></a>
|
<a href="/bbs/history3" target="_blank"><button type="button" class="toolbarButton">국가 열전</button></a>
|
||||||
<a href="/bbs/patch" target="_blank"><button type="button" class="toolbarButton">패치 내역</button></a>
|
<a href="/bbs/patch" target="_blank"><button type="button" class="toolbarButton">패치 내역</button></a>
|
||||||
<a href="battle_simulator.php" target="_blank"><button type="button" class="toolbarButton">전투 시뮬레이터</button></a>
|
<a href="battle_simulator.php" target="_blank"><button type="button" class="toolbarButton">전투 시뮬레이터</button></a>
|
||||||
<a href="<?=$site?>" target="_blank"><button type="button" class="toolbarButton"><?=$call?></button></a>
|
<a href="<?=$site?>" target="_blank" class="open-window"><button type="button" class="toolbarButton"><?=$call?></button></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,18 +8,18 @@
|
|||||||
<a href='b_dipcenter.php'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>내 무 부</button></a>
|
<a href='b_dipcenter.php'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>내 무 부</button></a>
|
||||||
<a href='b_chiefcenter.php'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>사 령 부</button></a>
|
<a href='b_chiefcenter.php'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>사 령 부</button></a>
|
||||||
<a href='v_NPCControl.php'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>NPC 정책</button></a>
|
<a href='v_NPCControl.php'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>NPC 정책</button></a>
|
||||||
<a href='b_genList.php' target='_blank'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>암 행 부</button></a>
|
<a href='b_genList.php' target='_blank' class="open-window"><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>암 행 부</button></a>
|
||||||
<a href='b_tournament.php' target='_blank'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>토 너 먼 트</button></a>
|
<a href='b_tournament.php' target='_blank' class="open-window"><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>토 너 먼 트</button></a>
|
||||||
<a href='b_myKingdomInfo.php'><button type="button" class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 정보</button></a>
|
<a href='b_myKingdomInfo.php'><button type="button" class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 정보</button></a>
|
||||||
<a href='b_myCityInfo.php'><button type="button" class='commandButton' <?=($meLevel>=1&&$nationLevel>=1)?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 도시</button></a>
|
<a href='b_myCityInfo.php'><button type="button" class='commandButton' <?=($meLevel>=1&&$nationLevel>=1)?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 도시</button></a>
|
||||||
<a href='b_myGenInfo.php'><button type="button" class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 장수</button></a>
|
<a href='b_myGenInfo.php'><button type="button" class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 장수</button></a>
|
||||||
<a href='b_diplomacy.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>중원 정보</button></a>
|
<a href='b_diplomacy.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>중원 정보</button></a>
|
||||||
<a href='b_currentCity.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>현재 도시</button></a>
|
<a href='b_currentCity.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>현재 도시</button></a>
|
||||||
<a href='b_battleCenter.php' target='_blank'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>감 찰 부</button></a>
|
<a href='b_battleCenter.php' target='_blank' class="open-window"><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>감 찰 부</button></a>
|
||||||
<a href='v_inheritPoint.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>유산 관리</button></a>
|
<a href='v_inheritPoint.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>유산 관리</button></a>
|
||||||
<a href='b_myPage.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>내 정보&설정</button></a>
|
<a href='b_myPage.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>내 정보&설정</button></a>
|
||||||
<a href='b_auction.php' target='_blank'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>거 래 장</button></a>
|
<a href='b_auction.php' target='_blank' class="open-window"><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>거 래 장</button></a>
|
||||||
<a href='b_betting.php' target='_blank'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>베 팅 장</button></a>
|
<a href='b_betting.php' target='_blank' class="open-window"><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>베 팅 장</button></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -154,6 +154,14 @@
|
|||||||
title="포상/몰수/헌납/삼/팜 최소 단위"
|
title="포상/몰수/헌납/삼/팜 최소 단위"
|
||||||
>연산결과가 이 단위보다 적다면 수행하지 않습니다.</NumberInputWithInfo
|
>연산결과가 이 단위보다 적다면 수행하지 않습니다.</NumberInputWithInfo
|
||||||
>
|
>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<NumberInputWithInfo
|
||||||
|
v-model="nationPolicy.maximumResourceActionAmount"
|
||||||
|
:step="100"
|
||||||
|
title="포상/몰수/헌납/삼/팜 최대 단위"
|
||||||
|
>연산결과가 이 단위보다 크다면, 이 값에 맞춥니다.</NumberInputWithInfo
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ export type NationPolicy = {
|
|||||||
reqNPCDevelGold: number,
|
reqNPCDevelGold: number,
|
||||||
reqNPCDevelRice: number,
|
reqNPCDevelRice: number,
|
||||||
minimumResourceActionAmount: number,
|
minimumResourceActionAmount: number,
|
||||||
|
maximumResourceActionAmount: number,
|
||||||
minNPCWarLeadership: number,
|
minNPCWarLeadership: number,
|
||||||
minWarCrew: number,
|
minWarCrew: number,
|
||||||
minNPCRecruitCityPopulation: number,
|
minNPCRecruitCityPopulation: number,
|
||||||
|
|||||||
+127
-10
@@ -1,7 +1,7 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import 'popper.js';
|
import 'popper.js';
|
||||||
import Popper from 'popper.js';
|
import Popper from 'popper.js';
|
||||||
(window as unknown as {Popper:unknown}).Popper = Popper;
|
(window as unknown as { Popper: unknown }).Popper = Popper;
|
||||||
import 'bootstrap';
|
import 'bootstrap';
|
||||||
import { JQValidateForm, NamedRules } from '../util/jqValidateForm';
|
import { JQValidateForm, NamedRules } from '../util/jqValidateForm';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
@@ -11,9 +11,12 @@ import { unwrap_any } from '../util/unwrap_any';
|
|||||||
import { sha512 } from 'js-sha512';
|
import { sha512 } from 'js-sha512';
|
||||||
import { unwrap } from '../util/unwrap';
|
import { unwrap } from '../util/unwrap';
|
||||||
import { InvalidResponse } from '../defs';
|
import { InvalidResponse } from '../defs';
|
||||||
|
import internal from 'stream';
|
||||||
|
import { delay } from '../util/delay';
|
||||||
|
|
||||||
type LoginResponse = {
|
type LoginResponse = {
|
||||||
result: true,
|
result: true,
|
||||||
|
nextToken: [number, string] | undefined,
|
||||||
} | {
|
} | {
|
||||||
result: false,
|
result: false,
|
||||||
reqOTP: boolean,
|
reqOTP: boolean,
|
||||||
@@ -29,6 +32,19 @@ type OTPResponse = {
|
|||||||
reason: string,
|
reason: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type AutoLoginNonceResponse = {
|
||||||
|
result: true,
|
||||||
|
loginNonce: string,
|
||||||
|
} | InvalidResponse;
|
||||||
|
|
||||||
|
type AutoLoginResponse = {
|
||||||
|
result: true,
|
||||||
|
nextToken: [number, string] | undefined,
|
||||||
|
} | {
|
||||||
|
result: false,
|
||||||
|
silent: boolean,
|
||||||
|
reason: string,
|
||||||
|
}
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
getOAuthToken: (mode: string, scope_list: string[]) => void;
|
getOAuthToken: (mode: string, scope_list: string[]) => void;
|
||||||
@@ -41,6 +57,92 @@ declare const kakao_oauth_redirect_uri: string;
|
|||||||
|
|
||||||
let oauthMode: string | null = null;
|
let oauthMode: string | null = null;
|
||||||
|
|
||||||
|
const TOKEN_VERSION = 1;
|
||||||
|
const LOGIN_TOKEN_KEY = 'sammo_login_token';
|
||||||
|
function regNextToken(tokenInfo: [number, string]) {
|
||||||
|
localStorage.setItem(LOGIN_TOKEN_KEY, JSON.stringify([TOKEN_VERSION, tokenInfo, Date.now()]));
|
||||||
|
}
|
||||||
|
|
||||||
|
function getToken(): [number, string] | undefined {
|
||||||
|
const trialToken = localStorage.getItem(LOGIN_TOKEN_KEY);
|
||||||
|
if (!trialToken) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const tokenItems = JSON.parse(trialToken);
|
||||||
|
if (tokenItems[0] != TOKEN_VERSION) {
|
||||||
|
console.log(tokenItems);
|
||||||
|
resetToken();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const [, token,] = tokenItems;
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetToken(){
|
||||||
|
localStorage.removeItem(LOGIN_TOKEN_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function tryAutoLogin() {
|
||||||
|
try {
|
||||||
|
const tokenInfo = getToken();
|
||||||
|
if (!tokenInfo) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [tokenID, token] = tokenInfo;
|
||||||
|
|
||||||
|
const result = await axios.post<AutoLoginNonceResponse>('api.php', {
|
||||||
|
path: ["Login", "ReqNonce"]
|
||||||
|
});
|
||||||
|
|
||||||
|
if(!result){
|
||||||
|
//api 에러.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!result.data.result){
|
||||||
|
resetToken();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const nonce = result.data.loginNonce;
|
||||||
|
|
||||||
|
const hashedToken = sha512(token + nonce);
|
||||||
|
const _loginResult = await axios.post<AutoLoginResponse>('api.php', {
|
||||||
|
path: ["Login", "LoginByToken"],
|
||||||
|
args: {
|
||||||
|
'hashedToken':hashedToken,
|
||||||
|
'token_id':tokenID,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(!_loginResult){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const loginResult = _loginResult.data;
|
||||||
|
if(!loginResult.result){
|
||||||
|
if(!loginResult.silent){
|
||||||
|
alert(loginResult.reason);
|
||||||
|
}
|
||||||
|
console.error(loginResult.reason);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(loginResult.nextToken){
|
||||||
|
regNextToken(loginResult.nextToken);
|
||||||
|
}
|
||||||
|
window.location.href = "./";
|
||||||
|
|
||||||
|
}
|
||||||
|
catch(e){
|
||||||
|
console.error(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function getOAuthToken(mode: string, scope_list?: string[] | string) {
|
function getOAuthToken(mode: string, scope_list?: string[] | string) {
|
||||||
if (mode === undefined) {
|
if (mode === undefined) {
|
||||||
mode = 'login';
|
mode = 'login';
|
||||||
@@ -115,6 +217,9 @@ async function doLoginUsingOAuth() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result.result) {
|
if (result.result) {
|
||||||
|
if (result.nextToken) {
|
||||||
|
regNextToken(result.nextToken);
|
||||||
|
}
|
||||||
window.location.href = "./";
|
window.location.href = "./";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -156,9 +261,16 @@ function postOAuthResult(mode: string) {
|
|||||||
window.postOAuthResult = postOAuthResult;
|
window.postOAuthResult = postOAuthResult;
|
||||||
|
|
||||||
|
|
||||||
$(function ($) {
|
$(async function ($) {
|
||||||
setAxiosXMLHttpRequest();
|
setAxiosXMLHttpRequest();
|
||||||
|
|
||||||
|
//로그인 먼저 해볼 것
|
||||||
|
if(getToken()){
|
||||||
|
void tryAutoLogin();
|
||||||
|
await delay(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
type LoginFormType = {
|
type LoginFormType = {
|
||||||
username: string,
|
username: string,
|
||||||
password: string,
|
password: string,
|
||||||
@@ -194,13 +306,16 @@ $(function ($) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await axios({
|
const response = await axios({
|
||||||
url: 'j_login.php',
|
url: 'api.php',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: convertFormData({
|
data: {
|
||||||
username: values.username,
|
path: ["Login", "LoginByID"],
|
||||||
password: hash_pw,
|
args: {
|
||||||
})
|
username: values.username,
|
||||||
|
password: hash_pw,
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
result = response.data;
|
result = response.data;
|
||||||
}
|
}
|
||||||
@@ -212,6 +327,9 @@ $(function ($) {
|
|||||||
|
|
||||||
|
|
||||||
if (result.result) {
|
if (result.result) {
|
||||||
|
if (result.nextToken) {
|
||||||
|
regNextToken(result.nextToken);
|
||||||
|
}
|
||||||
window.location.href = "./";
|
window.location.href = "./";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -268,12 +386,11 @@ $(function ($) {
|
|||||||
getOAuthToken('change_pw', 'talk_message');
|
getOAuthToken('change_pw', 'talk_message');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#btn_kakao_login').on('click', function(e){
|
$('#btn_kakao_login').on('click', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
getOAuthToken('login', ['account_email','talk_message']);
|
getOAuthToken('login', ['account_email', 'talk_message']);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
//TODO: 모바일에서 크기 비례 지도 다시 띄우기?
|
//TODO: 모바일에서 크기 비례 지도 다시 띄우기?
|
||||||
/*
|
/*
|
||||||
if (document.body.clientWidth < 700) {
|
if (document.body.clientWidth < 700) {
|
||||||
|
|||||||
@@ -272,7 +272,8 @@ type InheritanceType =
|
|||||||
| "lived_month"
|
| "lived_month"
|
||||||
| "max_belong"
|
| "max_belong"
|
||||||
| "max_domestic_critical"
|
| "max_domestic_critical"
|
||||||
| "snipe_combat"
|
| "active_action"
|
||||||
|
// | "snipe_combat"
|
||||||
| "combat"
|
| "combat"
|
||||||
| "sabotage"
|
| "sabotage"
|
||||||
| "unifier"
|
| "unifier"
|
||||||
@@ -320,10 +321,14 @@ const inheritanceViewText: Record<
|
|||||||
title: "최대 연속 내정 성공",
|
title: "최대 연속 내정 성공",
|
||||||
info: "성공한 내정 중 최대 연속값입니다.",
|
info: "성공한 내정 중 최대 연속값입니다.",
|
||||||
},
|
},
|
||||||
snipe_combat: {
|
active_action: {
|
||||||
|
title: "능동 행동 수",
|
||||||
|
info: "장수 동향에 본인의 이름이 직접 나타난 수입니다.<br>일부 사령턴은 제외됩니다."
|
||||||
|
},
|
||||||
|
/* snipe_combat: {
|
||||||
title: "병종 상성 우위 횟수",
|
title: "병종 상성 우위 횟수",
|
||||||
info: "유리한 상성을 가지고 전투했습니다.",
|
info: "유리한 상성을 가지고 전투했습니다.",
|
||||||
},
|
},*/
|
||||||
combat: {
|
combat: {
|
||||||
title: "전투 횟수",
|
title: "전투 횟수",
|
||||||
info: "전투 횟수입니다.",
|
info: "전투 횟수입니다.",
|
||||||
|
|||||||
+31
-7
@@ -13,6 +13,8 @@ import './msg.ts';
|
|||||||
import './map.ts';
|
import './map.ts';
|
||||||
import { exportWindow } from './util/exportWindow';
|
import { exportWindow } from './util/exportWindow';
|
||||||
import {stringifyUrl} from 'query-string';
|
import {stringifyUrl} from 'query-string';
|
||||||
|
import { joinYearMonth } from './util/joinYearMonth';
|
||||||
|
import { parseYearMonth } from './util/parseYearMonth';
|
||||||
exportWindow($, '$');
|
exportWindow($, '$');
|
||||||
|
|
||||||
type TurnArg = {
|
type TurnArg = {
|
||||||
@@ -33,6 +35,7 @@ type ReservedTurnResponse = {
|
|||||||
month: number,
|
month: number,
|
||||||
date: string,
|
date: string,
|
||||||
turn: TurnItem[],
|
turn: TurnItem[],
|
||||||
|
autorun_limit: number|null,
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function ($) {
|
$(function ($) {
|
||||||
@@ -65,10 +68,12 @@ $(function ($) {
|
|||||||
const turnTime = parseTime(data.turnTime);
|
const turnTime = parseTime(data.turnTime);
|
||||||
let nextTurnTime = new Date(turnTime);
|
let nextTurnTime = new Date(turnTime);
|
||||||
|
|
||||||
let year = data.year;
|
let nowYearMonth = joinYearMonth(data.year, data.month);
|
||||||
let month = data.month;
|
const autorunLimitYearMonth = data.autorun_limit ?? nowYearMonth - 1;
|
||||||
|
const [autorunLimitYear, autorunLimitMonth] = parseYearMonth(autorunLimitYearMonth);
|
||||||
|
|
||||||
for (const [turnIdx, turnInfo] of Object.entries(data.turn)) {
|
for (const [turnIdx, turnInfo] of Object.entries(data.turn)) {
|
||||||
|
const [year, month] = parseYearMonth(nowYearMonth);
|
||||||
const $tr = $(`#command_${turnIdx}`);
|
const $tr = $(`#command_${turnIdx}`);
|
||||||
|
|
||||||
$tr.find('.time_pad').text(formatTime(nextTurnTime, 'HH:mm'));
|
$tr.find('.time_pad').text(formatTime(nextTurnTime, 'HH:mm'));
|
||||||
@@ -76,6 +81,16 @@ $(function ($) {
|
|||||||
const $turn_pad = $tr.find('.turn_pad');
|
const $turn_pad = $tr.find('.turn_pad');
|
||||||
const $turn_text = $turn_pad.find('.turn_text');
|
const $turn_text = $turn_pad.find('.turn_text');
|
||||||
$turn_text.text(turnInfo.brief).css('font-size', '13px');
|
$turn_text.text(turnInfo.brief).css('font-size', '13px');
|
||||||
|
if(nowYearMonth <= autorunLimitYearMonth){
|
||||||
|
const brief = turnInfo.brief != '휴식'? turnInfo.brief :'휴식<small>(자율 행동)</small>';
|
||||||
|
const autorunTooltip = `<span class="obj_tooltip" data-toggle="tooltip" data-placement="top"
|
||||||
|
><span style='color:#aaffff;'>${brief}</span
|
||||||
|
><span class="tooltiptext">자율 행동 기간: ${autorunLimitYear}년 ${autorunLimitMonth}월까지</span
|
||||||
|
></span>`;
|
||||||
|
$turn_text.html(autorunTooltip);
|
||||||
|
initTooltip($turn_text);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const oWidth = unwrap($turn_pad.innerWidth());
|
const oWidth = unwrap($turn_pad.innerWidth());
|
||||||
const iWidth = unwrap($turn_text.outerWidth());
|
const iWidth = unwrap($turn_text.outerWidth());
|
||||||
@@ -85,11 +100,7 @@ $(function ($) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nextTurnTime = addMinutes(nextTurnTime, data.turnTerm);
|
nextTurnTime = addMinutes(nextTurnTime, data.turnTerm);
|
||||||
month += 1;
|
nowYearMonth += 1;
|
||||||
if (month >= 13) {
|
|
||||||
year += 1;
|
|
||||||
month -= 12;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|
||||||
@@ -192,6 +203,19 @@ $(function ($) {
|
|||||||
return false;
|
return false;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$('.open-window').on('click', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
let target = $(e.target as HTMLAnchorElement);
|
||||||
|
while(target.attr('href') === undefined){
|
||||||
|
target = target.parent('a');
|
||||||
|
if(target.length == 0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const href = target.attr('href');
|
||||||
|
window.open(href);
|
||||||
|
});
|
||||||
|
|
||||||
setInterval(myclock, 500);
|
setInterval(myclock, 500);
|
||||||
reloadCommandList();
|
reloadCommandList();
|
||||||
activateFlip();
|
activateFlip();
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export function joinYearMonth(year: number, month: number): number {
|
||||||
|
return year * 12 + month - 1;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export function parseYearMonth(yearMonth: number): [number, number] {
|
||||||
|
return [(yearMonth / 12) | 0, yearMonth % 12 + 1];
|
||||||
|
}
|
||||||
@@ -63,8 +63,8 @@ if ($currentNationPolicy['reqHumanWarUrgentRice'] ?? 0) {
|
|||||||
if ($currentNationPolicy['reqHumanWarUrgentGold'] ?? 0) {
|
if ($currentNationPolicy['reqHumanWarUrgentGold'] ?? 0) {
|
||||||
$autoPolicyVariable['reqHumanWarUrgentGold'] = $currentNationPolicy['reqHumanWarUrgentGold'];
|
$autoPolicyVariable['reqHumanWarUrgentGold'] = $currentNationPolicy['reqHumanWarUrgentGold'];
|
||||||
}
|
}
|
||||||
$autoPolicy = new AutorunNationPolicy($general, ($gameStor->autorun_user)['options'], ['values' => $autoPolicyVariable], null, $nation, $gameStor->getAll(true));
|
$autoPolicy = new AutorunNationPolicy($general, ($gameStor->autorun_user)['options']??[], ['values' => $autoPolicyVariable], null, $nation, $gameStor->getAll(true));
|
||||||
$zeroPolicy = new AutorunNationPolicy($general, ($gameStor->autorun_user)['options'], null, null, $nation, $gameStor->getAll(true));
|
$zeroPolicy = new AutorunNationPolicy($general, ($gameStor->autorun_user)['options']??[], null, null, $nation, $gameStor->getAll(true));
|
||||||
|
|
||||||
$lastSetters = [
|
$lastSetters = [
|
||||||
'policy' => [
|
'policy' => [
|
||||||
|
|||||||
-181
@@ -1,181 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace sammo;
|
|
||||||
|
|
||||||
require(__DIR__ . '/vendor/autoload.php');
|
|
||||||
require(__DIR__ . '/oauth_kakao/lib.join.php');
|
|
||||||
|
|
||||||
WebUtil::requireAJAX();
|
|
||||||
|
|
||||||
use \kakao\Kakao_REST_API_Helper as Kakao_REST_API_Helper;
|
|
||||||
|
|
||||||
$RootDB = RootDB::db();
|
|
||||||
$session = Session::getInstance();
|
|
||||||
if ($session->isLoggedIn()) {
|
|
||||||
$session->logout();
|
|
||||||
}
|
|
||||||
|
|
||||||
$username = mb_strtolower(Util::getPost('username'), 'utf-8');
|
|
||||||
$password = Util::getPost('password');
|
|
||||||
|
|
||||||
if (!$username || !$password) {
|
|
||||||
Json::die([
|
|
||||||
'result' => false,
|
|
||||||
'reqOTP' => false,
|
|
||||||
'reason' => '올바르지 않은 입력입니다.'
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
function kakaoOAuthCheck(array $userInfo): ?array
|
|
||||||
{
|
|
||||||
|
|
||||||
if (!\kakao\KakaoKey::REST_KEY) {
|
|
||||||
return [false, '카카오 API 앱이 등록되지 않았습니다. 관리자에게 문의해 주세요.'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$oauthID = $userInfo['oauth_id'];
|
|
||||||
$oauthInfo = Json::decode($userInfo['oauth_info']) ?? [];
|
|
||||||
if (!$oauthInfo) {
|
|
||||||
return [false, 'OAuth 정보가 보관되어 있지 않습니다. 카카오 로그인을 수행해 주세요.'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$accessToken = $oauthInfo['accessToken'] ?? null;
|
|
||||||
$refreshToken = $oauthInfo['refreshToken'] ?? null;
|
|
||||||
$accessTokenValidUntil = $oauthInfo['accessTokenValidUntil'] ?? null;
|
|
||||||
$refreshTokenValidUntil = $oauthInfo['refreshTokenValidUntil'] ?? null;
|
|
||||||
$OTPValue = $oauthInfo['OTPValue'] ?? null;
|
|
||||||
$OTPTrialUntil = $oauthInfo['OTPTrialUntil'] ?? null;
|
|
||||||
$tokenValidUntil = $userInfo['token_valid_until'];
|
|
||||||
|
|
||||||
if (!$accessToken || !$refreshToken || !$accessTokenValidUntil || !$refreshTokenValidUntil) {
|
|
||||||
return [false, 'OAuth 정보가 보관되어 있지 않습니다. 카카오 로그인을 수행해 주세요.'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$now = TimeUtil::now();
|
|
||||||
|
|
||||||
if ($now > $refreshTokenValidUntil) {
|
|
||||||
return [false, '로그인 토큰이 만료되었습니다. 카카오 로그인을 수행해 주세요.'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($now > $accessTokenValidUntil) {
|
|
||||||
$apiHelper = new Kakao_REST_API_Helper($accessToken);
|
|
||||||
$refreshResult = $apiHelper->refresh_access_token($refreshToken);
|
|
||||||
if (!$refreshResult) {
|
|
||||||
return [false, '로그인 토큰 자동 갱신을 실패했습니다. 카카오 로그인을 수행해 주세요.'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$accessToken = $refreshResult['access_token'] ?? null;
|
|
||||||
|
|
||||||
if (!$accessToken) {
|
|
||||||
trigger_error("refreshToken 에러 " . Json::encode($refreshResult) . "," . $refreshToken . "," . substr(\kakao\KakaoKey::REST_KEY, 0, 6), E_USER_NOTICE);
|
|
||||||
return [false, '로그인 토큰 자동 갱신을 실패했습니다. 카카오 로그인을 수행해 주세요.'];
|
|
||||||
}
|
|
||||||
$accessTokenValidUntil = TimeUtil::nowAddSeconds($refreshResult['expires_in']);
|
|
||||||
|
|
||||||
$oauthInfo['accessToken'] = $accessToken;
|
|
||||||
$oauthInfo['accessTokenValidUntil'] = $accessTokenValidUntil;
|
|
||||||
|
|
||||||
$refreshToken = $refreshResult['refresh_token'] ?? null;
|
|
||||||
if ($refreshToken) {
|
|
||||||
$refreshTokenValidUntil = TimeUtil::nowAddSeconds($refreshResult['refresh_token_expires_in']);
|
|
||||||
|
|
||||||
$oauthInfo['refreshToken'] = $refreshToken;
|
|
||||||
$oauthInfo['refresh_token_expires_in'] = $refreshTokenValidUntil;
|
|
||||||
}
|
|
||||||
|
|
||||||
RootDB::db()->update('member', [
|
|
||||||
'oauth_info' => Json::encode($oauthInfo)
|
|
||||||
], 'no=%i', $userInfo['no']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($tokenValidUntil && $now <= $tokenValidUntil) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//인증 시스템 가동
|
|
||||||
$session = Session::getInstance();
|
|
||||||
$session->access_token = $accessToken;
|
|
||||||
$session->expires = $accessTokenValidUntil;
|
|
||||||
$session->refresh_token = $refreshToken;
|
|
||||||
$session->refresh_token_expires = $refreshTokenValidUntil;
|
|
||||||
|
|
||||||
if (!createOTPbyUserNO($userInfo['no'])) {
|
|
||||||
return [false, '인증 코드를 보내는데 실패했습니다.'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return [true, '인증 코드를 입력해주세요'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$userInfo = $RootDB->queryFirstRow(
|
|
||||||
'SELECT `no`, `id`, `name`, `grade`, `delete_after`, `acl`, oauth_id, oauth_type, oauth_info, token_valid_until ' .
|
|
||||||
'from member where id=%s_username AND ' .
|
|
||||||
'pw=sha2(concat(salt, %s_password, salt), 512)',
|
|
||||||
[
|
|
||||||
'username' => $username,
|
|
||||||
'password' => $password
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!$userInfo) {
|
|
||||||
Json::die([
|
|
||||||
'result' => false,
|
|
||||||
'reqOTP' => false,
|
|
||||||
'reason' => '아이디나 비밀번호가 올바르지 않습니다.'
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$canLogin = $RootDB->queryFirstField('SELECT `LOGIN` FROM `system` WHERE `NO` = 1');
|
|
||||||
if ($canLogin != 'Y' && $userInfo['grade'] < 5) {
|
|
||||||
Json::die([
|
|
||||||
'result' => false,
|
|
||||||
'reason' => '현재는 로그인이 금지되어있습니다!'
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$nowDate = TimeUtil::now();
|
|
||||||
if ($userInfo['delete_after']) {
|
|
||||||
if ($userInfo['delete_after'] < $nowDate) {
|
|
||||||
$RootDB->delete('member', 'no=%i', $userInfo['no']);
|
|
||||||
Json::die([
|
|
||||||
'result' => false,
|
|
||||||
'reqOTP' => false,
|
|
||||||
'reason' => "기간 만기로 삭제되었습니다. 재 가입을 시도해주세요."
|
|
||||||
]);
|
|
||||||
} else {
|
|
||||||
Json::die([
|
|
||||||
'result' => false,
|
|
||||||
'reqOTP' => false,
|
|
||||||
'reason' => "삭제 요청된 계정입니다.[{$userInfo['delete_after']}]"
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$RootDB->insert('member_log', [
|
|
||||||
'member_no' => $userInfo['no'],
|
|
||||||
'action_type' => 'login',
|
|
||||||
'action' => Json::encode([
|
|
||||||
'ip' => Util::get_client_ip(true),
|
|
||||||
'type' => 'plain'
|
|
||||||
])
|
|
||||||
]);
|
|
||||||
|
|
||||||
if ($userInfo['oauth_type'] == 'KAKAO') {
|
|
||||||
$oauthFailResult = kakaoOAuthCheck($userInfo);
|
|
||||||
if ($oauthFailResult !== null) {
|
|
||||||
$session->login($userInfo['no'], $userInfo['id'], $userInfo['grade'], true, $userInfo['token_valid_until'], Json::decode($userInfo['acl'] ?? '{}'));
|
|
||||||
[$oauthReqOTP, $oauthFailReason] = $oauthFailResult;
|
|
||||||
Json::die([
|
|
||||||
'result' => false,
|
|
||||||
'reqOTP' => $oauthReqOTP,
|
|
||||||
'reason' => $oauthFailReason
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$session->login($userInfo['no'], $userInfo['id'], $userInfo['grade'], false, $userInfo['token_valid_until'], Json::decode($userInfo['acl'] ?? '{}'));
|
|
||||||
Json::die([
|
|
||||||
'result' => true,
|
|
||||||
'reqOTP' => false,
|
|
||||||
'reason' => '로그인 되었습니다.'
|
|
||||||
]);
|
|
||||||
+2
-2
@@ -267,7 +267,7 @@ if ($server == $baseServerName) {
|
|||||||
|
|
||||||
|
|
||||||
$storage->$server = [$target, $version];
|
$storage->$server = [$target, $version];
|
||||||
opcache_reset();
|
//opcache_reset();
|
||||||
|
|
||||||
Json::die([
|
Json::die([
|
||||||
'server' => $server,
|
'server' => $server,
|
||||||
@@ -321,7 +321,7 @@ genJS($server);
|
|||||||
|
|
||||||
$storage->$server = [$target, $version];
|
$storage->$server = [$target, $version];
|
||||||
//ServConfig::getServerList()[$server]->closeServer();
|
//ServConfig::getServerList()[$server]->closeServer();
|
||||||
opcache_reset();
|
//opcache_reset();
|
||||||
|
|
||||||
Json::die([
|
Json::die([
|
||||||
'server' => $server,
|
'server' => $server,
|
||||||
|
|||||||
+123
-82
@@ -1,25 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
require(__DIR__.'/../vendor/autoload.php');
|
require(__DIR__ . '/../vendor/autoload.php');
|
||||||
require('lib.join.php');
|
require('lib.join.php');
|
||||||
|
|
||||||
|
|
||||||
|
//TODO: KakaoOauth를 API로 정식으로 이동
|
||||||
|
|
||||||
WebUtil::requireAJAX();
|
WebUtil::requireAJAX();
|
||||||
|
|
||||||
use \kakao\Kakao_REST_API_Helper as Kakao_REST_API_Helper;
|
use \kakao\Kakao_REST_API_Helper as Kakao_REST_API_Helper;
|
||||||
|
|
||||||
$RootDB = RootDB::db();
|
$RootDB = RootDB::db();
|
||||||
$session = Session::getInstance();
|
$session = Session::getInstance();
|
||||||
if($session->isLoggedIn()){
|
if ($session->isLoggedIn()) {
|
||||||
$session->logout();
|
$session->logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
$canLogin = RootDB::db()->queryFirstField('SELECT `LOGIN` FROM `system` WHERE `NO` = 1');
|
$canLogin = RootDB::db()->queryFirstField('SELECT `LOGIN` FROM `system` WHERE `NO` = 1');
|
||||||
if($canLogin != 'Y'){
|
if ($canLogin != 'Y') {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reqOTP'=>false,
|
'reqOTP' => false,
|
||||||
'reason'=>'현재는 로그인이 금지되어있습니다!',
|
'reason' => '현재는 로그인이 금지되어있습니다!',
|
||||||
'noRetry'=>true
|
'noRetry' => true
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,173 +37,209 @@ $refresh_token_expires = $session->refresh_token_expires;
|
|||||||
$email = $session->kaccount_email;
|
$email = $session->kaccount_email;
|
||||||
|
|
||||||
|
|
||||||
if(!$access_token || !$expires){
|
if (!$access_token || !$expires) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reqOTP'=>false,
|
'reqOTP' => false,
|
||||||
'reason'=>'카카오로그인이 이루어지지 않았습니다.'
|
'reason' => '카카오로그인이 이루어지지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: join과 login의 동작이 비슷하다. helper class로 묶자.
|
//TODO: join과 login의 동작이 비슷하다. helper class로 묶자.
|
||||||
$restAPI = new Kakao_REST_API_Helper($access_token);
|
$restAPI = new Kakao_REST_API_Helper($access_token);
|
||||||
|
|
||||||
if($expires < $now && (!$refresh_token || ($refresh_token_expires < $now))){
|
if ($expires < $now && (!$refresh_token || ($refresh_token_expires < $now))) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reqOTP'=>false,
|
'reqOTP' => false,
|
||||||
'reason'=>'로그인 토큰 만료.'.$refresh_token_expires.' 다시 카카오로그인을 수행해주세요.'
|
'reason' => '로그인 토큰 만료.' . $refresh_token_expires . ' 다시 카카오로그인을 수행해주세요.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($expires < $now){
|
if ($expires < $now) {
|
||||||
$session->kaccount_email = null;
|
$session->kaccount_email = null;
|
||||||
$email = null;
|
$email = null;
|
||||||
|
|
||||||
$result = $restAPI->refresh_access_token($refresh_token);
|
$result = $restAPI->refresh_access_token($refresh_token);
|
||||||
if(!isset($refresh_token)){
|
if (!isset($refresh_token)) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reqOTP'=>false,
|
'reqOTP' => false,
|
||||||
'reason'=>'카카오 로그인 과정 중 추가 갱신 절차를 실패했습니다'
|
'reason' => '카카오 로그인 과정 중 추가 갱신 절차를 실패했습니다'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$access_token = $result['access_token'];
|
$access_token = $result['access_token'];
|
||||||
$expires = TimeUtil::nowAddSeconds($result['expires_in']);
|
$expires = TimeUtil::nowAddSeconds($result['expires_in']);
|
||||||
if(isset($result['refresh_token'])){
|
if (isset($result['refresh_token'])) {
|
||||||
$refresh_token = Util::array_get($result['refresh_token']);
|
$refresh_token = Util::array_get($result['refresh_token']);
|
||||||
$refresh_token_expires = TimeUtil::nowAddSeconds($result['refresh_token_expires_in']);
|
$refresh_token_expires = TimeUtil::nowAddSeconds($result['refresh_token_expires_in']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!$email){
|
if (!$email) {
|
||||||
$me = $restAPI->meWithEmail();
|
$me = $restAPI->meWithEmail();
|
||||||
$me['code'] = Util::array_get($me['code'], 0);
|
$me['code'] = Util::array_get($me['code'], 0);
|
||||||
if ($me['code']< 0) {
|
if ($me['code'] < 0) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reqOTP'=>false,
|
'reqOTP' => false,
|
||||||
'reason'=>'카카오로그인이 정상적으로 수행되지 않았습니다.'
|
'reason' => '카카오로그인이 정상적으로 수행되지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$kakao_account = $me['kakao_account']??null;
|
$kakao_account = $me['kakao_account'] ?? null;
|
||||||
if (!$kakao_account) {
|
if (!$kakao_account) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reqOTP'=>false,
|
'reqOTP' => false,
|
||||||
'reason'=>'카카오 로그인 정보를 제대로 받아오지 못했습니다.'
|
'reason' => '카카오 로그인 정보를 제대로 받아오지 못했습니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!($kakao_account['has_email']??false)){
|
if (!($kakao_account['has_email'] ?? false)) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reqOTP'=>false,
|
'reqOTP' => false,
|
||||||
'reason'=>'이메일 정보 공유를 허가해 주셔야 합니다.',
|
'reason' => '이메일 정보 공유를 허가해 주셔야 합니다.',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$validEmail = $kakao_account['is_email_valid']??false;
|
$validEmail = $kakao_account['is_email_valid'] ?? false;
|
||||||
$verifiedEmail = $kakao_account['is_email_verified']??false;
|
$verifiedEmail = $kakao_account['is_email_verified'] ?? false;
|
||||||
|
|
||||||
if(!$validEmail || !$verifiedEmail){
|
if (!$validEmail || !$verifiedEmail) {
|
||||||
$restAPI->unlink();
|
$restAPI->unlink();
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reqOTP'=>false,
|
'reqOTP' => false,
|
||||||
'reason'=>'카카오 계정 이메일이 아직 인증되지 않았습니다',
|
'reason' => '카카오 계정 이메일이 아직 인증되지 않았습니다',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$email = $kakao_account['email'];
|
$email = $kakao_account['email'];
|
||||||
$session->kaccount_email = $email;
|
$session->kaccount_email = $email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$userInfo = $RootDB->queryFirstRow(
|
$userInfo = $RootDB->queryFirstRow(
|
||||||
'SELECT `no`, `id`, `name`, `grade`, `delete_after`, `acl`, oauth_info, token_valid_until from member where email=%s',$email);
|
'SELECT `no`, `id`, `name`, `grade`, `delete_after`, `acl`, oauth_info, token_valid_until from member where email=%s',
|
||||||
|
$email
|
||||||
|
);
|
||||||
|
|
||||||
if(!$userInfo){
|
if (!$userInfo) {
|
||||||
$restAPI->unlink();
|
$restAPI->unlink();
|
||||||
$session->access_token = null;
|
$session->access_token = null;
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reqOTP'=>false,
|
'reqOTP' => false,
|
||||||
'reason'=>'카카오로그인에 해당하는 계정이 없습니다. 재 가입을 시도해주세요.',
|
'reason' => '카카오로그인에 해당하는 계정이 없습니다. 재 가입을 시도해주세요.',
|
||||||
'aux'=>$session->tmpx,
|
'aux' => $session->tmpx,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($userInfo['delete_after']){
|
if ($userInfo['delete_after']) {
|
||||||
if($userInfo['delete_after'] < $now){
|
if ($userInfo['delete_after'] < $now) {
|
||||||
$restAPI->unlink();
|
$restAPI->unlink();
|
||||||
$session->access_token = null;
|
$session->access_token = null;
|
||||||
$RootDB->delete('member', 'no=%i', $userInfo['no']);
|
$RootDB->delete('member', 'no=%i', $userInfo['no']);
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reqOTP'=>false,
|
'reqOTP' => false,
|
||||||
'reason'=>"기간 만기로 삭제되었습니다. 재 가입을 시도해주세요.",
|
'reason' => "기간 만기로 삭제되었습니다. 재 가입을 시도해주세요.",
|
||||||
]);
|
]);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$restAPI->unlink();
|
$restAPI->unlink();
|
||||||
$session->access_token = null;
|
$session->access_token = null;
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reqOTP'=>false,
|
'reqOTP' => false,
|
||||||
'reason'=>"삭제 요청된 계정입니다.[{$userInfo['delete_after']}]"
|
'reason' => "삭제 요청된 계정입니다.[{$userInfo['delete_after']}]"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$oauthInfo = Json::decode($userInfo['oauth_info'])??[];
|
$oauthInfo = Json::decode($userInfo['oauth_info']) ?? [];
|
||||||
$oauthInfo['accessToken'] = $access_token;
|
$oauthInfo['accessToken'] = $access_token;
|
||||||
$oauthInfo['accessTokenValidUntil'] = $expires;
|
$oauthInfo['accessTokenValidUntil'] = $expires;
|
||||||
if($refresh_token){
|
if ($refresh_token) {
|
||||||
$oauthInfo['refreshToken'] = $refresh_token;
|
$oauthInfo['refreshToken'] = $refresh_token;
|
||||||
$oauthInfo['refreshTokenValidUntil'] = $refresh_token_expires;
|
$oauthInfo['refreshTokenValidUntil'] = $refresh_token_expires;
|
||||||
}
|
}
|
||||||
|
|
||||||
RootDB::db()->update('member', [
|
RootDB::db()->update('member', [
|
||||||
'oauth_info'=>Json::encode($oauthInfo)
|
'oauth_info' => Json::encode($oauthInfo)
|
||||||
], 'no=%i', $userInfo['no']);
|
], 'no=%i', $userInfo['no']);
|
||||||
|
|
||||||
|
|
||||||
$tokenValidUntil = $userInfo['token_valid_until'];
|
$tokenValidUntil = $userInfo['token_valid_until'];
|
||||||
|
|
||||||
if(!$tokenValidUntil || $tokenValidUntil < $now){
|
if (!$tokenValidUntil || $tokenValidUntil < $now) {
|
||||||
if(!createOTPbyUserNO($userInfo['no'])){
|
if (!createOTPbyUserNO($userInfo['no'])) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reqOTP'=>false,
|
'reqOTP' => false,
|
||||||
'reason'=>'인증 코드를 보내는데 실패했습니다.'
|
'reason' => '인증 코드를 보내는데 실패했습니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$session->login($userInfo['no'], $userInfo['id'], $userInfo['grade'], true, $userInfo['token_valid_until'], Json::decode($userInfo['acl']??'{}'));
|
$session->login($userInfo['no'], $userInfo['id'], $userInfo['grade'], true, $userInfo['token_valid_until'], null, Json::decode($userInfo['acl'] ?? '{}'));
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reqOTP'=>true,
|
'reqOTP' => true,
|
||||||
'reason'=>'인증 코드를 입력해주세요.'
|
'reason' => '인증 코드를 입력해주세요.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$RootDB->insert('member_log',[
|
$RootDB->insert('member_log', [
|
||||||
'member_no'=>$userInfo['no'],
|
'member_no' => $userInfo['no'],
|
||||||
'action_type'=>'login',
|
'action_type' => 'login',
|
||||||
'action'=>Json::encode([
|
'action' => Json::encode([
|
||||||
'ip'=>Util::get_client_ip(true),
|
'ip' => Util::get_client_ip(true),
|
||||||
'type'=>'kakao'
|
'type' => 'kakao'
|
||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$session->login($userInfo['no'], $userInfo['id'], $userInfo['grade'], false, $userInfo['token_valid_until'], Json::decode($userInfo['acl']??'{}'));
|
|
||||||
|
//TODO: 이동하면서 이부분 정리
|
||||||
|
$nowDate = TimeUtil::now();
|
||||||
|
$RootDB->delete(
|
||||||
|
'login_token',
|
||||||
|
'user_id = %i AND expire_date < %s',
|
||||||
|
$userID,
|
||||||
|
$nowDate
|
||||||
|
);
|
||||||
|
$RootDB->query(
|
||||||
|
'DELETE invalid FROM login_token AS invalid
|
||||||
|
JOIN
|
||||||
|
( SELECT id
|
||||||
|
FROM login_token
|
||||||
|
WHERE user_id = %i
|
||||||
|
ORDER BY id DESC
|
||||||
|
LIMIT 8,1
|
||||||
|
) AS valid
|
||||||
|
ON invalid.id < valid.id WHERE user_id = %i',
|
||||||
|
$userID,
|
||||||
|
$userID
|
||||||
|
);
|
||||||
|
$token = Util::randomStr(20);
|
||||||
|
$RootDB->insert('login_token', [
|
||||||
|
'user_id' => $userInfo['no'],
|
||||||
|
'base_token' => $token,
|
||||||
|
'reg_ip' => Util::get_client_ip(true),
|
||||||
|
'reg_date' => $nowDate,
|
||||||
|
'expire_date' => TimeUtil::nowAddDays(7)
|
||||||
|
]);
|
||||||
|
$tokenID = $RootDB->insertId();
|
||||||
|
|
||||||
|
$session->login($userInfo['no'], $userInfo['id'], $userInfo['grade'], false, $userInfo['token_valid_until'], $tokenID, Json::decode($userInfo['acl'] ?? '{}'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>true,
|
'result' => true,
|
||||||
'reqOTP'=>false,
|
'reqOTP' => false,
|
||||||
'reason'=>'로그인 되었습니다.'
|
'nextToken' => [$tokenID, $token],
|
||||||
]);
|
'reason' => '로그인 되었습니다.'
|
||||||
|
]);
|
||||||
|
|||||||
@@ -0,0 +1,162 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\Login;
|
||||||
|
|
||||||
|
use DateTime;
|
||||||
|
use sammo\Session;
|
||||||
|
use DateTimeInterface;
|
||||||
|
use sammo\BaseAPI;
|
||||||
|
use sammo\Json;
|
||||||
|
use sammo\KakaoUtil;
|
||||||
|
use sammo\RootDB;
|
||||||
|
use sammo\TimeUtil;
|
||||||
|
use sammo\Util;
|
||||||
|
use sammo\Validator;
|
||||||
|
|
||||||
|
class LoginByID extends \sammo\BaseAPI
|
||||||
|
{
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
$v = new Validator($this->args);
|
||||||
|
$v
|
||||||
|
->rule('required', [
|
||||||
|
'username',
|
||||||
|
'password'
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (!$v->validate()) {
|
||||||
|
return $v->errorStr();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredSessionMode(): int
|
||||||
|
{
|
||||||
|
return BaseAPI::NO_SESSION;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function scrubToken(int $userID)
|
||||||
|
{
|
||||||
|
$RootDB = RootDB::db();
|
||||||
|
$nowDate = TimeUtil::now();
|
||||||
|
$RootDB->delete(
|
||||||
|
'login_token',
|
||||||
|
'user_id = %i AND expire_date < %s',
|
||||||
|
$userID,
|
||||||
|
$nowDate
|
||||||
|
);
|
||||||
|
$RootDB->query(
|
||||||
|
'DELETE invalid FROM login_token AS invalid
|
||||||
|
JOIN
|
||||||
|
( SELECT id
|
||||||
|
FROM login_token
|
||||||
|
WHERE user_id = %i
|
||||||
|
ORDER BY id DESC
|
||||||
|
LIMIT 8,1
|
||||||
|
) AS valid
|
||||||
|
ON invalid.id < valid.id WHERE user_id = %i',
|
||||||
|
$userID,
|
||||||
|
$userID
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addToken(int $userID)
|
||||||
|
{
|
||||||
|
$RootDB = RootDB::db();
|
||||||
|
$nowDate = TimeUtil::now();
|
||||||
|
$token = Util::randomStr(20);
|
||||||
|
$RootDB->insert('login_token', [
|
||||||
|
'user_id' => $userID,
|
||||||
|
'base_token' => $token,
|
||||||
|
'reg_ip' => Util::get_client_ip(true),
|
||||||
|
'reg_date' => $nowDate,
|
||||||
|
'expire_date' => TimeUtil::nowAddDays(7)
|
||||||
|
]);
|
||||||
|
$tokenID = $RootDB->insertId();
|
||||||
|
return [$tokenID, $token];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||||
|
{
|
||||||
|
$RootDB = RootDB::db();
|
||||||
|
if ($session->isLoggedIn()) {
|
||||||
|
$session->logout();
|
||||||
|
}
|
||||||
|
|
||||||
|
$username = $this->args['username'];
|
||||||
|
$password = $this->args['password'];
|
||||||
|
|
||||||
|
$userInfo = $RootDB->queryFirstRow(
|
||||||
|
'SELECT `no`, `id`, `name`, `grade`, `delete_after`, `acl`, oauth_id, oauth_type, oauth_info, token_valid_until ' .
|
||||||
|
'from member where id=%s_username AND ' .
|
||||||
|
'pw=sha2(concat(salt, %s_password, salt), 512)',
|
||||||
|
[
|
||||||
|
'username' => $username,
|
||||||
|
'password' => $password
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!$userInfo) {
|
||||||
|
return '아이디나 비밀번호가 올바르지 않습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$canLogin = $RootDB->queryFirstField('SELECT `LOGIN` FROM `system` WHERE `NO` = 1');
|
||||||
|
if ($canLogin != 'Y' && $userInfo['grade'] < 5) {
|
||||||
|
return '현재는 로그인이 금지되어있습니다!';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$nowDate = TimeUtil::now();
|
||||||
|
if ($userInfo['delete_after']) {
|
||||||
|
if ($userInfo['delete_after'] < $nowDate) {
|
||||||
|
$RootDB->delete('member', 'no=%i', $userInfo['no']);
|
||||||
|
return [
|
||||||
|
'result' => false,
|
||||||
|
'reqOTP' => false,
|
||||||
|
'reason' => "기간 만기로 삭제되었습니다. 재 가입을 시도해주세요."
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [
|
||||||
|
'result' => false,
|
||||||
|
'reqOTP' => false,
|
||||||
|
'reason' => "삭제 요청된 계정입니다.[{$userInfo['delete_after']}]"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$RootDB->insert('member_log', [
|
||||||
|
'member_no' => $userInfo['no'],
|
||||||
|
'action_type' => 'login',
|
||||||
|
'action' => Json::encode([
|
||||||
|
'ip' => Util::get_client_ip(true),
|
||||||
|
'type' => 'plain'
|
||||||
|
])
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($userInfo['oauth_type'] == 'KAKAO') {
|
||||||
|
$oauthFailResult = KakaoUtil::kakaoOAuthCheck($userInfo);
|
||||||
|
if ($oauthFailResult !== null) {
|
||||||
|
$session->login($userInfo['no'], $userInfo['id'], $userInfo['grade'], true, $userInfo['token_valid_until'], null, Json::decode($userInfo['acl'] ?? '{}'));
|
||||||
|
[$oauthReqOTP, $oauthFailReason] = $oauthFailResult;
|
||||||
|
return [
|
||||||
|
'result' => false,
|
||||||
|
'reqOTP' => $oauthReqOTP,
|
||||||
|
'reason' => $oauthFailReason
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->scrubToken($userInfo['no']);
|
||||||
|
$nextToken = $this->addToken($userInfo['no']);
|
||||||
|
|
||||||
|
$session->login($userInfo['no'], $userInfo['id'], $userInfo['grade'], false, $userInfo['token_valid_until'], $nextToken[0], Json::decode($userInfo['acl'] ?? '{}'));
|
||||||
|
|
||||||
|
|
||||||
|
return [
|
||||||
|
'result' => true,
|
||||||
|
'reqOTP' => false,
|
||||||
|
'nextToken' => $nextToken,
|
||||||
|
'reason' => '로그인 되었습니다.'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\Login;
|
||||||
|
|
||||||
|
use sammo\Session;
|
||||||
|
use DateTimeInterface;
|
||||||
|
use sammo\BaseAPI;
|
||||||
|
use sammo\Json;
|
||||||
|
use sammo\KakaoUtil;
|
||||||
|
use sammo\RootDB;
|
||||||
|
use sammo\TimeUtil;
|
||||||
|
use sammo\Util;
|
||||||
|
use sammo\Validator;
|
||||||
|
|
||||||
|
class LoginByToken extends LoginByID
|
||||||
|
{
|
||||||
|
|
||||||
|
public function getRequiredSessionMode(): int
|
||||||
|
{
|
||||||
|
return \sammo\BaseAPI::NO_SESSION; //XXX: Token 때문에 엄밀히는 NO_SESSION이 아님
|
||||||
|
}
|
||||||
|
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
$v = new Validator($this->args);
|
||||||
|
$v
|
||||||
|
->rule('required', [
|
||||||
|
'token_id',
|
||||||
|
'hashedToken'
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (!$v->validate()) {
|
||||||
|
return $v->errorStr();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||||
|
{
|
||||||
|
$loginNonce = $session->loginNonce ?? null;
|
||||||
|
$loginNonceExpired = $session->loginNonceExpired ?? null;
|
||||||
|
if (!is_string($loginNonce) || !is_string($loginNonceExpired)) {
|
||||||
|
return '자동 로그인: 절차 오류';
|
||||||
|
}
|
||||||
|
|
||||||
|
$RootDB = RootDB::db();
|
||||||
|
if ($session->isLoggedIn()) {
|
||||||
|
$session->logout();
|
||||||
|
}
|
||||||
|
|
||||||
|
$token_id = $this->args['token_id'];
|
||||||
|
|
||||||
|
$token_info = $RootDB->queryFirstRow('SELECT * FROM login_token WHERE id = %i', $token_id);
|
||||||
|
if (!$token_info) {
|
||||||
|
return [
|
||||||
|
'result' => false,
|
||||||
|
'silent' => true,
|
||||||
|
'reason' => 'failed'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$hashedToken = $this->args['hashedToken'];
|
||||||
|
$tokenAnswer = hash('sha512', "{$token_info['base_token']}{$loginNonce}");
|
||||||
|
if (strtolower($hashedToken) != strtolower($tokenAnswer)) {
|
||||||
|
return [
|
||||||
|
'result' => false,
|
||||||
|
'silent' => true,
|
||||||
|
'reason' => 'failed'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$userInfo = $RootDB->queryFirstRow(
|
||||||
|
'SELECT `no`, `id`, `name`, `grade`, `delete_after`, `acl`, oauth_id, oauth_type, oauth_info, token_valid_until ' .
|
||||||
|
'from member where NO = %i',
|
||||||
|
$token_info['user_id']
|
||||||
|
);
|
||||||
|
if(!$userInfo){
|
||||||
|
return '자동 로그인: 올바른 계정이 아닙니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$canLogin = $RootDB->queryFirstField('SELECT `LOGIN` FROM `system` WHERE `NO` = 1');
|
||||||
|
if ($canLogin != 'Y' && $userInfo['grade'] < 5) {
|
||||||
|
return '자동 로그인: 현재는 로그인이 금지되어있습니다!';
|
||||||
|
}
|
||||||
|
|
||||||
|
$nowDate = TimeUtil::now();
|
||||||
|
if ($userInfo['delete_after']) {
|
||||||
|
if ($userInfo['delete_after'] < $nowDate) {
|
||||||
|
$RootDB->delete('member', 'no=%i', $userInfo['no']);
|
||||||
|
return [
|
||||||
|
'result' => false,
|
||||||
|
'silent' => true,
|
||||||
|
'reason' => "기간 만기"
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [
|
||||||
|
'result' => false,
|
||||||
|
'silent' => true,
|
||||||
|
'reason' => "삭제 요청된 계정[{$userInfo['delete_after']}]"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$RootDB->insert('member_log', [
|
||||||
|
'member_no' => $userInfo['no'],
|
||||||
|
'action_type' => 'login',
|
||||||
|
'action' => Json::encode([
|
||||||
|
'ip' => Util::get_client_ip(true),
|
||||||
|
'type' => 'auto'
|
||||||
|
])
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($userInfo['oauth_type'] == 'KAKAO') {
|
||||||
|
$oauthFailResult = KakaoUtil::kakaoOAuthCheck($userInfo);
|
||||||
|
if ($oauthFailResult !== null) {
|
||||||
|
$session->login($userInfo['no'], $userInfo['id'], $userInfo['grade'], true, $userInfo['token_valid_until'], null, Json::decode($userInfo['acl'] ?? '{}'));
|
||||||
|
[$oauthReqOTP, $oauthFailReason] = $oauthFailResult;
|
||||||
|
$RootDB->delete(
|
||||||
|
'login_token',
|
||||||
|
'id = %i', $token_id
|
||||||
|
);
|
||||||
|
return $oauthFailReason;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$session->login($userInfo['no'], $userInfo['id'], $userInfo['grade'], false, $userInfo['token_valid_until'], $token_id, Json::decode($userInfo['acl'] ?? '{}'));
|
||||||
|
$this->scrubToken($userInfo['no']);
|
||||||
|
|
||||||
|
$nextDate = TimeUtil::nowAddDays(2);
|
||||||
|
if($nextDate < $token_info['expire_date']){
|
||||||
|
return [
|
||||||
|
'result' => true,
|
||||||
|
'silent' => true,
|
||||||
|
'reason' => 'success'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$RootDB->delete(
|
||||||
|
'login_token',
|
||||||
|
'id = %i', $token_id
|
||||||
|
);
|
||||||
|
$nextToken = $this->addToken($userInfo['no']);
|
||||||
|
return [
|
||||||
|
'result' => true,
|
||||||
|
'silent' => true,
|
||||||
|
'nextToken' => $nextToken,
|
||||||
|
'reason' => 'success'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\Login;
|
||||||
|
|
||||||
|
use sammo\Session;
|
||||||
|
use DateTimeInterface;
|
||||||
|
use sammo\BaseAPI;
|
||||||
|
use sammo\Json;
|
||||||
|
use sammo\KakaoUtil;
|
||||||
|
use sammo\RootDB;
|
||||||
|
use sammo\TimeUtil;
|
||||||
|
use sammo\Util;
|
||||||
|
use sammo\Validator;
|
||||||
|
|
||||||
|
class ReqNonce extends BaseAPI{
|
||||||
|
|
||||||
|
public function getRequiredSessionMode(): int {
|
||||||
|
return \sammo\BaseAPI::NO_SESSION;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag) {
|
||||||
|
$loginNonce = Util::randomStr(16);
|
||||||
|
$loginNonceExpired = TimeUtil::nowAddSeconds(2);
|
||||||
|
$session->loginNonce = $loginNonce;
|
||||||
|
$session->loginNonceExpired = $loginNonceExpired;
|
||||||
|
return [
|
||||||
|
'result'=>true,
|
||||||
|
'loginNonce'=>$loginNonce,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -40,7 +40,7 @@ class APIHelper
|
|||||||
|
|
||||||
$sessionMode = $obj->getRequiredSessionMode();
|
$sessionMode = $obj->getRequiredSessionMode();
|
||||||
if ($sessionMode === BaseAPI::NO_SESSION) {
|
if ($sessionMode === BaseAPI::NO_SESSION) {
|
||||||
$session = null;
|
$session = Session::getInstance();//XXX: NoSession이면 진짜 NoSession이어야..?
|
||||||
} else {
|
} else {
|
||||||
if ($sessionMode & BaseAPI::REQ_GAME_LOGIN) {
|
if ($sessionMode & BaseAPI::REQ_GAME_LOGIN) {
|
||||||
$session = Session::requireGameLogin();
|
$session = Session::requireGameLogin();
|
||||||
@@ -71,7 +71,7 @@ class APIHelper
|
|||||||
[$lastModified, $etag] = $cacheResult;
|
[$lastModified, $etag] = $cacheResult;
|
||||||
|
|
||||||
if ($lastModified !== null) {
|
if ($lastModified !== null) {
|
||||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s", TimeUtil::DateTimeToSeconds($lastModified, true)) . " GMT");
|
header("Last-Modified: " . gmdate("D, d M Y H:i:s", Util::toInt(TimeUtil::DateTimeToSeconds($lastModified, true))) . " GMT");
|
||||||
}
|
}
|
||||||
if ($etag !== null) {
|
if ($etag !== null) {
|
||||||
header("Etag: $etag");
|
header("Etag: $etag");
|
||||||
@@ -94,10 +94,10 @@ class APIHelper
|
|||||||
], $cacheResult === null ? Json::NO_CACHE : 0);
|
], $cacheResult === null ? Json::NO_CACHE : 0);
|
||||||
}
|
}
|
||||||
Json::die($result, $cacheResult === null ? Json::NO_CACHE : 0);
|
Json::die($result, $cacheResult === null ? Json::NO_CACHE : 0);
|
||||||
} catch (\Exception $e) {
|
} catch (\Throwable $e) {
|
||||||
Json::dieWithReason($e->getMessage());
|
Json::dieWithReason($e->getMessage());
|
||||||
} catch (mixed $e) {
|
} catch (mixed $e) {
|
||||||
Json::dieWithReason($e);
|
Json::dieWithReason(strval($e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace sammo;
|
|||||||
* @property bool $reqOTP 인증 코드 필요
|
* @property bool $reqOTP 인증 코드 필요
|
||||||
* @property array $acl 권한
|
* @property array $acl 권한
|
||||||
* @property string $tokenValidUntil 로그인 토큰 길이
|
* @property string $tokenValidUntil 로그인 토큰 길이
|
||||||
*
|
*
|
||||||
* @property int $generalID 장수 번호 (게임 로그인 필요)
|
* @property int $generalID 장수 번호 (게임 로그인 필요)
|
||||||
* @property string $generalName 장수 이름 (게임 로그인 필요)
|
* @property string $generalName 장수 이름 (게임 로그인 필요)
|
||||||
*/
|
*/
|
||||||
@@ -82,7 +82,7 @@ class DummySession extends Session
|
|||||||
return Util::array_get($_SESSION[$name]);
|
return Util::array_get($_SESSION[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function login(int $userID, string $userName, int $grade, bool $reqOTP, ?string $tokenValidUntil, array $acl): Session
|
public function login(int $userID, string $userName, int $grade, bool $reqOTP, ?string $tokenValidUntil, ?int $tokenID, array $acl): Session
|
||||||
{
|
{
|
||||||
$this->set('userID', $userID);
|
$this->set('userID', $userID);
|
||||||
$this->set('userName', $userName);
|
$this->set('userName', $userName);
|
||||||
@@ -92,6 +92,7 @@ class DummySession extends Session
|
|||||||
$this->set('acl', $acl);
|
$this->set('acl', $acl);
|
||||||
$this->set('reqOTP', $reqOTP);
|
$this->set('reqOTP', $reqOTP);
|
||||||
$this->set('tokenValidUntil', $tokenValidUntil);
|
$this->set('tokenValidUntil', $tokenValidUntil);
|
||||||
|
$this->set('tokenID', $tokenID);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +110,7 @@ class DummySession extends Session
|
|||||||
if (class_exists('\\sammo\\UniqueConst')) {
|
if (class_exists('\\sammo\\UniqueConst')) {
|
||||||
$this->logoutGame();
|
$this->logoutGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->set('userID', null);
|
$this->set('userID', null);
|
||||||
$this->set('userName', null);
|
$this->set('userName', null);
|
||||||
$this->set('userGrade', null);
|
$this->set('userGrade', null);
|
||||||
@@ -117,6 +118,7 @@ class DummySession extends Session
|
|||||||
$this->set('reqOTP', null);
|
$this->set('reqOTP', null);
|
||||||
$this->set('time', time());
|
$this->set('time', time());
|
||||||
$this->set('lastMsgGet', null);
|
$this->set('lastMsgGet', null);
|
||||||
|
$this->set('tokenID', null);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,7 +198,7 @@ class DummySession extends Session
|
|||||||
} else {
|
} else {
|
||||||
$obj = self::getInstance();
|
$obj = self::getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $obj->userGrade;
|
return $obj->userGrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,12 +214,12 @@ class DummySession extends Session
|
|||||||
} else {
|
} else {
|
||||||
$obj = self::getInstance();
|
$obj = self::getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $obj->userID;
|
return $obj->userID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static function getGeneralID(bool $requireLogin = false, string $exitPath = '..')
|
public static function getGeneralID(bool $requireLogin = false, string $exitPath = '..')
|
||||||
{
|
{
|
||||||
@@ -226,7 +228,7 @@ class DummySession extends Session
|
|||||||
} else {
|
} else {
|
||||||
$obj = self::getInstance();
|
$obj = self::getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $obj->generalID??0;
|
return $obj->generalID??0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +246,7 @@ class DummySession extends Session
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->userID) {
|
if ($this->userID) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ class Json
|
|||||||
return json_decode($value);
|
return json_decode($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return never */
|
||||||
public static function die($value, $flag = self::NO_CACHE)
|
public static function die($value, $flag = self::NO_CACHE)
|
||||||
{
|
{
|
||||||
//NOTE: REST 형식에 맞게, ok(), fail()로 쪼개는게 낫지 않을까 생각해봄.
|
//NOTE: REST 형식에 맞게, ok(), fail()로 쪼개는게 낫지 않을까 생각해봄.
|
||||||
|
|||||||
@@ -0,0 +1,221 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
use kakao\Kakao_REST_API_Helper;
|
||||||
|
|
||||||
|
class KakaoUtil
|
||||||
|
{
|
||||||
|
private function __construct()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static function checkUsernameDup($username)
|
||||||
|
{
|
||||||
|
if (!$username) {
|
||||||
|
return '계정명을 입력해주세요';
|
||||||
|
}
|
||||||
|
|
||||||
|
$username = mb_strtolower($username, 'utf-8');
|
||||||
|
$length = strlen($username);
|
||||||
|
if ($length < 4 || $length > 64) {
|
||||||
|
return '적절하지 않은 길이입니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$cnt = RootDB::db()->queryFirstField('SELECT count(no) FROM member WHERE `id` = %s LIMIT 1', $username);
|
||||||
|
if ($cnt != 0) {
|
||||||
|
return '이미 사용중인 계정명입니다';
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static function checkNicknameDup($nickname)
|
||||||
|
{
|
||||||
|
if (!$nickname) {
|
||||||
|
return '닉네임을 입력해주세요';
|
||||||
|
}
|
||||||
|
|
||||||
|
$length = mb_strwidth($nickname, 'utf-8');
|
||||||
|
if ($length < 1 || $length > 18) {
|
||||||
|
return '적절하지 않은 길이입니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$cnt = RootDB::db()->queryFirstField('SELECT count(no) FROM member WHERE `name` = %s LIMIT 1', $nickname);
|
||||||
|
if ($cnt != 0) {
|
||||||
|
return '이미 사용중인 닉네임입니다';
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static function checkEmailDup($email)
|
||||||
|
{
|
||||||
|
if (!$email) {
|
||||||
|
return '이메일을 입력해주세요';
|
||||||
|
}
|
||||||
|
|
||||||
|
$length = strlen($email);
|
||||||
|
if ($length < 1 || $length > 64) {
|
||||||
|
return '적절하지 않은 길이입니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$userInfo = RootDB::db()->queryFirstField('SELECT `no`, `delete_after` FROM member WHERE `email` = %s LIMIT 1', $email);
|
||||||
|
if ($userInfo) {
|
||||||
|
if (!$userInfo['delete_after']) {
|
||||||
|
return '이미 사용중인 이메일입니다. 관리자에게 문의해주세요.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($userInfo['delete_after'] >= $userInfo) {
|
||||||
|
return "삭제 요청된 계정입니다.[{$userInfo['delete_after']}]";
|
||||||
|
}
|
||||||
|
|
||||||
|
//$userInfo['delete_after'] < $userInfo
|
||||||
|
RootDB::db()->delete('member', 'no=%i', $userInfo['no']);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static function createOTPbyUserNO(int $userNo): bool
|
||||||
|
{
|
||||||
|
$userInfo = RootDB::db()->queryFirstRow('SELECT oauth_info FROM member WHERE no=%i', $userNo);
|
||||||
|
if (!$userInfo) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$oauthInfo = Json::decode($userInfo['oauth_info']);
|
||||||
|
if (!$oauthInfo) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$accessToken = $oauthInfo['accessToken'];
|
||||||
|
$OTPValue = $oauthInfo['OTPValue'] ?? null;
|
||||||
|
$OTPTrialUntil = $oauthInfo['OTPTrialUntil'] ?? null;
|
||||||
|
|
||||||
|
$now = TimeUtil::now();
|
||||||
|
|
||||||
|
|
||||||
|
if ($OTPTrialUntil && $OTPValue && $OTPTrialUntil > $now) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
[$OTPValue, $OTPTrialUntil] = static::createOTP($accessToken);
|
||||||
|
|
||||||
|
if (!$OTPValue) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$oauthInfo['OTPValue'] = $OTPValue;
|
||||||
|
$oauthInfo['OTPTrialUntil'] = $OTPTrialUntil;
|
||||||
|
$oauthInfo['OTPTrialCount'] = 3;
|
||||||
|
|
||||||
|
RootDB::db()->update('member', [
|
||||||
|
'oauth_info' => Json::encode($oauthInfo)
|
||||||
|
], 'no=%i', $userNo);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static function createOTP(string $accessToken): ?array
|
||||||
|
{
|
||||||
|
$restAPI = new Kakao_REST_API_Helper($accessToken);
|
||||||
|
|
||||||
|
$OTPValue = Util::randRangeInt(1000, 9999);
|
||||||
|
$OTPTrialUntil = TimeUtil::nowAddSeconds(180);
|
||||||
|
|
||||||
|
$sendResult = $restAPI->talk_to_me_default([
|
||||||
|
"object_type" => "text",
|
||||||
|
"text" => "인증 코드는 $OTPValue 입니다. $OTPTrialUntil 이내에 입력해주세요.",
|
||||||
|
"link" => [
|
||||||
|
"web_url" => ServConfig::getServerBasepath(),
|
||||||
|
"mobile_web_url" => ServConfig::getServerBasepath()
|
||||||
|
],
|
||||||
|
"button_title" => "로그인 페이지 열기"
|
||||||
|
]);
|
||||||
|
$sendResult['code'] = Util::array_get($sendResult['code'], 0);
|
||||||
|
if ($sendResult['code'] < 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [$OTPValue, $OTPTrialUntil];
|
||||||
|
}
|
||||||
|
|
||||||
|
static function kakaoOAuthCheck(array $userInfo): ?array
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!\kakao\KakaoKey::REST_KEY) {
|
||||||
|
return [false, '카카오 API 앱이 등록되지 않았습니다. 관리자에게 문의해 주세요.'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$oauthID = $userInfo['oauth_id'];
|
||||||
|
$oauthInfo = Json::decode($userInfo['oauth_info']) ?? [];
|
||||||
|
if (!$oauthInfo) {
|
||||||
|
return [false, 'OAuth 정보가 보관되어 있지 않습니다. 카카오 로그인을 수행해 주세요.'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$accessToken = $oauthInfo['accessToken'] ?? null;
|
||||||
|
$refreshToken = $oauthInfo['refreshToken'] ?? null;
|
||||||
|
$accessTokenValidUntil = $oauthInfo['accessTokenValidUntil'] ?? null;
|
||||||
|
$refreshTokenValidUntil = $oauthInfo['refreshTokenValidUntil'] ?? null;
|
||||||
|
$OTPValue = $oauthInfo['OTPValue'] ?? null;
|
||||||
|
$OTPTrialUntil = $oauthInfo['OTPTrialUntil'] ?? null;
|
||||||
|
$tokenValidUntil = $userInfo['token_valid_until'];
|
||||||
|
|
||||||
|
if (!$accessToken || !$refreshToken || !$accessTokenValidUntil || !$refreshTokenValidUntil) {
|
||||||
|
return [false, 'OAuth 정보가 보관되어 있지 않습니다. 카카오 로그인을 수행해 주세요.'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$now = TimeUtil::now();
|
||||||
|
|
||||||
|
if ($now > $refreshTokenValidUntil) {
|
||||||
|
return [false, '로그인 토큰이 만료되었습니다. 카카오 로그인을 수행해 주세요.'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($now > $accessTokenValidUntil) {
|
||||||
|
$apiHelper = new Kakao_REST_API_Helper($accessToken);
|
||||||
|
$refreshResult = $apiHelper->refresh_access_token($refreshToken);
|
||||||
|
if (!$refreshResult) {
|
||||||
|
return [false, '로그인 토큰 자동 갱신을 실패했습니다. 카카오 로그인을 수행해 주세요.'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$accessToken = $refreshResult['access_token'] ?? null;
|
||||||
|
|
||||||
|
if (!$accessToken) {
|
||||||
|
trigger_error("refreshToken 에러 " . Json::encode($refreshResult) . "," . $refreshToken . "," . substr(\kakao\KakaoKey::REST_KEY, 0, 6), E_USER_NOTICE);
|
||||||
|
return [false, '로그인 토큰 자동 갱신을 실패했습니다. 카카오 로그인을 수행해 주세요.'];
|
||||||
|
}
|
||||||
|
$accessTokenValidUntil = TimeUtil::nowAddSeconds($refreshResult['expires_in']);
|
||||||
|
|
||||||
|
$oauthInfo['accessToken'] = $accessToken;
|
||||||
|
$oauthInfo['accessTokenValidUntil'] = $accessTokenValidUntil;
|
||||||
|
|
||||||
|
$refreshToken = $refreshResult['refresh_token'] ?? null;
|
||||||
|
if ($refreshToken) {
|
||||||
|
$refreshTokenValidUntil = TimeUtil::nowAddSeconds($refreshResult['refresh_token_expires_in']);
|
||||||
|
|
||||||
|
$oauthInfo['refreshToken'] = $refreshToken;
|
||||||
|
$oauthInfo['refresh_token_expires_in'] = $refreshTokenValidUntil;
|
||||||
|
}
|
||||||
|
|
||||||
|
RootDB::db()->update('member', [
|
||||||
|
'oauth_info' => Json::encode($oauthInfo)
|
||||||
|
], 'no=%i', $userInfo['no']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($tokenValidUntil && $now <= $tokenValidUntil) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//인증 시스템 가동
|
||||||
|
$session = Session::getInstance();
|
||||||
|
$session->access_token = $accessToken;
|
||||||
|
$session->expires = $accessTokenValidUntil;
|
||||||
|
$session->refresh_token = $refreshToken;
|
||||||
|
$session->refresh_token_expires = $refreshTokenValidUntil;
|
||||||
|
|
||||||
|
if (!static::createOTPbyUserNO($userInfo['no'])) {
|
||||||
|
return [false, '인증 코드를 보내는데 실패했습니다.'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [true, '인증 코드를 입력해주세요'];
|
||||||
|
}
|
||||||
|
}
|
||||||
+16
-10
@@ -10,8 +10,9 @@ namespace sammo;
|
|||||||
* @property string $ip IP
|
* @property string $ip IP
|
||||||
* @property bool $reqOTP 인증 코드 필요
|
* @property bool $reqOTP 인증 코드 필요
|
||||||
* @property array $acl 권한
|
* @property array $acl 권한
|
||||||
|
* @property int|null $tokenID 토큰ID
|
||||||
* @property string $tokenValidUntil 로그인 토큰 길이
|
* @property string $tokenValidUntil 로그인 토큰 길이
|
||||||
*
|
*
|
||||||
* @property int $generalID 장수 번호 (게임 로그인 필요)
|
* @property int $generalID 장수 번호 (게임 로그인 필요)
|
||||||
* @property string $generalName 장수 이름 (게임 로그인 필요)
|
* @property string $generalName 장수 이름 (게임 로그인 필요)
|
||||||
*/
|
*/
|
||||||
@@ -35,7 +36,7 @@ class Session
|
|||||||
const GAME_KEY_GENERAL_ID = '_g_no';
|
const GAME_KEY_GENERAL_ID = '_g_no';
|
||||||
const GAME_KEY_GENERAL_NAME = '_g_name';
|
const GAME_KEY_GENERAL_NAME = '_g_name';
|
||||||
const GAME_KEY_EXPECTED_DEADTIME = '_g_deadtime';
|
const GAME_KEY_EXPECTED_DEADTIME = '_g_deadtime';
|
||||||
|
|
||||||
|
|
||||||
private $writeClosed = false;
|
private $writeClosed = false;
|
||||||
private $sessionID = null;
|
private $sessionID = null;
|
||||||
@@ -170,7 +171,7 @@ class Session
|
|||||||
return Util::array_get($_SESSION[$name]);
|
return Util::array_get($_SESSION[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function login(int $userID, string $userName, int $grade, bool $reqOTP, ?string $tokenValidUntil, array $acl): Session
|
public function login(int $userID, string $userName, int $grade, bool $reqOTP, ?string $tokenValidUntil, ?int $tokenID, array $acl): Session
|
||||||
{
|
{
|
||||||
$this->set('userID', $userID);
|
$this->set('userID', $userID);
|
||||||
$this->set('userName', $userName);
|
$this->set('userName', $userName);
|
||||||
@@ -180,6 +181,7 @@ class Session
|
|||||||
$this->set('acl', $acl);
|
$this->set('acl', $acl);
|
||||||
$this->set('reqOTP', $reqOTP);
|
$this->set('reqOTP', $reqOTP);
|
||||||
$this->set('tokenValidUntil', $tokenValidUntil);
|
$this->set('tokenValidUntil', $tokenValidUntil);
|
||||||
|
$this->set('tokenID', $tokenID);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,7 +199,11 @@ class Session
|
|||||||
if (class_exists('\\sammo\\UniqueConst')) {
|
if (class_exists('\\sammo\\UniqueConst')) {
|
||||||
$this->logoutGame();
|
$this->logoutGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->tokenID??null){
|
||||||
|
RootDB::db()->delete('login_token', 'id = %i', $this->tokenID);
|
||||||
|
}
|
||||||
|
|
||||||
$this->set('userID', null);
|
$this->set('userID', null);
|
||||||
$this->set('userName', null);
|
$this->set('userName', null);
|
||||||
$this->set('userGrade', null);
|
$this->set('userGrade', null);
|
||||||
@@ -261,7 +267,7 @@ class Session
|
|||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
$turnterm = $gameStor->turnterm;
|
$turnterm = $gameStor->turnterm;
|
||||||
$isUnited = $gameStor->isunited != 0;
|
$isUnited = $gameStor->isunited != 0;
|
||||||
|
|
||||||
@@ -319,7 +325,7 @@ class Session
|
|||||||
} else {
|
} else {
|
||||||
$obj = self::getInstance();
|
$obj = self::getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $obj->userGrade;
|
return $obj->userGrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,12 +341,12 @@ class Session
|
|||||||
} else {
|
} else {
|
||||||
$obj = self::getInstance();
|
$obj = self::getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $obj->userID;
|
return $obj->userID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static function getGeneralID(bool $requireLogin = false, string $exitPath = '..')
|
public static function getGeneralID(bool $requireLogin = false, string $exitPath = '..')
|
||||||
{
|
{
|
||||||
@@ -349,7 +355,7 @@ class Session
|
|||||||
} else {
|
} else {
|
||||||
$obj = self::getInstance();
|
$obj = self::getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $obj->generalID??0;
|
return $obj->generalID??0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,7 +373,7 @@ class Session
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->userID) {
|
if ($this->userID) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+26
-26
@@ -156,7 +156,7 @@ class Util extends \utilphp\util
|
|||||||
else{
|
else{
|
||||||
$text = str_replace("_tK_{$key}_", $value, $text);
|
$text = str_replace("_tK_{$key}_", $value, $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
file_put_contents($destFilePath, $text);
|
file_put_contents($destFilePath, $text);
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ class Util extends \utilphp\util
|
|||||||
else{
|
else{
|
||||||
$head[] = "class $newClassName extends $srcClassName";
|
$head[] = "class $newClassName extends $srcClassName";
|
||||||
}
|
}
|
||||||
|
|
||||||
$head[] = '{';
|
$head[] = '{';
|
||||||
$head[] = '';
|
$head[] = '';
|
||||||
$head = join("\n", $head);
|
$head = join("\n", $head);
|
||||||
@@ -203,7 +203,7 @@ class Util extends \utilphp\util
|
|||||||
}
|
}
|
||||||
$result = file_put_contents($destFilePath, $head.join("\n", $body).$tail, LOCK_EX);
|
$result = file_put_contents($destFilePath, $head.join("\n", $body).$tail, LOCK_EX);
|
||||||
assert($result);
|
assert($result);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,12 +281,12 @@ class Util extends \utilphp\util
|
|||||||
public static function convertArrayToDict($arr, $keyName)
|
public static function convertArrayToDict($arr, $keyName)
|
||||||
{
|
{
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
foreach ($arr as $obj) {
|
foreach ($arr as $obj) {
|
||||||
$key = $obj[$keyName];
|
$key = $obj[$keyName];
|
||||||
$result[$key] = $obj;
|
$result[$key] = $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,7 +309,7 @@ class Util extends \utilphp\util
|
|||||||
public static function convertDictToArray($dict, bool $withKey=true)
|
public static function convertDictToArray($dict, bool $withKey=true)
|
||||||
{
|
{
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
foreach($dict as $key=>$value){
|
foreach($dict as $key=>$value){
|
||||||
if($withKey){
|
if($withKey){
|
||||||
$result[] = [$key, $value];
|
$result[] = [$key, $value];
|
||||||
@@ -318,7 +318,7 @@ class Util extends \utilphp\util
|
|||||||
$result[] = $value;
|
$result[] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,7 +327,7 @@ class Util extends \utilphp\util
|
|||||||
foreach($dict as $dictKey=>$value){
|
foreach($dict as $dictKey=>$value){
|
||||||
$result[$dictKey] = $value[$key];
|
$result[$dictKey] = $value[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,7 +354,7 @@ class Util extends \utilphp\util
|
|||||||
}
|
}
|
||||||
$idx = $key + 1;
|
$idx = $key + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,20 +368,20 @@ class Util extends \utilphp\util
|
|||||||
if ($dict === null) {
|
if ($dict === null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($dict) && empty($dict)) {
|
if (is_array($dict) && empty($dict)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($depth <= 0) {
|
if ($depth <= 0) {
|
||||||
return $dict;
|
return $dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($dict as $key=>$value) {
|
foreach ($dict as $key=>$value) {
|
||||||
if ($value === null) {
|
if ($value === null) {
|
||||||
unset($dict[$key]);
|
unset($dict[$key]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!Util::isDict($value)) {
|
if (!Util::isDict($value)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -393,7 +393,7 @@ class Util extends \utilphp\util
|
|||||||
$dict[$key] = $newValue;
|
$dict[$key] = $newValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $dict;
|
return $dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -465,7 +465,7 @@ class Util extends \utilphp\util
|
|||||||
|
|
||||||
return (float)$matches[1] / 100;
|
return (float)$matches[1] / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $min과 $max 사이의 값으로 교정
|
* $min과 $max 사이의 값으로 교정
|
||||||
@@ -552,7 +552,7 @@ class Util extends \utilphp\util
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 2중 배열에서 특정 키의 합
|
* 2중 배열에서 특정 키의 합
|
||||||
*
|
*
|
||||||
* @param array $array 배열. 1차원 배열 또는 2차원 배열
|
* @param array $array 배열. 1차원 배열 또는 2차원 배열
|
||||||
* @param int|string|null $key 2차원 배열에서 참조할 키.
|
* @param int|string|null $key 2차원 배열에서 참조할 키.
|
||||||
* @return int|float 합계
|
* @return int|float 합계
|
||||||
@@ -570,14 +570,14 @@ class Util extends \utilphp\util
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 특정 키를 가진 값으로 묶음
|
* 특정 키를 가진 값으로 묶음
|
||||||
*
|
*
|
||||||
* @param array $array 배열. 1차원 배열 또는 2차원 배열
|
* @param array $array 배열. 1차원 배열 또는 2차원 배열
|
||||||
* @param int|string|null $key 2차원 배열에서 참조할 키.
|
* @param int|string|null $key 2차원 배열에서 참조할 키.
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function arrayGroupBy(array $array, $key, bool $preserveRowKey=false) {
|
public static function arrayGroupBy(array $array, $key, bool $preserveRowKey=false) {
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
if($preserveRowKey){
|
if($preserveRowKey){
|
||||||
foreach($array as $rowKey=>$val) {
|
foreach($array as $rowKey=>$val) {
|
||||||
if(key_exists($key, $val)){
|
if(key_exists($key, $val)){
|
||||||
@@ -596,7 +596,7 @@ class Util extends \utilphp\util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -618,7 +618,7 @@ class Util extends \utilphp\util
|
|||||||
*
|
*
|
||||||
* @param array $items 선택하고자 하는 배열
|
* @param array $items 선택하고자 하는 배열
|
||||||
*
|
*
|
||||||
* @return int|float|string|object 선택된 value값.
|
* @return int|float|string|array|object 선택된 value값.
|
||||||
*/
|
*/
|
||||||
public static function choiceRandom(array $items)
|
public static function choiceRandom(array $items)
|
||||||
{
|
{
|
||||||
@@ -700,7 +700,7 @@ class Util extends \utilphp\util
|
|||||||
else{
|
else{
|
||||||
throw new \InvalidArgumentException('$lhs is not Traversable');
|
throw new \InvalidArgumentException('$lhs is not Traversable');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($rhs instanceof \Traversable){
|
if($rhs instanceof \Traversable){
|
||||||
$rhsIter = new \IteratorIterator($rhs);
|
$rhsIter = new \IteratorIterator($rhs);
|
||||||
}
|
}
|
||||||
@@ -778,11 +778,11 @@ class Util extends \utilphp\util
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Python 3의 range와 동일
|
* Python 3의 range와 동일
|
||||||
* @param int $from
|
* @param int $from
|
||||||
* @param null|int $to
|
* @param null|int $to
|
||||||
* @param null|int $step
|
* @param null|int $step
|
||||||
* @return \Traversable
|
* @return \Traversable
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public static function range(int $from, ?int $to=null, ?int $step=null):\Traversable{
|
public static function range(int $from, ?int $to=null, ?int $step=null):\Traversable{
|
||||||
if($to === null){
|
if($to === null){
|
||||||
@@ -809,5 +809,5 @@ class Util extends \utilphp\util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
../nesbot/carbon/bin/carbon
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user