@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $this->Collation = isset($indexField['Collation']) ? $indexField['Collation'] : null; |
| 28 | 28 | $this->Cardinality = isset($indexField['Cardinality']) ? $indexField['Cardinality'] : null; |
| 29 | 29 | $this->Sub_part = isset($indexField['Sub_part']) ? $indexField['Sub_part'] : null; |
| 30 | - $this->Null = isset($indexField['Null']) ? $indexField['Null'] : null; |
|
| 30 | + $this->null = isset($indexField['Null']) ? $indexField['Null'] : null; |
|
| 31 | 31 | $this->Expression = isset($indexField['Expression']) ? $indexField['Expression'] : null; |
| 32 | 32 | |
| 33 | 33 | return $this; |
@@ -153,7 +153,7 @@ |
||
| 153 | 153 | |
| 154 | 154 | |
| 155 | 155 | // If this field is not null and default value is not set - then this field is mandatory |
| 156 | - if ($fieldDescription->Null === 'NO' && $fieldDescription->Default === null && !$nonMandatory) { |
|
| 156 | + if ($fieldDescription->null === 'NO' && $fieldDescription->Default === null && !$nonMandatory) { |
|
| 157 | 157 | $this->mandatory = true; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -6,14 +6,14 @@ |
||
| 6 | 6 | |
| 7 | 7 | global $sn_page_name, $sn_mvc, $template, $template_result; |
| 8 | 8 | |
| 9 | -if(isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) { |
|
| 9 | +if (isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) { |
|
| 10 | 10 | require_once('common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 11 | - if($sn_page_name) { |
|
| 11 | + if ($sn_page_name) { |
|
| 12 | 12 | // Loading page-specific language files |
| 13 | 13 | |
| 14 | 14 | !empty($sn_mvc['model'][$sn_page_name]) and execute_hooks($sn_mvc['model'][$sn_page_name], $template, 'model', $sn_page_name); |
| 15 | 15 | !empty($sn_mvc['view'][$sn_page_name]) and execute_hooks($sn_mvc['view'][$sn_page_name], $template, 'view', $sn_page_name); |
| 16 | - if(!empty($template_result) && is_object($template)) { |
|
| 16 | + if (!empty($template_result) && is_object($template)) { |
|
| 17 | 17 | $template->assign_recursive($template_result); |
| 18 | 18 | } |
| 19 | 19 | |
@@ -1190,12 +1190,12 @@ |
||
| 1190 | 1190 | ], |
| 1191 | 1191 | // Defensive building list |
| 1192 | 1192 | UNIT_DEFENCE_STR => [UNIT_DEF_TURRET_MISSILE => UNIT_DEF_TURRET_MISSILE, UNIT_DEF_TURRET_LASER_SMALL => UNIT_DEF_TURRET_LASER_SMALL, |
| 1193 | - UNIT_DEF_TURRET_LASER_BIG => UNIT_DEF_TURRET_LASER_BIG, UNIT_DEF_TURRET_GAUSS => UNIT_DEF_TURRET_GAUSS, |
|
| 1194 | - UNIT_DEF_TURRET_ION => UNIT_DEF_TURRET_ION, UNIT_DEF_TURRET_PLASMA => UNIT_DEF_TURRET_PLASMA, |
|
| 1193 | + UNIT_DEF_TURRET_LASER_BIG => UNIT_DEF_TURRET_LASER_BIG, UNIT_DEF_TURRET_GAUSS => UNIT_DEF_TURRET_GAUSS, |
|
| 1194 | + UNIT_DEF_TURRET_ION => UNIT_DEF_TURRET_ION, UNIT_DEF_TURRET_PLASMA => UNIT_DEF_TURRET_PLASMA, |
|
| 1195 | 1195 | |
| 1196 | - UNIT_DEF_SHIELD_SMALL => UNIT_DEF_SHIELD_SMALL, UNIT_DEF_SHIELD_BIG => UNIT_DEF_SHIELD_BIG, UNIT_DEF_SHIELD_PLANET => UNIT_DEF_SHIELD_PLANET, |
|
| 1196 | + UNIT_DEF_SHIELD_SMALL => UNIT_DEF_SHIELD_SMALL, UNIT_DEF_SHIELD_BIG => UNIT_DEF_SHIELD_BIG, UNIT_DEF_SHIELD_PLANET => UNIT_DEF_SHIELD_PLANET, |
|
| 1197 | 1197 | |
| 1198 | - UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET, |
|
| 1198 | + UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET, |
|
| 1199 | 1199 | ], |
| 1200 | 1200 | |
| 1201 | 1201 | // Missiles list |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | // 'chat' => ['sn_chat_model'], |
| 35 | 35 | // 'chat_add' => ['sn_chat_add_model'], |
| 36 | - 'chat' => [Chat::class . '::' . 'chatModel'], |
|
| 37 | - 'chat_add' => [Chat::class . '::' . 'chatAddModel'], |
|
| 36 | + 'chat' => [Chat::class . '::' . 'chatModel'], |
|
| 37 | + 'chat_add' => [Chat::class . '::' . 'chatAddModel'], |
|
| 38 | 38 | |
| 39 | 39 | 'imperium' => [PageImperium::class . '::' . 'modelStatic'], |
| 40 | 40 | |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | // 'chat' => ['sn_chat_view'], |
| 50 | 50 | // 'chat_msg' => ['sn_chat_msg_view'], |
| 51 | - 'chat' => [Chat::class . '::' . 'chatView'], |
|
| 52 | - 'chat_msg' => [Chat::class . '::' . 'chatMsgView'], |
|
| 53 | - 'chat_frame' => [Chat::class . '::' . 'chatFrameView'], |
|
| 51 | + 'chat' => [Chat::class . '::' . 'chatView'], |
|
| 52 | + 'chat_msg' => [Chat::class . '::' . 'chatMsgView'], |
|
| 53 | + 'chat_frame' => [Chat::class . '::' . 'chatFrameView'], |
|
| 54 | 54 | |
| 55 | 55 | 'battle_report' => ['sn_battle_report_view'], |
| 56 | 56 | 'contact' => ['sn_contact_view'], |
@@ -646,29 +646,29 @@ discard block |
||
| 646 | 646 | P_MISSION_EXPEDITION_OUTCOME => FLT_EXPEDITION_OUTCOME_FOUND_FLEET, |
| 647 | 647 | P_MISSION_EXPEDITION_OUTCOME_TYPE => FLT_EXPEDITION_OUTCOME_TYPE_GOOD, |
| 648 | 648 | P_CHANCE => 200, |
| 649 | - 'percent' => [0 => 0.1, 1 => 0.02, 2 => 0.01,], |
|
| 649 | + 'percent' => [0 => 0.1, 1 => 0.02, 2 => 0.01, ], |
|
| 650 | 650 | P_MISSION_EXPEDITION_OUTCOME_SECONDARY => [ |
| 651 | - [P_CHANCE => 90, P_MULTIPLIER => 0.01, P_MESSAGE_ID => 2,], |
|
| 652 | - [P_CHANCE => 9, P_MULTIPLIER => 0.02, P_MESSAGE_ID => 1,], |
|
| 653 | - [P_CHANCE => 1, P_MULTIPLIER => 0.10, P_MESSAGE_ID => 0,], |
|
| 651 | + [P_CHANCE => 90, P_MULTIPLIER => 0.01, P_MESSAGE_ID => 2, ], |
|
| 652 | + [P_CHANCE => 9, P_MULTIPLIER => 0.02, P_MESSAGE_ID => 1, ], |
|
| 653 | + [P_CHANCE => 1, P_MULTIPLIER => 0.10, P_MESSAGE_ID => 0, ], |
|
| 654 | 654 | ], |
| 655 | 655 | ], |
| 656 | 656 | FLT_EXPEDITION_OUTCOME_FOUND_RESOURCES => [ |
| 657 | 657 | P_MISSION_EXPEDITION_OUTCOME => FLT_EXPEDITION_OUTCOME_FOUND_RESOURCES, |
| 658 | 658 | P_MISSION_EXPEDITION_OUTCOME_TYPE => FLT_EXPEDITION_OUTCOME_TYPE_GOOD, |
| 659 | 659 | P_CHANCE => 300, |
| 660 | - 'percent' => [0 => 0.1, 1 => 0.050, 2 => 0.025,], |
|
| 660 | + 'percent' => [0 => 0.1, 1 => 0.050, 2 => 0.025, ], |
|
| 661 | 661 | P_MISSION_EXPEDITION_OUTCOME_SECONDARY => [ |
| 662 | - [P_CHANCE => 90, P_MULTIPLIER => 0.025, P_MESSAGE_ID => 2,], |
|
| 663 | - [P_CHANCE => 9, P_MULTIPLIER => 0.050, P_MESSAGE_ID => 1,], |
|
| 664 | - [P_CHANCE => 1, P_MULTIPLIER => 0.100, P_MESSAGE_ID => 0,], |
|
| 662 | + [P_CHANCE => 90, P_MULTIPLIER => 0.025, P_MESSAGE_ID => 2, ], |
|
| 663 | + [P_CHANCE => 9, P_MULTIPLIER => 0.050, P_MESSAGE_ID => 1, ], |
|
| 664 | + [P_CHANCE => 1, P_MULTIPLIER => 0.100, P_MESSAGE_ID => 0, ], |
|
| 665 | 665 | ], |
| 666 | 666 | ], |
| 667 | 667 | FLT_EXPEDITION_OUTCOME_FOUND_DM => [ |
| 668 | 668 | P_MISSION_EXPEDITION_OUTCOME => FLT_EXPEDITION_OUTCOME_FOUND_DM, |
| 669 | 669 | P_MISSION_EXPEDITION_OUTCOME_TYPE => FLT_EXPEDITION_OUTCOME_TYPE_GOOD, |
| 670 | 670 | P_CHANCE => 100, |
| 671 | - 'percent' => [0 => 0.0100, 1 => 0.0040, 2 => 0.0010,], |
|
| 671 | + 'percent' => [0 => 0.0100, 1 => 0.0040, 2 => 0.0010, ], |
|
| 672 | 672 | P_MISSION_EXPEDITION_OUTCOME_SECONDARY => [ |
| 673 | 673 | [P_CHANCE => 90, P_MULTIPLIER => 0.0010, /*P_MESSAGE_ID => 2,*/], |
| 674 | 674 | [P_CHANCE => 9, P_MULTIPLIER => 0.0040, /*P_MESSAGE_ID => 1,*/], |
@@ -703,14 +703,14 @@ discard block |
||
| 703 | 703 | ], |
| 704 | 704 | |
| 705 | 705 | 'planet_generator' => [ |
| 706 | - 0 => [ // HomeWorld |
|
| 706 | + 0 => [// HomeWorld |
|
| 707 | 707 | 't_max_min' => 40, // Tmax 40 |
| 708 | 708 | 't_max_max' => 40, |
| 709 | 709 | 't_delta_min' => 40, // Tmin 0 |
| 710 | 710 | 't_delta_max' => 40, |
| 711 | 711 | 'size_min' => $config->initial_fields, |
| 712 | 712 | 'size_max' => $config->initial_fields, |
| 713 | - 'core_types' => [PLANET_DENSITY_STANDARD,], |
|
| 713 | + 'core_types' => [PLANET_DENSITY_STANDARD, ], |
|
| 714 | 714 | 'planet_images' => ['normaltemp'], |
| 715 | 715 | ], |
| 716 | 716 | 1 => [ |
@@ -940,7 +940,7 @@ discard block |
||
| 940 | 940 | ], |
| 941 | 941 | 'planet_images' => ['eis'], |
| 942 | 942 | ], |
| 943 | - 16 => [ // Random planet - stranger; -35 avg |
|
| 943 | + 16 => [// Random planet - stranger; -35 avg |
|
| 944 | 944 | 't_max_min' => -90, |
| 945 | 945 | 't_max_max' => +40, |
| 946 | 946 | 't_delta_min' => 2, |
@@ -960,7 +960,7 @@ discard block |
||
| 960 | 960 | PLANET_DENSITY_METAL_PERIDOT, |
| 961 | 961 | PLANET_DENSITY_METAL_RAW, |
| 962 | 962 | ], |
| 963 | - 'planet_images' => ['trocken', 'dschjungel', 'normaltemp', 'wasser', 'eis',], |
|
| 963 | + 'planet_images' => ['trocken', 'dschjungel', 'normaltemp', 'wasser', 'eis', ], |
|
| 964 | 964 | ], |
| 965 | 965 | ], |
| 966 | 966 | |
@@ -983,7 +983,7 @@ discard block |
||
| 983 | 983 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_ICE_HYDROGEN, |
| 984 | 984 | UNIT_PLANET_DENSITY_RARITY => 30, // 1, // 40.00, // * 1/121 0,82645 |
| 985 | 985 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_PERFECT, |
| 986 | - UNIT_RESOURCES => [RES_METAL => 0.20, RES_CRYSTAL => 0.60, RES_DEUTERIUM => 7.10,], |
|
| 986 | + UNIT_RESOURCES => [RES_METAL => 0.20, RES_CRYSTAL => 0.60, RES_DEUTERIUM => 7.10, ], |
|
| 987 | 987 | UNIT_PLANET_DENSITY_MAX_SECTORS => 150, |
| 988 | 988 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11, |
| 989 | 989 | ], |
@@ -992,7 +992,7 @@ discard block |
||
| 992 | 992 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_ICE_METHANE, |
| 993 | 993 | UNIT_PLANET_DENSITY_RARITY => 130, // 6, // 6.67, // * 6,0 4,95868 |
| 994 | 994 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_GOOD, |
| 995 | - UNIT_RESOURCES => [RES_METAL => 0.55, RES_CRYSTAL => 0.85, RES_DEUTERIUM => 4.60,], |
|
| 995 | + UNIT_RESOURCES => [RES_METAL => 0.55, RES_CRYSTAL => 0.85, RES_DEUTERIUM => 4.60, ], |
|
| 996 | 996 | UNIT_PLANET_DENSITY_MAX_SECTORS => 200, |
| 997 | 997 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6, |
| 998 | 998 | ], |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_ICE_WATER, |
| 1002 | 1002 | UNIT_PLANET_DENSITY_RARITY => 450, //20, // 2.00, // * 20,0 16,52893 |
| 1003 | 1003 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_AVERAGE, |
| 1004 | - UNIT_RESOURCES => [RES_METAL => 0.86, RES_CRYSTAL => 0.95, RES_DEUTERIUM => 2.20,], |
|
| 1004 | + UNIT_RESOURCES => [RES_METAL => 0.86, RES_CRYSTAL => 0.95, RES_DEUTERIUM => 2.20, ], |
|
| 1005 | 1005 | UNIT_PLANET_DENSITY_MAX_SECTORS => 999, |
| 1006 | 1006 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0, |
| 1007 | 1007 | ], |
@@ -1011,7 +1011,7 @@ discard block |
||
| 1011 | 1011 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_CRYSTAL_RAW, |
| 1012 | 1012 | UNIT_PLANET_DENSITY_RARITY => 20, // 1, // 40.00, // *1,0 0,82645 |
| 1013 | 1013 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_PERFECT, |
| 1014 | - UNIT_RESOURCES => [RES_METAL => 0.40, RES_CRYSTAL => 12.37, RES_DEUTERIUM => 0.50,], |
|
| 1014 | + UNIT_RESOURCES => [RES_METAL => 0.40, RES_CRYSTAL => 12.37, RES_DEUTERIUM => 0.50, ], |
|
| 1015 | 1015 | UNIT_PLANET_DENSITY_MAX_SECTORS => 150, |
| 1016 | 1016 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11, |
| 1017 | 1017 | ], |
@@ -1020,7 +1020,7 @@ discard block |
||
| 1020 | 1020 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_CRYSTAL_SILICATE, |
| 1021 | 1021 | UNIT_PLANET_DENSITY_RARITY => 140, // 5.71, // * 7,0 5,78512 |
| 1022 | 1022 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_GOOD, |
| 1023 | - UNIT_RESOURCES => [RES_METAL => 0.67, RES_CRYSTAL => 4.50, RES_DEUTERIUM => 0.85,], |
|
| 1023 | + UNIT_RESOURCES => [RES_METAL => 0.67, RES_CRYSTAL => 4.50, RES_DEUTERIUM => 0.85, ], |
|
| 1024 | 1024 | UNIT_PLANET_DENSITY_MAX_SECTORS => 200, |
| 1025 | 1025 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6, |
| 1026 | 1026 | ], |
@@ -1029,7 +1029,7 @@ discard block |
||
| 1029 | 1029 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_CRYSTAL_STONE, |
| 1030 | 1030 | UNIT_PLANET_DENSITY_RARITY => 500, // 1.90, // * 21,0 17,35537 |
| 1031 | 1031 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_AVERAGE, |
| 1032 | - UNIT_RESOURCES => [RES_METAL => 0.80, RES_CRYSTAL => 2.00, RES_DEUTERIUM => 0.95,], |
|
| 1032 | + UNIT_RESOURCES => [RES_METAL => 0.80, RES_CRYSTAL => 2.00, RES_DEUTERIUM => 0.95, ], |
|
| 1033 | 1033 | UNIT_PLANET_DENSITY_MAX_SECTORS => 999, |
| 1034 | 1034 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0, |
| 1035 | 1035 | ], |
@@ -1039,7 +1039,7 @@ discard block |
||
| 1039 | 1039 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_STANDARD, |
| 1040 | 1040 | UNIT_PLANET_DENSITY_RARITY => 1000, // 1.0, // * 40,0 33,05785 |
| 1041 | 1041 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_NORMAL, |
| 1042 | - UNIT_RESOURCES => [RES_METAL => 1.00, RES_CRYSTAL => 1.00, RES_DEUTERIUM => 1.00,], |
|
| 1042 | + UNIT_RESOURCES => [RES_METAL => 1.00, RES_CRYSTAL => 1.00, RES_DEUTERIUM => 1.00, ], |
|
| 1043 | 1043 | UNIT_PLANET_DENSITY_MAX_SECTORS => 999, |
| 1044 | 1044 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0, |
| 1045 | 1045 | ], |
@@ -1049,7 +1049,7 @@ discard block |
||
| 1049 | 1049 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_METAL_ORE, |
| 1050 | 1050 | UNIT_PLANET_DENSITY_RARITY => 550, // 2.11, // * 19,0 15,70248 |
| 1051 | 1051 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_AVERAGE, |
| 1052 | - UNIT_RESOURCES => [RES_METAL => 1.60, RES_CRYSTAL => 0.90, RES_DEUTERIUM => 0.80,], |
|
| 1052 | + UNIT_RESOURCES => [RES_METAL => 1.60, RES_CRYSTAL => 0.90, RES_DEUTERIUM => 0.80, ], |
|
| 1053 | 1053 | UNIT_PLANET_DENSITY_MAX_SECTORS => 999, |
| 1054 | 1054 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0, |
| 1055 | 1055 | ], |
@@ -1058,7 +1058,7 @@ discard block |
||
| 1058 | 1058 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_METAL_PERIDOT, |
| 1059 | 1059 | UNIT_PLANET_DENSITY_RARITY => 120, // 8.00, // * 5,0 4,13223 |
| 1060 | 1060 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_GOOD, |
| 1061 | - UNIT_RESOURCES => [RES_METAL => 4.71, RES_CRYSTAL => 0.80, RES_DEUTERIUM => 0.55,], |
|
| 1061 | + UNIT_RESOURCES => [RES_METAL => 4.71, RES_CRYSTAL => 0.80, RES_DEUTERIUM => 0.55, ], |
|
| 1062 | 1062 | UNIT_PLANET_DENSITY_MAX_SECTORS => 200, |
| 1063 | 1063 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6, |
| 1064 | 1064 | ], |
@@ -1067,7 +1067,7 @@ discard block |
||
| 1067 | 1067 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_METAL_RAW, |
| 1068 | 1068 | UNIT_PLANET_DENSITY_RARITY => 25, // 40.00, // * 1,0 0,82645 |
| 1069 | 1069 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_PERFECT, |
| 1070 | - UNIT_RESOURCES => [RES_METAL => 8.00, RES_CRYSTAL => 0.40, RES_DEUTERIUM => 0.25,], |
|
| 1070 | + UNIT_RESOURCES => [RES_METAL => 8.00, RES_CRYSTAL => 0.40, RES_DEUTERIUM => 0.25, ], |
|
| 1071 | 1071 | UNIT_PLANET_DENSITY_MAX_SECTORS => 150, |
| 1072 | 1072 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11, |
| 1073 | 1073 | ], |
@@ -1244,7 +1244,7 @@ discard block |
||
| 1244 | 1244 | ], |
| 1245 | 1245 | |
| 1246 | 1246 | // Missiles list |
| 1247 | - UNIT_DEF_MISSILES_STR => [UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET,], |
|
| 1247 | + UNIT_DEF_MISSILES_STR => [UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET, ], |
|
| 1248 | 1248 | |
| 1249 | 1249 | // Combat units list |
| 1250 | 1250 | 'combat' => [ |
@@ -1293,7 +1293,7 @@ discard block |
||
| 1293 | 1293 | // Resource list |
| 1294 | 1294 | UNIT_RESOURCES_STR => [0 => 'metal', 1 => 'crystal', 2 => 'deuterium', 3 => 'dark_matter'], |
| 1295 | 1295 | // Resources all |
| 1296 | - 'resources_all' => [RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_ENERGY => RES_ENERGY, RES_DARK_MATTER => RES_DARK_MATTER, RES_METAMATTER => RES_METAMATTER,], |
|
| 1296 | + 'resources_all' => [RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_ENERGY => RES_ENERGY, RES_DARK_MATTER => RES_DARK_MATTER, RES_METAMATTER => RES_METAMATTER, ], |
|
| 1297 | 1297 | // Resources can be produced on planet |
| 1298 | 1298 | 'resources_planet' => [RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_ENERGY => RES_ENERGY], |
| 1299 | 1299 | // Resources can be looted from planet |
@@ -1312,13 +1312,13 @@ discard block |
||
| 1312 | 1312 | ], |
| 1313 | 1313 | |
| 1314 | 1314 | // Resources that can be tradeable in market trader AND be a quest_rewards |
| 1315 | - 'quest_rewards' => [RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_DARK_MATTER => RES_DARK_MATTER,], |
|
| 1315 | + 'quest_rewards' => [RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_DARK_MATTER => RES_DARK_MATTER, ], |
|
| 1316 | 1316 | |
| 1317 | 1317 | // // Ques list |
| 1318 | 1318 | // 'ques' => array(QUE_STRUCTURES, QUE_HANGAR, QUE_RESEARCH), |
| 1319 | 1319 | |
| 1320 | - 'STAT_COMMON' => [STAT_TOTAL => STAT_TOTAL, STAT_FLEET => STAT_FLEET, STAT_TECH => STAT_TECH, STAT_BUILDING => STAT_BUILDING, STAT_DEFENSE => STAT_DEFENSE, STAT_RESOURCE => STAT_RESOURCE,], |
|
| 1321 | - 'STAT_PLAYER' => [STAT_RAID_TOTAL => STAT_RAID_TOTAL, STAT_RAID_WON => STAT_RAID_WON, STAT_RAID_LOST => STAT_RAID_LOST, STAT_LVL_BUILDING => STAT_LVL_BUILDING, STAT_LVL_TECH => STAT_LVL_TECH, STAT_LVL_RAID => STAT_LVL_RAID,], |
|
| 1320 | + 'STAT_COMMON' => [STAT_TOTAL => STAT_TOTAL, STAT_FLEET => STAT_FLEET, STAT_TECH => STAT_TECH, STAT_BUILDING => STAT_BUILDING, STAT_DEFENSE => STAT_DEFENSE, STAT_RESOURCE => STAT_RESOURCE, ], |
|
| 1321 | + 'STAT_PLAYER' => [STAT_RAID_TOTAL => STAT_RAID_TOTAL, STAT_RAID_WON => STAT_RAID_WON, STAT_RAID_LOST => STAT_RAID_LOST, STAT_LVL_BUILDING => STAT_LVL_BUILDING, STAT_LVL_TECH => STAT_LVL_TECH, STAT_LVL_RAID => STAT_LVL_RAID, ], |
|
| 1322 | 1322 | |
| 1323 | 1323 | GROUP_GROUP_ID_TO_NAMES => [ |
| 1324 | 1324 | UNIT_STRUCTURES => 'structures', |
@@ -1332,7 +1332,7 @@ discard block |
||
| 1332 | 1332 | UNIT_PLANS => 'plans', |
| 1333 | 1333 | ], |
| 1334 | 1334 | |
| 1335 | - GROUP_CAPITAL_BUILDING_BONUS_GROUPS => ['structures', 'defense', 'fleet',], |
|
| 1335 | + GROUP_CAPITAL_BUILDING_BONUS_GROUPS => ['structures', 'defense', 'fleet', ], |
|
| 1336 | 1336 | |
| 1337 | 1337 | GROUP_UNIT_COMBAT_SORT_ORDER => [ |
| 1338 | 1338 | SHIP_SPY, |
@@ -23,18 +23,24 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | // Test de coherance de la destination (voir si elle se trouve dans les limites de l'univers connu |
| 25 | 25 | $errorlist = ''; |
| 26 | - if (!$galaxy || $galaxy > $config->game_maxGalaxy || $galaxy < 1) |
|
| 27 | - $errorlist .= $lang['fl_limit_galaxy']; |
|
| 28 | - if (!$system || $system > $config->game_maxSystem || $system < 1) |
|
| 29 | - $errorlist .= $lang['fl_limit_system']; |
|
| 30 | - if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE )) |
|
| 31 | - $errorlist .= $lang['fl_limit_planet']; |
|
| 32 | - if ($planetrow['galaxy'] == $galaxy && $planetrow['system'] == $system && $planetrow['planet'] == $planet && $planetrow['planet_type'] == $planet_type) |
|
| 33 | - $errorlist .= $lang['fl_ownpl_err']; |
|
| 34 | - if (!$planet_type) |
|
| 35 | - $errorlist .= $lang['fl_no_planettype']; |
|
| 36 | - if ($planet_type != PT_PLANET && $planet_type != PT_DEBRIS && $planet_type != PT_MOON) |
|
| 37 | - $errorlist .= $lang['fl_fleet_err_pl']; |
|
| 26 | + if (!$galaxy || $galaxy > $config->game_maxGalaxy || $galaxy < 1) { |
|
| 27 | + $errorlist .= $lang['fl_limit_galaxy']; |
|
| 28 | + } |
|
| 29 | + if (!$system || $system > $config->game_maxSystem || $system < 1) { |
|
| 30 | + $errorlist .= $lang['fl_limit_system']; |
|
| 31 | + } |
|
| 32 | + if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE )) { |
|
| 33 | + $errorlist .= $lang['fl_limit_planet']; |
|
| 34 | + } |
|
| 35 | + if ($planetrow['galaxy'] == $galaxy && $planetrow['system'] == $system && $planetrow['planet'] == $planet && $planetrow['planet_type'] == $planet_type) { |
|
| 36 | + $errorlist .= $lang['fl_ownpl_err']; |
|
| 37 | + } |
|
| 38 | + if (!$planet_type) { |
|
| 39 | + $errorlist .= $lang['fl_no_planettype']; |
|
| 40 | + } |
|
| 41 | + if ($planet_type != PT_PLANET && $planet_type != PT_DEBRIS && $planet_type != PT_MOON) { |
|
| 42 | + $errorlist .= $lang['fl_fleet_err_pl']; |
|
| 43 | + } |
|
| 38 | 44 | if (empty($missiontype[$target_mission])) { |
| 39 | 45 | $errorlist .= $lang['fl_bad_mission']; |
| 40 | 46 | } |
@@ -61,29 +67,35 @@ discard block |
||
| 61 | 67 | } |
| 62 | 68 | } else { |
| 63 | 69 | if ($TargetPlanet['id_owner']){ |
| 64 | - if ($target_mission == MT_COLONIZE) |
|
| 65 | - $errorlist .= $lang['fl_colonized']; |
|
| 70 | + if ($target_mission == MT_COLONIZE) { |
|
| 71 | + $errorlist .= $lang['fl_colonized']; |
|
| 72 | + } |
|
| 66 | 73 | |
| 67 | 74 | if ($TargetPlanet['id_owner'] == $planetrow['id_owner']){ |
| 68 | - if ($target_mission == MT_ATTACK) |
|
| 69 | - $errorlist .= $lang['fl_no_self_attack']; |
|
| 70 | - |
|
| 71 | - if ($target_mission == MT_SPY) |
|
| 72 | - $errorlist .= $lang['fl_no_self_spy']; |
|
| 73 | - }else{ |
|
| 74 | - if ($target_mission == MT_RELOCATE) |
|
| 75 | - $errorlist .= $lang['fl_only_stay_at_home']; |
|
| 75 | + if ($target_mission == MT_ATTACK) { |
|
| 76 | + $errorlist .= $lang['fl_no_self_attack']; |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + if ($target_mission == MT_SPY) { |
|
| 80 | + $errorlist .= $lang['fl_no_self_spy']; |
|
| 81 | + } |
|
| 82 | + } else{ |
|
| 83 | + if ($target_mission == MT_RELOCATE) { |
|
| 84 | + $errorlist .= $lang['fl_only_stay_at_home']; |
|
| 85 | + } |
|
| 76 | 86 | } |
| 77 | - }else{ |
|
| 87 | + } else{ |
|
| 78 | 88 | if ($target_mission < MT_COLONIZE){ |
| 79 | 89 | $errorlist .= $lang['fl_unknow_target']; |
| 80 | - }else{ |
|
| 81 | - if ($target_mission == MT_DESTROY) |
|
| 82 | - $errorlist .= $lang['fl_nomoon']; |
|
| 90 | + } else{ |
|
| 91 | + if ($target_mission == MT_DESTROY) { |
|
| 92 | + $errorlist .= $lang['fl_nomoon']; |
|
| 93 | + } |
|
| 83 | 94 | |
| 84 | 95 | if ($target_mission == MT_RECYCLE){ |
| 85 | - if($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0) |
|
| 86 | - $errorlist .= $lang['fl_nodebris']; |
|
| 96 | + if($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0) { |
|
| 97 | + $errorlist .= $lang['fl_nodebris']; |
|
| 98 | + } |
|
| 87 | 99 | } |
| 88 | 100 | } |
| 89 | 101 | } |
@@ -131,8 +143,7 @@ discard block |
||
| 131 | 143 | $aks = DbFleetStatic::dbAcsGetById($fleet_group); |
| 132 | 144 | if (!$aks) { |
| 133 | 145 | $fleet_group = 0; |
| 134 | - } |
|
| 135 | - else |
|
| 146 | + } else |
|
| 136 | 147 | { |
| 137 | 148 | $galaxy = $aks['galaxy']; |
| 138 | 149 | $system = $aks['system']; |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | use Planet\DBStaticPlanet; |
| 9 | 9 | use Unit\DBStaticUnit; |
| 10 | 10 | |
| 11 | -if(SN_IN_FLEET !== true) { |
|
| 11 | +if (SN_IN_FLEET !== true) { |
|
| 12 | 12 | $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403); |
| 13 | 13 | } |
| 14 | 14 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $errorlist .= $lang['fl_limit_galaxy']; |
| 28 | 28 | if (!$system || $system > $config->game_maxSystem || $system < 1) |
| 29 | 29 | $errorlist .= $lang['fl_limit_system']; |
| 30 | - if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE )) |
|
| 30 | + if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE)) |
|
| 31 | 31 | $errorlist .= $lang['fl_limit_planet']; |
| 32 | 32 | if ($planetrow['galaxy'] == $galaxy && $planetrow['system'] == $system && $planetrow['planet'] == $planet && $planetrow['planet_type'] == $planet_type) |
| 33 | 33 | $errorlist .= $lang['fl_ownpl_err']; |
@@ -54,35 +54,35 @@ discard block |
||
| 54 | 54 | $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true); |
| 55 | 55 | |
| 56 | 56 | if ($target_mission == MT_EXPLORE) { |
| 57 | - if ($MaxExpeditions == 0 ) { |
|
| 57 | + if ($MaxExpeditions == 0) { |
|
| 58 | 58 | $errorlist .= $lang['fl_expe_notech']; |
| 59 | - } elseif ($FlyingExpeditions >= $MaxExpeditions ) { |
|
| 59 | + } elseif ($FlyingExpeditions >= $MaxExpeditions) { |
|
| 60 | 60 | $errorlist .= $lang['fl_expe_max']; |
| 61 | 61 | } |
| 62 | 62 | } else { |
| 63 | - if ($TargetPlanet['id_owner']){ |
|
| 63 | + if ($TargetPlanet['id_owner']) { |
|
| 64 | 64 | if ($target_mission == MT_COLONIZE) |
| 65 | 65 | $errorlist .= $lang['fl_colonized']; |
| 66 | 66 | |
| 67 | - if ($TargetPlanet['id_owner'] == $planetrow['id_owner']){ |
|
| 67 | + if ($TargetPlanet['id_owner'] == $planetrow['id_owner']) { |
|
| 68 | 68 | if ($target_mission == MT_ATTACK) |
| 69 | 69 | $errorlist .= $lang['fl_no_self_attack']; |
| 70 | 70 | |
| 71 | 71 | if ($target_mission == MT_SPY) |
| 72 | 72 | $errorlist .= $lang['fl_no_self_spy']; |
| 73 | - }else{ |
|
| 73 | + } else { |
|
| 74 | 74 | if ($target_mission == MT_RELOCATE) |
| 75 | 75 | $errorlist .= $lang['fl_only_stay_at_home']; |
| 76 | 76 | } |
| 77 | - }else{ |
|
| 78 | - if ($target_mission < MT_COLONIZE){ |
|
| 77 | + } else { |
|
| 78 | + if ($target_mission < MT_COLONIZE) { |
|
| 79 | 79 | $errorlist .= $lang['fl_unknow_target']; |
| 80 | - }else{ |
|
| 80 | + } else { |
|
| 81 | 81 | if ($target_mission == MT_DESTROY) |
| 82 | 82 | $errorlist .= $lang['fl_nomoon']; |
| 83 | 83 | |
| 84 | - if ($target_mission == MT_RECYCLE){ |
|
| 85 | - if($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0) |
|
| 84 | + if ($target_mission == MT_RECYCLE) { |
|
| 85 | + if ($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0) |
|
| 86 | 86 | $errorlist .= $lang['fl_nodebris']; |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -90,13 +90,13 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| 93 | - if(is_object($captainModule = moduleCaptain()) && $captain_id = sys_get_param_id('captain_id')) { |
|
| 93 | + if (is_object($captainModule = moduleCaptain()) && $captain_id = sys_get_param_id('captain_id')) { |
|
| 94 | 94 | $captain = $captainModule->unit_captain_get($planetrow['id']); |
| 95 | 95 | // mrc_get_level($user, $planetrow, UNIT_CAPTAIN, true); |
| 96 | - if(!$captain) { |
|
| 96 | + if (!$captain) { |
|
| 97 | 97 | $errorlist .= $lang['module_unit_captain_error_no_captain']; |
| 98 | - } elseif($captain['unit_location_type'] == LOC_PLANET) { |
|
| 99 | - if($target_mission == MT_RELOCATE && ($arriving_captain = mrc_get_level($user, $TargetPlanet, UNIT_CAPTAIN, true))) { |
|
| 98 | + } elseif ($captain['unit_location_type'] == LOC_PLANET) { |
|
| 99 | + if ($target_mission == MT_RELOCATE && ($arriving_captain = mrc_get_level($user, $TargetPlanet, UNIT_CAPTAIN, true))) { |
|
| 100 | 100 | $errorlist .= $lang['module_unit_captain_error_captain_already_bound']; |
| 101 | 101 | } |
| 102 | 102 | } else { |
@@ -120,13 +120,13 @@ discard block |
||
| 120 | 120 | $fleet_group = max(0, intval($_POST['fleet_group'])); |
| 121 | 121 | //But is it acs?? |
| 122 | 122 | //Well all acs fleets must have a fleet code. |
| 123 | - if($fleet_group) { |
|
| 123 | + if ($fleet_group) { |
|
| 124 | 124 | //Also it must be mission type 2 |
| 125 | 125 | $target_mission = MT_AKS; |
| 126 | 126 | |
| 127 | 127 | //The co-ords must be the same as where the acs fleet is going. |
| 128 | 128 | $target = "g{$galaxy}s{$system}p{$planet}t{$planet_type}"; |
| 129 | - if($_POST['acs_target_mr'] == $target) { |
|
| 129 | + if ($_POST['acs_target_mr'] == $target) { |
|
| 130 | 130 | //ACS attack must exist (if acs fleet has arrived this will also return false (2 checks in 1!!!) |
| 131 | 131 | $aks = DbFleetStatic::dbAcsGetById($fleet_group); |
| 132 | 132 | if (!$aks) { |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | //Check that a failed acs attack isn't being sent, if it is, make it an attack fleet. |
| 145 | - if(!$fleet_group && $target_mission == MT_AKS) { |
|
| 145 | + if (!$fleet_group && $target_mission == MT_AKS) { |
|
| 146 | 146 | $target_mission = MT_ATTACK; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $options = [P_FLEET_ATTACK_SPEED_PERCENT_TENTH => $speed_percent, P_FLEET_ATTACK_FLEET_GROUP => $fleet_group, P_FLEET_ATTACK_RESOURCES_SUM => $StorageNeeded]; |
| 153 | 153 | $cant_attack = flt_can_attack($planetrow, $TargetPlanet, $fleetarray, $target_mission, $options); |
| 154 | 154 | |
| 155 | - if($cant_attack !== ATTACK_ALLOWED) { |
|
| 155 | + if ($cant_attack !== ATTACK_ALLOWED) { |
|
| 156 | 156 | SnTemplate::messageBox("<span class='error'><b>{$lang['fl_attack_error'][$cant_attack]}</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 99); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -163,11 +163,10 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | $fleet['start_time'] = $duration + SN_TIME_NOW; |
| 165 | 165 | |
| 166 | - $max_duration = $target_mission == MT_EXPLORE ? get_player_max_expedition_duration($user) : |
|
| 167 | - ($target_mission == MT_HOLD ? 12 : 0); |
|
| 168 | - if($max_duration) { |
|
| 166 | + $max_duration = $target_mission == MT_EXPLORE ? get_player_max_expedition_duration($user) : ($target_mission == MT_HOLD ? 12 : 0); |
|
| 167 | + if ($max_duration) { |
|
| 169 | 168 | $StayDuration = sys_get_param_id('missiontime'); |
| 170 | - if($StayDuration > $max_duration || $StayDuration < 1) { |
|
| 169 | + if ($StayDuration > $max_duration || $StayDuration < 1) { |
|
| 171 | 170 | $debug->warning('Supplying wrong mission time', 'Hack attempt', 302, array('base_dump' => true)); |
| 172 | 171 | die(); |
| 173 | 172 | } |
@@ -177,10 +176,10 @@ discard block |
||
| 177 | 176 | $StayDuration = 0; |
| 178 | 177 | $StayTime = 0; |
| 179 | 178 | } |
| 180 | - $fleet['end_time'] = $StayDuration + (2 * $duration) + SN_TIME_NOW; |
|
| 179 | + $fleet['end_time'] = $StayDuration + (2 * $duration) + SN_TIME_NOW; |
|
| 181 | 180 | |
| 182 | - if($aks && $target_mission == MT_AKS) { |
|
| 183 | - if ($fleet['start_time']>$aks['ankunft']) { |
|
| 181 | + if ($aks && $target_mission == MT_AKS) { |
|
| 182 | + if ($fleet['start_time'] > $aks['ankunft']) { |
|
| 184 | 183 | SnTemplate::messageBox($lang['fl_aks_too_slow'] . 'Fleet arrival: ' . date(FMT_DATE_TIME, $fleet['start_time']) . " AKS arrival: " . date(FMT_DATE_TIME, $aks['ankunft']), $lang['fl_error']); |
| 185 | 184 | } |
| 186 | 185 | $fleet['start_time'] = $aks['ankunft']; |
@@ -191,14 +190,14 @@ discard block |
||
| 191 | 190 | $FleetShipCount = 0; |
| 192 | 191 | $db_changeset = array(); |
| 193 | 192 | foreach ($fleetarray as $Ship => $Count) { |
| 194 | - $FleetStorage += get_unit_param($Ship, P_CAPACITY) * $Count; |
|
| 193 | + $FleetStorage += get_unit_param($Ship, P_CAPACITY) * $Count; |
|
| 195 | 194 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($Ship, -$Count, $user, $planetrow['id']); |
| 196 | 195 | } |
| 197 | 196 | $fleet_array = sys_unit_arr2str($fleetarray); |
| 198 | - $FleetShipCount += array_sum($fleetarray); |
|
| 199 | - $FleetStorage -= $consumption; |
|
| 197 | + $FleetShipCount += array_sum($fleetarray); |
|
| 198 | + $FleetStorage -= $consumption; |
|
| 200 | 199 | |
| 201 | - if ( $StorageNeeded > $FleetStorage) { |
|
| 200 | + if ($StorageNeeded > $FleetStorage) { |
|
| 202 | 201 | SnTemplate::messageBox("<span class='error'><b>" . $lang['fl_nostoragespa'] . HelperString::numberFloorAndFormat($StorageNeeded - $FleetStorage) . "</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2); |
| 203 | 202 | } |
| 204 | 203 | if ($planetrow['deuterium'] < $TransDeuterium + $consumption) { |
@@ -247,7 +246,7 @@ discard block |
||
| 247 | 246 | // )); |
| 248 | 247 | // } |
| 249 | 248 | |
| 250 | - if(is_array($captain)) { |
|
| 249 | + if (is_array($captain)) { |
|
| 251 | 250 | DBStaticUnit::db_unit_set_by_id($captain['unit_id'], "`unit_location_type` = " . LOC_FLEET . ", `unit_location_id` = {$fleet_id}"); |
| 252 | 251 | } |
| 253 | 252 | |
@@ -260,7 +259,7 @@ discard block |
||
| 260 | 259 | 'START_LEFT' => floor($fleet['end_time'] + 1 - SN_TIME_NOW), |
| 261 | 260 | ); |
| 262 | 261 | |
| 263 | - if(!empty($TargetPlanet)) { |
|
| 262 | + if (!empty($TargetPlanet)) { |
|
| 264 | 263 | $template_route += array( |
| 265 | 264 | 'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']], |
| 266 | 265 | 'END_COORDS' => uni_render_coordinates($TargetPlanet), |
@@ -273,8 +272,8 @@ discard block |
||
| 273 | 272 | $template->assign_block_vars('fleets', $template_route); |
| 274 | 273 | |
| 275 | 274 | $sn_groups_fleet = sn_get_groups('fleet'); |
| 276 | - foreach($fleetarray as $ship_id => $ship_count) { |
|
| 277 | - if(in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
| 275 | + foreach ($fleetarray as $ship_id => $ship_count) { |
|
| 276 | + if (in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
| 278 | 277 | // $ship_base_data = get_ship_data($ship_id, $user); |
| 279 | 278 | $template->assign_block_vars('fleets.ships', array( |
| 280 | 279 | 'ID' => $ship_id, |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | return $result = ATTACK_ACS_TOO_LATE; |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | - if(DbFleetStatic::acsIsAcsFull($acs['id'])) { |
|
| 367 | + if (DbFleetStatic::acsIsAcsFull($acs['id'])) { |
|
| 368 | 368 | return $result = ATTACK_ACS_MAX_FLEETS; |
| 369 | 369 | } |
| 370 | 370 | } |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | |
| 549 | 549 | |
| 550 | 550 | !is_array($resources) ? $resources = [] : false; |
| 551 | - if(empty($options[P_FLEET_ATTACK_RES_LIST])) { |
|
| 551 | + if (empty($options[P_FLEET_ATTACK_RES_LIST])) { |
|
| 552 | 552 | $options[P_FLEET_ATTACK_RES_LIST] = $resources; |
| 553 | 553 | } |
| 554 | 554 | $can_attack = flt_can_attack($from, $to, $fleet, $mission, $options); |
@@ -361,10 +361,10 @@ |
||
| 361 | 361 | |
| 362 | 362 | |
| 363 | 363 | define('GROUP_PART', 800000); // Зарезервировано для запчастей: 800.001 - 899.999 |
| 364 | - define('GROUP_PART_HULL', 801000); // Корпуса - 1000 штук |
|
| 365 | - define('GROUP_PART_ARMOR', 802000); // Броня - 1000 штук |
|
| 366 | - define('GROUP_PART_SHIELD', 803000); // Щиты - 1000 штук |
|
| 367 | - define('GROUP_PART_WEAPON', 810000); // Оружие - 10000 штук |
|
| 364 | + define('GROUP_PART_HULL', 801000); // Корпуса - 1000 штук |
|
| 365 | + define('GROUP_PART_ARMOR', 802000); // Броня - 1000 штук |
|
| 366 | + define('GROUP_PART_SHIELD', 803000); // Щиты - 1000 штук |
|
| 367 | + define('GROUP_PART_WEAPON', 810000); // Оружие - 10000 штук |
|
| 368 | 368 | |
| 369 | 369 | |
| 370 | 370 | define('UNIT_GROUP', 'groups'); // 900.000 // Зарезервировано для груп юнитов: 900.001 - 999.999 |
@@ -161,10 +161,10 @@ discard block |
||
| 161 | 161 | // === Artifacts |
| 162 | 162 | define('UNIT_ARTIFACTS_STR', 'artifacts'); |
| 163 | 163 | define('UNIT_ARTIFACTS', 1000); |
| 164 | -define('ART_LHC', 1001); // Additional moon chance |
|
| 165 | -define('ART_RCD_SMALL', 1002); // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 - 405 DM |
|
| 166 | -define('ART_RCD_MEDIUM', 1003); // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 - 4704 DM |
|
| 167 | -define('ART_RCD_LARGE', 1004); // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM |
|
| 164 | +define('ART_LHC', 1001); // Additional moon chance |
|
| 165 | +define('ART_RCD_SMALL', 1002); // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 - 405 DM |
|
| 166 | +define('ART_RCD_MEDIUM', 1003); // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 - 4704 DM |
|
| 167 | +define('ART_RCD_LARGE', 1004); // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM |
|
| 168 | 168 | define('ART_HEURISTIC_CHIP', 1005); // Speed up research |
| 169 | 169 | define('ART_NANO_BUILDER', 1006); // Speed up building |
| 170 | 170 | define('ART_NANO_CONSTRUCTOR', 1007); // RESERVED Speed up hangar constructions |
@@ -238,25 +238,25 @@ discard block |
||
| 238 | 238 | define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE1', 2201); // Блиц-сервер, участник 0-го раунда, 1-е место |
| 239 | 239 | define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE2', 2202); // Блиц-сервер, участник 0-го раунда, 2-е место |
| 240 | 240 | define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE3', 2203); // Блиц-сервер, участник 0-го раунда, 3-е место |
| 241 | -define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204); // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года |
|
| 242 | -define('UNIT_AWARD_MEDAL_2017_WOMEN_DAY_BEST', 2205); // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2017 года |
|
| 243 | -define('UNIT_AWARD_MEDAL_2017_WOMEN_DAY_QUEEN', 2206); // Медаль Королевы Весны за максимум полученной ММ/максимум полученных подарков от Мужчины во время ивента 8 марта 2017 года |
|
| 241 | +define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204); // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года |
|
| 242 | +define('UNIT_AWARD_MEDAL_2017_WOMEN_DAY_BEST', 2205); // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2017 года |
|
| 243 | +define('UNIT_AWARD_MEDAL_2017_WOMEN_DAY_QUEEN', 2206); // Медаль Королевы Весны за максимум полученной ММ/максимум полученных подарков от Мужчины во время ивента 8 марта 2017 года |
|
| 244 | 244 | define('UNIT_AWARD_MEDAL_8_MARCH_BEST_CAVALIER_AMOUNT', 2207); // Медаль Лучшему Кавалеру за максимум потраченной ММ Женщине от Мужчины во время ивента 8 марта 2017 года |
| 245 | 245 | define('UNIT_AWARD_MEDAL_8_MARCH_BEST_CAVALIER_COUNT', 2208); // Медаль Лучшему Кавалеру за максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2017 года |
| 246 | 246 | define('UNIT_AWARD_MEDAL_8_MARCH_SPRING_QUEEN_AMOUNT', 2209); // Медаль Королевы Весны за максимум полученной ММ от Мужчины во время ивента 8 марта 2017 года |
| 247 | 247 | define('UNIT_AWARD_MEDAL_8_MARCH_SPRING_QUEEN_COUNT', 2210); // Медаль Королевы Весны за максимум полученных подарков от Мужчины во время ивента 8 марта 2017 года |
| 248 | 248 | |
| 249 | 249 | define('UNIT_AWARD_MEMORY', 2300); // Памятные знаки за существование и участие - например "4 года в игре". "Был онлайн в новогоднюю ночь 2013". итд |
| 250 | -define('UNIT_AWARD_MEMORY_IMMORTAL', 2301); // Бессмертный |
|
| 251 | -define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года |
|
| 250 | +define('UNIT_AWARD_MEMORY_IMMORTAL', 2301); // Бессмертный |
|
| 251 | +define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года |
|
| 252 | 252 | define('UNIT_AWARD_MEMORY_BLITZ_R0', 2303); // Блиц-сервер, участник 0-го раунда |
| 253 | 253 | define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SIMPLE', 2304); // День Рождения СН |
| 254 | 254 | define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_BRONZE', 2305); // День Рождения СН |
| 255 | 255 | define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SILVER', 2306); // День Рождения СН |
| 256 | 256 | define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_GOLD', 2307); // День Рождения СН |
| 257 | 257 | define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_PLATINUM', 2308); // День Рождения СН |
| 258 | -define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года |
|
| 259 | -define('UNIT_AWARD_MEMORY_2017_WOMEN_DAY', 2310); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2017 года |
|
| 258 | +define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года |
|
| 259 | +define('UNIT_AWARD_MEMORY_2017_WOMEN_DAY', 2310); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2017 года |
|
| 260 | 260 | define('UNIT_AWARD_MEMORY_SUPER_BORN_2017_SIMPLE', 2311); // День Рождения СН - 2017 |
| 261 | 261 | define('UNIT_AWARD_MEMORY_SUPER_BORN_2017_BRONZE', 2312); // День Рождения СН - 2017 |
| 262 | 262 | define('UNIT_AWARD_MEMORY_SUPER_BORN_2017_SILVER', 2313); // День Рождения СН - 2017 |
@@ -360,19 +360,19 @@ discard block |
||
| 360 | 360 | const GROUP_UNIT_OBJECTS_IN_SPACE = 790002; |
| 361 | 361 | |
| 362 | 362 | |
| 363 | -define('GROUP_PART', 800000); // Зарезервировано для запчастей: 800.001 - 899.999 |
|
| 364 | - define('GROUP_PART_HULL', 801000); // Корпуса - 1000 штук |
|
| 365 | - define('GROUP_PART_ARMOR', 802000); // Броня - 1000 штук |
|
| 366 | - define('GROUP_PART_SHIELD', 803000); // Щиты - 1000 штук |
|
| 367 | - define('GROUP_PART_WEAPON', 810000); // Оружие - 10000 штук |
|
| 363 | +define('GROUP_PART', 800000); // Зарезервировано для запчастей: 800.001 - 899.999 |
|
| 364 | + define('GROUP_PART_HULL', 801000); // Корпуса - 1000 штук |
|
| 365 | + define('GROUP_PART_ARMOR', 802000); // Броня - 1000 штук |
|
| 366 | + define('GROUP_PART_SHIELD', 803000); // Щиты - 1000 штук |
|
| 367 | + define('GROUP_PART_WEAPON', 810000); // Оружие - 10000 штук |
|
| 368 | 368 | |
| 369 | 369 | |
| 370 | 370 | define('UNIT_GROUP', 'groups'); // 900.000 // Зарезервировано для груп юнитов: 900.001 - 999.999 |
| 371 | -define('GROUP_UNIT_USER', 1000000);// Зарезервировано для пользовательских юнитов: 1.000.001 - 1.999.999 |
|
| 372 | -define('GROUP_ID_RESERVED', 2000000);// Зарезервировано для прочих нужд: 2.000.000 - 1.999.999.999 |
|
| 371 | +define('GROUP_UNIT_USER', 1000000); // Зарезервировано для пользовательских юнитов: 1.000.001 - 1.999.999 |
|
| 372 | +define('GROUP_ID_RESERVED', 2000000); // Зарезервировано для прочих нужд: 2.000.000 - 1.999.999.999 |
|
| 373 | 373 | const UNIT_CAN_NOT_BE_BUILD = 2000001; // Юнит не может быть построен - для спецюнитов |
| 374 | -define('GROUP_PARAMS', 1000000000);// Зарезервировано для параметров: 1.000.000.001 - 1.999.999.999 |
|
| 375 | -define('GROUP_DEVELOPERS', 2000000000);// Пространство для разработчиков: 2.000.000.001 - 2.147.483.647 |
|
| 374 | +define('GROUP_PARAMS', 1000000000); // Зарезервировано для параметров: 1.000.000.001 - 1.999.999.999 |
|
| 375 | +define('GROUP_DEVELOPERS', 2000000000); // Пространство для разработчиков: 2.000.000.001 - 2.147.483.647 |
|
| 376 | 376 | |
| 377 | 377 | define('UNIT_PLAYER_COLONIES_CURRENT', 'COLONIES_CURRENT'); |
| 378 | 378 | define('UNIT_PLAYER_COLONIES_MAX', 'COLONIES_MAX'); |
@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | $constants = get_defined_constants(true); |
| 17 | 17 | $rpgConstants = array(); |
| 18 | -foreach($constants['user'] as $constantName => $constantValue) { |
|
| 19 | - if(substr($constantName, 0, 4) == 'RPG_') { |
|
| 18 | +foreach ($constants['user'] as $constantName => $constantValue) { |
|
| 19 | + if (substr($constantName, 0, 4) == 'RPG_') { |
|
| 20 | 20 | $rpgConstants[$constantValue] = $constantName; |
| 21 | 21 | } |
| 22 | 22 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | GROUP BY log_dark_matter_reason, IF(sign((log_dark_matter_amount)) > 0, 1, -1) ORDER BY sum(log_dark_matter_amount) DESC;" |
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | -while($row = SN::$db->db_fetch($result)) { |
|
| 37 | +while ($row = SN::$db->db_fetch($result)) { |
|
| 38 | 38 | $row['CONSTANT'] = $rpgConstants[$row['REASON']]; |
| 39 | 39 | |
| 40 | 40 | $row['DM_AMOUNT_TEXT'] = HelperString::numberFloorAndFormat($row['DM_AMOUNT']); |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | GROUP BY reason, if(sign((amount)) > 0, 1, -1) ORDER BY sum(amount) DESC;" |
| 58 | 58 | ); |
| 59 | 59 | |
| 60 | -while($row = SN::$db->db_fetch($result)) { |
|
| 61 | - if(empty($spent[$row['BALANCE']])) { |
|
| 60 | +while ($row = SN::$db->db_fetch($result)) { |
|
| 61 | + if (empty($spent[$row['BALANCE']])) { |
|
| 62 | 62 | $spent[$row['BALANCE']] = array(); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -68,16 +68,15 @@ discard block |
||
| 68 | 68 | $spent[$row['BALANCE']] = array_merge_recursive_numeric($spent[$row['BALANCE']], $row); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | -foreach($spent as &$row) { |
|
| 71 | +foreach ($spent as &$row) { |
|
| 72 | 72 | @$row['TOTAL_COUNT'] = $row['MM_COUNT'] + $row['DM_COUNT']; |
| 73 | 73 | @$row['TOTAL_AMOUNT'] = $row['MM_AMOUNT'] + $row['DM_AMOUNT']; |
| 74 | 74 | @$row['TOTAL_AMOUNT_TEXT'] = HelperString::numberFloorAndFormat($row['TOTAL_AMOUNT']); |
| 75 | 75 | @$row['TOTAL_COUNT_TEXT'] = HelperString::numberFloorAndFormat($row['TOTAL_COUNT']); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | -usort($spent, function ($a, $b) { |
|
| 79 | - return $a['TOTAL_AMOUNT'] < $b['TOTAL_AMOUNT'] ? -1 : |
|
| 80 | - ($a['TOTAL_AMOUNT'] > $b['TOTAL_AMOUNT'] ? 1 : 0); |
|
| 78 | +usort($spent, function($a, $b) { |
|
| 79 | + return $a['TOTAL_AMOUNT'] < $b['TOTAL_AMOUNT'] ? -1 : ($a['TOTAL_AMOUNT'] > $b['TOTAL_AMOUNT'] ? 1 : 0); |
|
| 81 | 80 | }); |
| 82 | 81 | |
| 83 | 82 | |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | $length = 0; |
| 74 | 74 | } else { |
| 75 | 75 | $spendOnThisHour = $leftOfThisHour; |
| 76 | - $length -= $leftOfThisHour; |
|
| 76 | + $length -= $leftOfThisHour; |
|
| 77 | 77 | } |
| 78 | 78 | $perHour[$hourStart] += $spendOnThisHour; |
| 79 | 79 | |