@@ -16,23 +16,23 @@ discard block |
||
16 | 16 | $sn_menu_admin_extra = array(); |
17 | 17 | |
18 | 18 | $sn_mvc = array( |
19 | - 'model' => array( |
|
20 | - 'options' => array('sn_options_model'), |
|
21 | - 'chat' => array('sn_chat_model'), |
|
22 | - 'chat_add' => array('sn_chat_add_model'), |
|
23 | - ), |
|
24 | - 'view' => array( |
|
25 | - 'options' => array('sn_options_view'), |
|
26 | - 'chat' => array('sn_chat_view'), |
|
27 | - 'chat_msg' => array('sn_chat_msg_view'), |
|
28 | - ), |
|
29 | - 'controller' => array(), |
|
30 | - 'i18n' => array( |
|
31 | - 'options' => array( |
|
32 | - 'options' => 'options', |
|
33 | - 'messages' => 'messages', |
|
34 | - ), |
|
35 | - ), |
|
19 | + 'model' => array( |
|
20 | + 'options' => array('sn_options_model'), |
|
21 | + 'chat' => array('sn_chat_model'), |
|
22 | + 'chat_add' => array('sn_chat_add_model'), |
|
23 | + ), |
|
24 | + 'view' => array( |
|
25 | + 'options' => array('sn_options_view'), |
|
26 | + 'chat' => array('sn_chat_view'), |
|
27 | + 'chat_msg' => array('sn_chat_msg_view'), |
|
28 | + ), |
|
29 | + 'controller' => array(), |
|
30 | + 'i18n' => array( |
|
31 | + 'options' => array( |
|
32 | + 'options' => 'options', |
|
33 | + 'messages' => 'messages', |
|
34 | + ), |
|
35 | + ), |
|
36 | 36 | ); |
37 | 37 | |
38 | 38 | $note_priority_classes = array( |
@@ -120,62 +120,62 @@ discard block |
||
120 | 120 | ); |
121 | 121 | |
122 | 122 | $sn_message_class_list = array( |
123 | - MSG_TYPE_NEW => array( |
|
124 | - 'name' => 'new_message', |
|
125 | - 'switchable' => false, |
|
126 | - 'email' => false, |
|
127 | - ), |
|
128 | - MSG_TYPE_ADMIN => array( |
|
129 | - 'name' => 'msg_admin', |
|
130 | - 'switchable' => false, |
|
131 | - 'email' => true, |
|
132 | - ), |
|
133 | - MSG_TYPE_PLAYER => array( |
|
134 | - 'name' => 'mnl_joueur', |
|
135 | - 'switchable' => false, |
|
136 | - 'email' => true, |
|
137 | - ), |
|
138 | - MSG_TYPE_ALLIANCE => array( |
|
139 | - 'name' => 'mnl_alliance', |
|
140 | - 'switchable' => false, |
|
141 | - 'email' => true, |
|
142 | - ), |
|
143 | - MSG_TYPE_SPY => array( |
|
144 | - 'name' => 'mnl_spy', |
|
145 | - 'switchable' => true, |
|
146 | - 'email' => true, |
|
147 | - ), |
|
148 | - MSG_TYPE_COMBAT => array( |
|
149 | - 'name' => 'mnl_attaque', |
|
150 | - 'switchable' => true, |
|
151 | - 'email' => true, |
|
152 | - ), |
|
153 | - MSG_TYPE_TRANSPORT => array( |
|
154 | - 'name' => 'mnl_transport', |
|
155 | - 'switchable' => true, |
|
156 | - 'email' => true, |
|
157 | - ), |
|
158 | - MSG_TYPE_RECYCLE => array( |
|
159 | - 'name' => 'mnl_exploit', |
|
160 | - 'switchable' => true, |
|
161 | - 'email' => true, |
|
162 | - ), |
|
163 | - MSG_TYPE_EXPLORE => array( |
|
164 | - 'name' => 'mnl_expedition', |
|
165 | - 'switchable' => true, |
|
166 | - 'email' => true, |
|
167 | - ), |
|
168 | - // 97 => 'mnl_general', |
|
169 | - MSG_TYPE_QUE => array( |
|
170 | - 'name' => 'mnl_buildlist', |
|
171 | - 'switchable' => true, |
|
172 | - 'email' => true, |
|
173 | - ), |
|
174 | - MSG_TYPE_OUTBOX => array( |
|
175 | - 'name' => 'mnl_outbox', |
|
176 | - 'switchable' => false, |
|
177 | - 'email' => false, |
|
178 | - ), |
|
123 | + MSG_TYPE_NEW => array( |
|
124 | + 'name' => 'new_message', |
|
125 | + 'switchable' => false, |
|
126 | + 'email' => false, |
|
127 | + ), |
|
128 | + MSG_TYPE_ADMIN => array( |
|
129 | + 'name' => 'msg_admin', |
|
130 | + 'switchable' => false, |
|
131 | + 'email' => true, |
|
132 | + ), |
|
133 | + MSG_TYPE_PLAYER => array( |
|
134 | + 'name' => 'mnl_joueur', |
|
135 | + 'switchable' => false, |
|
136 | + 'email' => true, |
|
137 | + ), |
|
138 | + MSG_TYPE_ALLIANCE => array( |
|
139 | + 'name' => 'mnl_alliance', |
|
140 | + 'switchable' => false, |
|
141 | + 'email' => true, |
|
142 | + ), |
|
143 | + MSG_TYPE_SPY => array( |
|
144 | + 'name' => 'mnl_spy', |
|
145 | + 'switchable' => true, |
|
146 | + 'email' => true, |
|
147 | + ), |
|
148 | + MSG_TYPE_COMBAT => array( |
|
149 | + 'name' => 'mnl_attaque', |
|
150 | + 'switchable' => true, |
|
151 | + 'email' => true, |
|
152 | + ), |
|
153 | + MSG_TYPE_TRANSPORT => array( |
|
154 | + 'name' => 'mnl_transport', |
|
155 | + 'switchable' => true, |
|
156 | + 'email' => true, |
|
157 | + ), |
|
158 | + MSG_TYPE_RECYCLE => array( |
|
159 | + 'name' => 'mnl_exploit', |
|
160 | + 'switchable' => true, |
|
161 | + 'email' => true, |
|
162 | + ), |
|
163 | + MSG_TYPE_EXPLORE => array( |
|
164 | + 'name' => 'mnl_expedition', |
|
165 | + 'switchable' => true, |
|
166 | + 'email' => true, |
|
167 | + ), |
|
168 | + // 97 => 'mnl_general', |
|
169 | + MSG_TYPE_QUE => array( |
|
170 | + 'name' => 'mnl_buildlist', |
|
171 | + 'switchable' => true, |
|
172 | + 'email' => true, |
|
173 | + ), |
|
174 | + MSG_TYPE_OUTBOX => array( |
|
175 | + 'name' => 'mnl_outbox', |
|
176 | + 'switchable' => false, |
|
177 | + 'email' => false, |
|
178 | + ), |
|
179 | 179 | ); |
180 | 180 | |
181 | 181 | $sn_message_groups = array( |
@@ -1027,7 +1027,7 @@ discard block |
||
1027 | 1027 | SHIP_HUGE_DEATH_STAR => SHIP_HUGE_DEATH_STAR, SHIP_HUGE_SUPERNOVA => SHIP_HUGE_SUPERNOVA, |
1028 | 1028 | SHIP_CARGO_SMALL => SHIP_CARGO_SMALL, SHIP_CARGO_BIG => SHIP_CARGO_BIG, SHIP_CARGO_SUPER => SHIP_CARGO_SUPER, SHIP_CARGO_HYPER => SHIP_CARGO_HYPER, |
1029 | 1029 | SHIP_RECYCLER => SHIP_RECYCLER, SHIP_COLONIZER => SHIP_COLONIZER, SHIP_SPY => SHIP_SPY, SHIP_SATTELITE_SOLAR => SHIP_SATTELITE_SOLAR |
1030 | - ), |
|
1030 | + ), |
|
1031 | 1031 | // Defensive building list |
1032 | 1032 | 'defense' => array (UNIT_DEF_TURRET_MISSILE => UNIT_DEF_TURRET_MISSILE, UNIT_DEF_TURRET_LASER_SMALL => UNIT_DEF_TURRET_LASER_SMALL, |
1033 | 1033 | UNIT_DEF_TURRET_LASER_BIG => UNIT_DEF_TURRET_LASER_BIG, UNIT_DEF_TURRET_GAUSS => UNIT_DEF_TURRET_GAUSS, |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | SNC_VER_ERROR_MISSMATCH_KEY_ID => 'error', |
98 | 98 | ); |
99 | 99 | |
100 | -$tableList = array( 'aks', 'alliance', 'alliance_requests', 'announce', 'annonce', 'banned', 'buddy', 'chat', 'config', 'counter', |
|
100 | +$tableList = array('aks', 'alliance', 'alliance_requests', 'announce', 'annonce', 'banned', 'buddy', 'chat', 'config', 'counter', |
|
101 | 101 | 'errors', 'fleets', 'fleet_log', 'galaxy', 'iraks', 'logs', 'log_dark_matter', 'messages', 'notes', 'planets', 'quest', |
102 | 102 | 'quest_status', 'referrals', 'rw', 'statpoints', 'users' |
103 | 103 | ); |
@@ -188,14 +188,14 @@ discard block |
||
188 | 188 | $user_option_list = array(); |
189 | 189 | |
190 | 190 | $user_option_list[OPT_MESSAGE] = array(); |
191 | -foreach($sn_message_class_list as $message_class_id => $message_class_data) |
|
191 | +foreach ($sn_message_class_list as $message_class_id => $message_class_data) |
|
192 | 192 | { |
193 | - if($message_class_data['switchable']) |
|
193 | + if ($message_class_data['switchable']) |
|
194 | 194 | { |
195 | 195 | $user_option_list[OPT_MESSAGE]["opt_{$message_class_data['name']}"] = 1; |
196 | 196 | } |
197 | 197 | |
198 | - if($message_class_data['email']) |
|
198 | + if ($message_class_data['email']) |
|
199 | 199 | { |
200 | 200 | $user_option_list[OPT_MESSAGE]["opt_email_{$message_class_data['name']}"] = 0; |
201 | 201 | } |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_ICE_HYDROGEN, |
779 | 779 | UNIT_PLANET_DENSITY_RARITY => 30, // 1, // 40.00, // * 1/121 0,82645 |
780 | 780 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_PERFECT, |
781 | - UNIT_RESOURCES => array(RES_METAL => 0.20, RES_CRYSTAL => 0.60, RES_DEUTERIUM => 7.10, ), |
|
781 | + UNIT_RESOURCES => array(RES_METAL => 0.20, RES_CRYSTAL => 0.60, RES_DEUTERIUM => 7.10,), |
|
782 | 782 | UNIT_PLANET_DENSITY_MAX_SECTORS => 150, |
783 | 783 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11, |
784 | 784 | ), |
@@ -787,7 +787,7 @@ discard block |
||
787 | 787 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_ICE_METHANE, |
788 | 788 | UNIT_PLANET_DENSITY_RARITY => 130, // 6, // 6.67, // * 6,0 4,95868 |
789 | 789 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_GOOD, |
790 | - UNIT_RESOURCES => array(RES_METAL => 0.55, RES_CRYSTAL => 0.85, RES_DEUTERIUM => 4.60, ), |
|
790 | + UNIT_RESOURCES => array(RES_METAL => 0.55, RES_CRYSTAL => 0.85, RES_DEUTERIUM => 4.60,), |
|
791 | 791 | UNIT_PLANET_DENSITY_MAX_SECTORS => 200, |
792 | 792 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6, |
793 | 793 | ), |
@@ -796,7 +796,7 @@ discard block |
||
796 | 796 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_ICE_WATER, |
797 | 797 | UNIT_PLANET_DENSITY_RARITY => 450, //20, // 2.00, // * 20,0 16,52893 |
798 | 798 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_AVERAGE, |
799 | - UNIT_RESOURCES => array(RES_METAL => 0.86, RES_CRYSTAL => 0.95, RES_DEUTERIUM => 2.20, ), |
|
799 | + UNIT_RESOURCES => array(RES_METAL => 0.86, RES_CRYSTAL => 0.95, RES_DEUTERIUM => 2.20,), |
|
800 | 800 | UNIT_PLANET_DENSITY_MAX_SECTORS => 999, |
801 | 801 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0, |
802 | 802 | ), |
@@ -806,7 +806,7 @@ discard block |
||
806 | 806 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_CRYSTAL_RAW, |
807 | 807 | UNIT_PLANET_DENSITY_RARITY => 20, // 1, // 40.00, // *1,0 0,82645 |
808 | 808 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_PERFECT, |
809 | - UNIT_RESOURCES => array(RES_METAL => 0.40, RES_CRYSTAL => 12.37, RES_DEUTERIUM => 0.50, ), |
|
809 | + UNIT_RESOURCES => array(RES_METAL => 0.40, RES_CRYSTAL => 12.37, RES_DEUTERIUM => 0.50,), |
|
810 | 810 | UNIT_PLANET_DENSITY_MAX_SECTORS => 150, |
811 | 811 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11, |
812 | 812 | ), |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_CRYSTAL_SILICATE, |
816 | 816 | UNIT_PLANET_DENSITY_RARITY => 140, // 5.71, // * 7,0 5,78512 |
817 | 817 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_GOOD, |
818 | - UNIT_RESOURCES => array(RES_METAL => 0.67, RES_CRYSTAL => 4.50, RES_DEUTERIUM => 0.85, ), |
|
818 | + UNIT_RESOURCES => array(RES_METAL => 0.67, RES_CRYSTAL => 4.50, RES_DEUTERIUM => 0.85,), |
|
819 | 819 | UNIT_PLANET_DENSITY_MAX_SECTORS => 200, |
820 | 820 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6, |
821 | 821 | ), |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_CRYSTAL_STONE, |
825 | 825 | UNIT_PLANET_DENSITY_RARITY => 500, // 1.90, // * 21,0 17,35537 |
826 | 826 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_AVERAGE, |
827 | - UNIT_RESOURCES => array(RES_METAL => 0.80, RES_CRYSTAL => 2.00, RES_DEUTERIUM => 0.95, ), |
|
827 | + UNIT_RESOURCES => array(RES_METAL => 0.80, RES_CRYSTAL => 2.00, RES_DEUTERIUM => 0.95,), |
|
828 | 828 | UNIT_PLANET_DENSITY_MAX_SECTORS => 999, |
829 | 829 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0, |
830 | 830 | ), |
@@ -834,7 +834,7 @@ discard block |
||
834 | 834 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_STANDARD, |
835 | 835 | UNIT_PLANET_DENSITY_RARITY => 1000, // 1.0, // * 40,0 33,05785 |
836 | 836 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_NORMAL, |
837 | - UNIT_RESOURCES => array(RES_METAL => 1.00, RES_CRYSTAL => 1.00, RES_DEUTERIUM => 1.00, ), |
|
837 | + UNIT_RESOURCES => array(RES_METAL => 1.00, RES_CRYSTAL => 1.00, RES_DEUTERIUM => 1.00,), |
|
838 | 838 | UNIT_PLANET_DENSITY_MAX_SECTORS => 999, |
839 | 839 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0, |
840 | 840 | ), |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_METAL_ORE, |
845 | 845 | UNIT_PLANET_DENSITY_RARITY => 550, // 2.11, // * 19,0 15,70248 |
846 | 846 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_AVERAGE, |
847 | - UNIT_RESOURCES => array(RES_METAL => 1.60, RES_CRYSTAL => 0.90, RES_DEUTERIUM => 0.80, ), |
|
847 | + UNIT_RESOURCES => array(RES_METAL => 1.60, RES_CRYSTAL => 0.90, RES_DEUTERIUM => 0.80,), |
|
848 | 848 | UNIT_PLANET_DENSITY_MAX_SECTORS => 999, |
849 | 849 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0, |
850 | 850 | ), |
@@ -853,7 +853,7 @@ discard block |
||
853 | 853 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_METAL_PERIDOT, |
854 | 854 | UNIT_PLANET_DENSITY_RARITY => 120, // 8.00, // * 5,0 4,13223 |
855 | 855 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_GOOD, |
856 | - UNIT_RESOURCES => array(RES_METAL => 4.71, RES_CRYSTAL => 0.80, RES_DEUTERIUM => 0.55, ), |
|
856 | + UNIT_RESOURCES => array(RES_METAL => 4.71, RES_CRYSTAL => 0.80, RES_DEUTERIUM => 0.55,), |
|
857 | 857 | UNIT_PLANET_DENSITY_MAX_SECTORS => 200, |
858 | 858 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6, |
859 | 859 | ), |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_METAL_RAW, |
863 | 863 | UNIT_PLANET_DENSITY_RARITY => 25, // 40.00, // * 1,0 0,82645 |
864 | 864 | UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_PERFECT, |
865 | - UNIT_RESOURCES => array(RES_METAL => 8.00, RES_CRYSTAL => 0.40, RES_DEUTERIUM => 0.25, ), |
|
865 | + UNIT_RESOURCES => array(RES_METAL => 8.00, RES_CRYSTAL => 0.40, RES_DEUTERIUM => 0.25,), |
|
866 | 866 | UNIT_PLANET_DENSITY_MAX_SECTORS => 150, |
867 | 867 | UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11, |
868 | 868 | ), |
@@ -992,7 +992,7 @@ discard block |
||
992 | 992 | ), |
993 | 993 | |
994 | 994 | // Tech list |
995 | - 'tech' => array ( |
|
995 | + 'tech' => array( |
|
996 | 996 | TECH_ARMOR => TECH_ARMOR, TECH_WEAPON => TECH_WEAPON, TECH_SHIELD => TECH_SHIELD, |
997 | 997 | TECH_SPY => TECH_SPY, TECH_COMPUTER => TECH_COMPUTER, |
998 | 998 | TECH_ENERGY => TECH_ENERGY, TECH_LASER => TECH_LASER, TECH_ION => TECH_ION, TECH_PLASMA => TECH_PLASMA, TECH_HYPERSPACE => TECH_HYPERSPACE, |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | ), |
1004 | 1004 | |
1005 | 1005 | // Mercenaries |
1006 | - 'mercenaries' => array ( |
|
1006 | + 'mercenaries' => array( |
|
1007 | 1007 | MRC_STOCKMAN => MRC_STOCKMAN, MRC_SPY => MRC_SPY, MRC_ACADEMIC => MRC_ACADEMIC, |
1008 | 1008 | MRC_ADMIRAL => MRC_ADMIRAL, MRC_COORDINATOR => MRC_COORDINATOR, MRC_NAVIGATOR => MRC_NAVIGATOR, |
1009 | 1009 | ), |
@@ -1029,7 +1029,7 @@ discard block |
||
1029 | 1029 | SHIP_RECYCLER => SHIP_RECYCLER, SHIP_COLONIZER => SHIP_COLONIZER, SHIP_SPY => SHIP_SPY, SHIP_SATTELITE_SOLAR => SHIP_SATTELITE_SOLAR |
1030 | 1030 | ), |
1031 | 1031 | // Defensive building list |
1032 | - 'defense' => array (UNIT_DEF_TURRET_MISSILE => UNIT_DEF_TURRET_MISSILE, UNIT_DEF_TURRET_LASER_SMALL => UNIT_DEF_TURRET_LASER_SMALL, |
|
1032 | + 'defense' => array(UNIT_DEF_TURRET_MISSILE => UNIT_DEF_TURRET_MISSILE, UNIT_DEF_TURRET_LASER_SMALL => UNIT_DEF_TURRET_LASER_SMALL, |
|
1033 | 1033 | UNIT_DEF_TURRET_LASER_BIG => UNIT_DEF_TURRET_LASER_BIG, UNIT_DEF_TURRET_GAUSS => UNIT_DEF_TURRET_GAUSS, |
1034 | 1034 | UNIT_DEF_TURRET_ION => UNIT_DEF_TURRET_ION, UNIT_DEF_TURRET_PLASMA => UNIT_DEF_TURRET_PLASMA, |
1035 | 1035 | |
@@ -1039,7 +1039,7 @@ discard block |
||
1039 | 1039 | ), |
1040 | 1040 | |
1041 | 1041 | // Missiles list |
1042 | - 'missile' => array (UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET, ), |
|
1042 | + 'missile' => array(UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET,), |
|
1043 | 1043 | |
1044 | 1044 | // Combat units list |
1045 | 1045 | 'combat' => array( |
@@ -1079,9 +1079,9 @@ discard block |
||
1079 | 1079 | ), |
1080 | 1080 | |
1081 | 1081 | // Resource list |
1082 | - 'resources' => array ( 0 => 'metal', 1 => 'crystal', 2 => 'deuterium', 3 => 'dark_matter'), |
|
1082 | + 'resources' => array(0 => 'metal', 1 => 'crystal', 2 => 'deuterium', 3 => 'dark_matter'), |
|
1083 | 1083 | // Resources all |
1084 | - 'resources_all' => array(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, ), |
|
1084 | + 'resources_all' => array(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,), |
|
1085 | 1085 | // Resources can be produced on planet |
1086 | 1086 | 'resources_planet' => array(RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_ENERGY => RES_ENERGY), |
1087 | 1087 | // Resources can be looted from planet |
@@ -1100,13 +1100,13 @@ discard block |
||
1100 | 1100 | ), |
1101 | 1101 | |
1102 | 1102 | // Resources that can be tradeable in market trader AND be a quest_rewards |
1103 | - 'quest_rewards' => array(RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_DARK_MATTER => RES_DARK_MATTER, ), |
|
1103 | + 'quest_rewards' => array(RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_DARK_MATTER => RES_DARK_MATTER,), |
|
1104 | 1104 | |
1105 | 1105 | // // Ques list |
1106 | 1106 | // 'ques' => array(QUE_STRUCTURES, QUE_HANGAR, QUE_RESEARCH), |
1107 | 1107 | |
1108 | - 'STAT_COMMON' => array(STAT_TOTAL => STAT_TOTAL, STAT_FLEET => STAT_FLEET, STAT_TECH => STAT_TECH, STAT_BUILDING => STAT_BUILDING, STAT_DEFENSE => STAT_DEFENSE, STAT_RESOURCE => STAT_RESOURCE, ), |
|
1109 | - 'STAT_PLAYER' => array(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, ), |
|
1108 | + 'STAT_COMMON' => array(STAT_TOTAL => STAT_TOTAL, STAT_FLEET => STAT_FLEET, STAT_TECH => STAT_TECH, STAT_BUILDING => STAT_BUILDING, STAT_DEFENSE => STAT_DEFENSE, STAT_RESOURCE => STAT_RESOURCE,), |
|
1109 | + 'STAT_PLAYER' => array(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,), |
|
1110 | 1110 | ), |
1111 | 1111 | |
1112 | 1112 | 'pages' => array( |
@@ -26,7 +26,7 @@ |
||
26 | 26 | 'GROUP BY `unit_snid`' |
27 | 27 | ); |
28 | 28 | $result = array(); |
29 | - while($row = db_fetch($query)) { |
|
29 | + while ($row = db_fetch($query)) { |
|
30 | 30 | $result[$row['unit_snid']] = $row; |
31 | 31 | } |
32 | 32 |
@@ -75,6 +75,9 @@ |
||
75 | 75 | return classSupernova::db_ins_record(LOC_UNIT, $set); |
76 | 76 | } |
77 | 77 | |
78 | +/** |
|
79 | + * @param integer $unit_location_type |
|
80 | + */ |
|
78 | 81 | function db_unit_list_delete($user_id = 0, $unit_location_type, $unit_location_id, $unit_snid = 0) |
79 | 82 | { |
80 | 83 | return classSupernova::db_del_record_list(LOC_UNIT, |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: Gorlum |
|
5 | - * Date: 13.04.2015 |
|
6 | - * Time: 6:27 |
|
7 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: Gorlum |
|
5 | + * Date: 13.04.2015 |
|
6 | + * Time: 6:27 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | function db_account_by_user_id($user_id_safe, &$result = null) { |
10 | 10 | die('db_account_by_user_id() должна быть реализована в класса core_auth!'); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
3 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
4 | 4 | { |
5 | 5 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
6 | 6 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $new_rank_name = sys_get_param_str('newRankName'); |
15 | 15 | if ($new_rank_name) |
16 | 16 | { |
17 | - foreach($ally_rights as $fieldName) |
|
17 | + foreach ($ally_rights as $fieldName) |
|
18 | 18 | { |
19 | 19 | $newRank[$fieldName] = 0; |
20 | 20 | } |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | { |
29 | 29 | unset($ranks); |
30 | 30 | |
31 | - foreach($rankListInput as $rankID => $rank) |
|
31 | + foreach ($rankListInput as $rankID => $rank) |
|
32 | 32 | { |
33 | - foreach($ally_rights as $rightName) |
|
33 | + foreach ($ally_rights as $rightName) |
|
34 | 34 | { |
35 | 35 | $ranks[$rankID][$rightName] = $rank[$rightName] ? 1 : 0; |
36 | 36 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $d = sys_get_param_int('d'); |
42 | 42 | if ($d && isset($ranks[$d])) |
43 | 43 | { |
44 | - if(count($ranks) == 1) |
|
44 | + if (count($ranks) == 1) |
|
45 | 45 | { |
46 | 46 | message($lang['ali_adm_lastRank'], $lang['ali_adm_rights_title']); |
47 | 47 | } |
@@ -53,16 +53,16 @@ discard block |
||
53 | 53 | |
54 | 54 | if (count($ranks)) |
55 | 55 | { |
56 | - foreach($ranks as $rankID => $rank) |
|
56 | + foreach ($ranks as $rankID => $rank) |
|
57 | 57 | { |
58 | 58 | $rank_data = array( |
59 | 59 | 'ID' => $rankID, |
60 | 60 | 'NAME' => $rank['name'], |
61 | 61 | ); |
62 | 62 | |
63 | - for($i = 1; $i < count($rank); $i++) |
|
63 | + for ($i = 1; $i < count($rank); $i++) |
|
64 | 64 | { |
65 | - $rank_data['R' . $i] = (($rank[$ally_rights[$i]] == 1) ? ' checked' : '') ; |
|
65 | + $rank_data['R' . $i] = (($rank[$ally_rights[$i]] == 1) ? ' checked' : ''); |
|
66 | 66 | $rank_data['N' . $i] = $ally_rights[$i]; |
67 | 67 | } |
68 | 68 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
3 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
4 | 4 | { |
5 | 5 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
6 | 6 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | header('Location: alliance.php'); |
21 | 21 | } |
22 | 22 | |
23 | - if($user_request['request_denied']) |
|
23 | + if ($user_request['request_denied']) |
|
24 | 24 | { |
25 | 25 | $lang['request_text'] = sprintf($lang['ali_req_deny_msg'], $ally['ally_tag'], $user_request['request_text']); |
26 | 26 | } |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | |
43 | 43 | $ally = doquery("SELECT * FROM {{alliance}} WHERE `id` ='{$id_ally}'", true); |
44 | 44 | |
45 | -if(!$ally) |
|
45 | +if (!$ally) |
|
46 | 46 | { |
47 | 47 | message($lang['ali_sys_notFound'], $lang['ali_req_title']); |
48 | 48 | } |
49 | 49 | |
50 | -if($ally['ally_request_notallow']) |
|
50 | +if ($ally['ally_request_notallow']) |
|
51 | 51 | { |
52 | 52 | message($lang['ali_req_not_allowed'], $lang['ali_req_title']); |
53 | 53 | } |
@@ -115,8 +115,7 @@ |
||
115 | 115 | )); |
116 | 116 | |
117 | 117 | display($template, $lang['tech'][STRUC_MOON_GATE]); |
118 | - } |
|
119 | - else |
|
118 | + } else |
|
120 | 119 | { |
121 | 120 | message($lang['gate_no_src_ga'], $lang['tech'][STRUC_MOON_GATE], "overview.php", 10); |
122 | 121 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) { |
|
3 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) { |
|
4 | 4 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
5 | 5 | } |
6 | 6 | |
@@ -9,12 +9,12 @@ discard block |
||
9 | 9 | } |
10 | 10 | |
11 | 11 | $d = sys_get_param_id('d'); |
12 | -if($d) { |
|
12 | +if ($d) { |
|
13 | 13 | doquery("UPDATE {{alliance_requests}} SET `request_denied` = 1, `request_text` = '{$lang['ali_req_deny_reason']}' WHERE `id_user`= {$d} LIMIT 1;"); |
14 | 14 | } |
15 | 15 | |
16 | 16 | $id_user = sys_get_param_id('id_user'); |
17 | -if($id_user) { |
|
17 | +if ($id_user) { |
|
18 | 18 | $ally_name_safe = db_escape($ally['ally_name']); |
19 | 19 | $ally_tag_safe = db_escape($ally['ally_tag']); |
20 | 20 | db_user_set_by_id($id_user, "`ally_id` = '{$ally['id']}', `ally_name` = '{$ally_name_safe}', `ally_tag` = '{$ally_tag_safe}', `ally_register_time` = " . SN_TIME_NOW . ", `ally_rank_id` = 0"); |
@@ -46,8 +46,7 @@ |
||
46 | 46 | sn_db_transaction_commit(); |
47 | 47 | sys_redirect("galaxy.php?mode=name&galaxy={$uni_galaxy}&system={$uni_system}"); |
48 | 48 | } |
49 | - } |
|
50 | - catch (exception $e) |
|
49 | + } catch (exception $e) |
|
51 | 50 | { |
52 | 51 | sn_db_transaction_rollback(); |
53 | 52 | $template->assign_block_vars('result', array( |
@@ -9,12 +9,12 @@ discard block |
||
9 | 9 | $uni_galaxy = sys_get_param_int('galaxy', $planetrow['galaxy']); |
10 | 10 | $uni_system = sys_get_param_int('system'); |
11 | 11 | |
12 | - if($uni_galaxy < 1 || $uni_galaxy > classSupernova::$config->game_maxGalaxy) |
|
12 | + if ($uni_galaxy < 1 || $uni_galaxy > classSupernova::$config->game_maxGalaxy) |
|
13 | 13 | { |
14 | 14 | throw new exception(classLocale::$lang['uni_msg_error_wrong_galaxy'], ERR_ERROR); |
15 | 15 | } |
16 | 16 | |
17 | - if($uni_system < 0 || $uni_system > classSupernova::$config->game_maxSystem) |
|
17 | + if ($uni_system < 0 || $uni_system > classSupernova::$config->game_maxSystem) |
|
18 | 18 | { |
19 | 19 | throw new exception(classLocale::$lang['uni_msg_error_wrong_system'], ERR_ERROR); |
20 | 20 | } |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | $uni_row['universe_price'] += $uni_system ? classSupernova::$config->uni_price_system : classSupernova::$config->uni_price_galaxy; |
24 | 24 | $uni_row['universe_name'] = strip_tags($uni_row['universe_name'] ? $uni_row['universe_name'] : ($uni_system ? "{$classLocale['sys_system']} [{$uni_galaxy}:{$uni_system}]" : "{$classLocale['sys_galaxy']} {$uni_galaxy}")); |
25 | 25 | |
26 | - if(sys_get_param_str('uni_name_submit')) |
|
26 | + if (sys_get_param_str('uni_name_submit')) |
|
27 | 27 | { |
28 | 28 | $uni_row['universe_name'] = strip_tags(sys_get_param_str('uni_name')); |
29 | 29 | |
30 | 30 | $uni_price = sys_get_param_float('uni_price'); |
31 | - if($uni_price < $uni_row['universe_price']) |
|
31 | + if ($uni_price < $uni_row['universe_price']) |
|
32 | 32 | { |
33 | 33 | throw new exception(classLocale::$lang['uni_msg_error_low_price'], ERR_ERROR); |
34 | 34 | } |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | sn_db_transaction_start(); |
38 | 38 | $user = db_user_by_id($user['id'], true); |
39 | 39 | // if($user[get_unit_param(RES_DARK_MATTER, P_NAME)] < $uni_price) |
40 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
40 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
41 | 41 | { |
42 | 42 | throw new exception(classLocale::$lang['uni_msg_error_no_dm'], ERR_ERROR); |
43 | 43 | } |
44 | 44 | |
45 | - if(!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name'))) |
|
45 | + if (!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name'))) |
|
46 | 46 | { |
47 | 47 | throw new exception(classLocale::$lang['sys_msg_err_update_dm'], ERR_ERROR); |
48 | 48 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * |
13 | 13 | **/ |
14 | 14 | |
15 | -if(SN_IN_FLEET !== true) { |
|
15 | +if (SN_IN_FLEET !== true) { |
|
16 | 16 | $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403); |
17 | 17 | } |
18 | 18 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | $planet_list = array(); |
27 | 27 | |
28 | - if(is_array($resources_taken)) |
|
28 | + if (is_array($resources_taken)) |
|
29 | 29 | { |
30 | 30 | $query = implode(',', array_keys($resources_taken)); |
31 | 31 | $query = " AND `destruyed` = 0 AND `id` IN ({$query})"; |
@@ -33,16 +33,16 @@ discard block |
||
33 | 33 | $query = ''; |
34 | 34 | } |
35 | 35 | |
36 | - foreach(sn_get_groups('flt_transports') as $transport_id) { |
|
36 | + foreach (sn_get_groups('flt_transports') as $transport_id) { |
|
37 | 37 | $transports[$transport_id] = get_unit_param($transport_id, P_CAPACITY); |
38 | 38 | } |
39 | 39 | arsort($transports); |
40 | 40 | |
41 | 41 | $planets_db_list = db_planet_list_sorted($user, $planetrow['id'], '*', $query); |
42 | 42 | !is_array($planets_db_list) ? $planets_db_list = array() : false; |
43 | - foreach($planets_db_list as $planet_db_data) { |
|
43 | + foreach ($planets_db_list as $planet_db_data) { |
|
44 | 44 | // begin planet loop |
45 | - if(!$query) { |
|
45 | + if (!$query) { |
|
46 | 46 | $resources_taken[$planet_db_data['id']] = 1; |
47 | 47 | } |
48 | 48 | sn_db_transaction_start(); |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | $planet_id = $planet_db_data['id']; |
55 | 55 | |
56 | 56 | $planet_resources = 0; |
57 | - foreach(sn_get_groups('resources_loot') as $resource_id) { |
|
58 | - if($resources_taken[$planet_id] == 1 || $resources_taken[$planet_id][$resource_id]) { |
|
57 | + foreach (sn_get_groups('resources_loot') as $resource_id) { |
|
58 | + if ($resources_taken[$planet_id] == 1 || $resources_taken[$planet_id][$resource_id]) { |
|
59 | 59 | $planet_resources += floor(mrc_get_level($user, $planet_db_data, $resource_id, true, true)); // $planet_db_data[get_unit_param($resource_id, P_NAME)]); |
60 | 60 | } |
61 | 61 | } |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | $fleet_capacity = 0; |
87 | 87 | $ship_loadout = array(); |
88 | 88 | $fleet = array(); |
89 | - foreach($transports as $ship_id => $ship_capacity) { |
|
90 | - if($ship_count = mrc_get_level($user, $planet_db_data, $ship_id, true, true)) { |
|
89 | + foreach ($transports as $ship_id => $ship_capacity) { |
|
90 | + if ($ship_count = mrc_get_level($user, $planet_db_data, $ship_id, true, true)) { |
|
91 | 91 | $ship_loadout[$ship_id]['capacity'] = $ship_count * $ship_capacity; |
92 | 92 | $ship_loadout[$ship_id]['taken'] = 0; |
93 | 93 | $fleet_capacity += $ship_loadout[$ship_id]['capacity']; |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | |
99 | 99 | $will_take = min($planet_resources, $fleet_capacity); |
100 | 100 | |
101 | - foreach($ship_loadout as $ship_id => &$planet_ship) { |
|
101 | + foreach ($ship_loadout as $ship_id => &$planet_ship) { |
|
102 | 102 | $can_take = min($will_take, $planet_ship['capacity']); |
103 | - if($can_take <= 0) { |
|
103 | + if ($can_take <= 0) { |
|
104 | 104 | continue; |
105 | 105 | } |
106 | 106 | $planet_ship['capacity'] -= $can_take; |
@@ -108,23 +108,23 @@ discard block |
||
108 | 108 | $fleet[$ship_id] = ceil($planet_ship['taken'] / $transports[$ship_id]); |
109 | 109 | |
110 | 110 | $will_take -= $can_take; |
111 | - if($will_take <= 0) { |
|
111 | + if ($will_take <= 0) { |
|
112 | 112 | break; |
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
116 | - if(!empty($fleet)) { |
|
116 | + if (!empty($fleet)) { |
|
117 | 117 | $travel_data = flt_travel_data($user, $planetrow, $planet_db_data, $fleet, 10); |
118 | 118 | $planet_data['FLEET_SPEED'] = $travel_data['fleet_speed']; |
119 | 119 | $planet_data['DISTANCE'] = $travel_data['distance']; |
120 | 120 | $planet_data['DURATION'] = $travel_data['duration']; |
121 | 121 | $planet_data['CONSUMPTION'] = $travel_data['consumption']; |
122 | 122 | |
123 | - if(floor(mrc_get_level($user, $planet_db_data, RES_DEUTERIUM, true)) >= $planet_data['CONSUMPTION']) { |
|
123 | + if (floor(mrc_get_level($user, $planet_db_data, RES_DEUTERIUM, true)) >= $planet_data['CONSUMPTION']) { |
|
124 | 124 | $will_take = min($planet_resources, $fleet_capacity) - $planet_data['CONSUMPTION']; |
125 | 125 | |
126 | - foreach(sn_get_groups('resources_loot') as $resource_id) { |
|
127 | - if($resources_taken[$planet_id] != 1 && !$resources_taken[$planet_id][$resource_id]) { |
|
126 | + foreach (sn_get_groups('resources_loot') as $resource_id) { |
|
127 | + if ($resources_taken[$planet_id] != 1 && !$resources_taken[$planet_id][$resource_id]) { |
|
128 | 128 | continue; |
129 | 129 | } |
130 | 130 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $fleet[$resource_id] = min($will_take, $resource_amount); |
134 | 134 | $will_take -= $resource_amount; |
135 | 135 | |
136 | - if($will_take <= 0) { |
|
136 | + if ($will_take <= 0) { |
|
137 | 137 | break; |
138 | 138 | } |
139 | 139 | } |
@@ -157,19 +157,19 @@ discard block |
||
157 | 157 | |
158 | 158 | $resources_taken = sys_get_param('resources'); |
159 | 159 | |
160 | -if(!empty($resources_taken)) { // begin processing parameters |
|
160 | +if (!empty($resources_taken)) { // begin processing parameters |
|
161 | 161 | $planet_list = flt_build_gathering($resources_taken); |
162 | 162 | |
163 | - foreach($planet_list as $planet_id => $planet_data) { |
|
164 | - if($planet_data['RESULT'] == ATTACK_ALLOWED) { |
|
163 | + foreach ($planet_list as $planet_id => $planet_data) { |
|
164 | + if ($planet_data['RESULT'] == ATTACK_ALLOWED) { |
|
165 | 165 | $planet_data['RESULT'] = flt_t_send_fleet($user, $planet_data['PLANET_DB_DATA'], $planetrow, $planet_data['FLEET'], MT_TRANSPORT); |
166 | 166 | } |
167 | 167 | |
168 | 168 | $planet_data['MESSAGE'] = $lang['fl_attack_error'][$planet_data['RESULT']]; |
169 | 169 | |
170 | 170 | $template->assign_block_vars('results', $planet_data); |
171 | - if(!empty($planet_data['FLEET']) && $planet_data['RESULT'] == ATTACK_ALLOWED) { |
|
172 | - foreach($planet_data['FLEET'] as $unit_id => $amount) { |
|
171 | + if (!empty($planet_data['FLEET']) && $planet_data['RESULT'] == ATTACK_ALLOWED) { |
|
172 | + foreach ($planet_data['FLEET'] as $unit_id => $amount) { |
|
173 | 173 | $template->assign_block_vars('results.units', array( |
174 | 174 | 'ID' => $unit_id, |
175 | 175 | 'NAME' => $lang['tech'][$unit_id], |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | // Building list of own planets & moons |
184 | 184 | $planet_list = flt_build_gathering(); |
185 | -foreach($planet_list as $planet_data) { |
|
185 | +foreach ($planet_list as $planet_data) { |
|
186 | 186 | $planet_data['DURATION'] = $planet_data['DURATION'] ? pretty_time($planet_data['DURATION']) : $lang['flt_no_fuel']; |
187 | 187 | $template->assign_block_vars('colonies', $planet_data); |
188 | 188 | } |
@@ -79,8 +79,7 @@ |
||
79 | 79 | |
80 | 80 | sn_db_transaction_commit(); |
81 | 81 | throw new Exception($info_action, ERR_NONE); |
82 | - } |
|
83 | - catch (Exception $e) |
|
82 | + } catch (Exception $e) |
|
84 | 83 | { |
85 | 84 | sn_db_transaction_rollback(); |
86 | 85 |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | $classLocale = classLocale::$lang; |
4 | 4 | |
5 | -if(!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) |
|
5 | +if (!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) |
|
6 | 6 | { |
7 | 7 | $debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403); |
8 | 8 | } |
@@ -17,50 +17,50 @@ discard block |
||
17 | 17 | )); |
18 | 18 | |
19 | 19 | $info_action = sys_get_param_int('action'); |
20 | -if($info_action) |
|
20 | +if ($info_action) |
|
21 | 21 | { |
22 | 22 | try |
23 | 23 | { |
24 | 24 | sn_db_transaction_start(); |
25 | 25 | |
26 | 26 | $user = db_user_by_id($user['id'], true); |
27 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < classSupernova::$config->rpg_cost_info) |
|
27 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < classSupernova::$config->rpg_cost_info) |
|
28 | 28 | { |
29 | 29 | throw new Exception(MARKET_NO_DM, ERR_ERROR); |
30 | 30 | } |
31 | 31 | |
32 | - switch($info_action) |
|
32 | + switch ($info_action) |
|
33 | 33 | { |
34 | 34 | case MARKET_INFO_PLAYER: |
35 | 35 | $user_info_name_unsafe = sys_get_param_str_unsafe('user_info_name'); |
36 | - if(!$user_info_name_unsafe) |
|
36 | + if (!$user_info_name_unsafe) |
|
37 | 37 | { |
38 | 38 | throw new Exception(MARKET_INFO_PLAYER_WRONG, ERR_ERROR); |
39 | 39 | } |
40 | 40 | |
41 | - if(is_id($user_info_name_unsafe)) |
|
41 | + if (is_id($user_info_name_unsafe)) |
|
42 | 42 | { |
43 | 43 | $user_info = db_user_by_id($user_info_name_unsafe, true, '`id`, `username`', true); |
44 | 44 | } |
45 | - if(!is_array($user_info)) |
|
45 | + if (!is_array($user_info)) |
|
46 | 46 | { |
47 | 47 | $user_info = db_user_by_username($user_info_name_unsafe, true, '`id`, `username`', true, true); |
48 | 48 | } |
49 | - if(!is_array($user_info)) |
|
49 | + if (!is_array($user_info)) |
|
50 | 50 | { |
51 | 51 | throw new Exception(MARKET_INFO_PLAYER_NOT_FOUND, ERR_ERROR); |
52 | 52 | } |
53 | - if($user_info['id'] == $user['id']) |
|
53 | + if ($user_info['id'] == $user['id']) |
|
54 | 54 | { |
55 | 55 | throw new Exception(MARKET_INFO_PLAYER_SAME, ERR_ERROR); |
56 | 56 | } |
57 | 57 | |
58 | 58 | $msg_text = array(); |
59 | - foreach(sn_get_groups('mercenaries') as $mercenary_id) |
|
59 | + foreach (sn_get_groups('mercenaries') as $mercenary_id) |
|
60 | 60 | { |
61 | 61 | $msg_text[] = "{$classLocale['tech'][$mercenary_id]} - " . (($mercenary_level = mrc_get_level($user_info, null, $mercenary_id)) ? "{$classLocale['sys_level']} {$mercenary_level}" : classLocale::$lang['eco_mrk_info_not_hired']); |
62 | 62 | } |
63 | - if($mercenary_level = mrc_get_level($user_info, null, UNIT_PREMIUM)) |
|
63 | + if ($mercenary_level = mrc_get_level($user_info, null, UNIT_PREMIUM)) |
|
64 | 64 | { |
65 | 65 | $msg_text[] = "{$classLocale['tech'][UNIT_PREMIUM]} - {$mercenary_level} {$classLocale['sys_level']}"; |
66 | 66 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | break; |
75 | 75 | } |
76 | 76 | |
77 | - if(!rpg_points_change($user['id'], RPG_MARKET_INFO_MERCENARY, -classSupernova::$config->rpg_cost_info, "Using Black Market page {$classLocale['eco_mrk_info']} - getting info about user ID {$user_info['id']}")) |
|
77 | + if (!rpg_points_change($user['id'], RPG_MARKET_INFO_MERCENARY, -classSupernova::$config->rpg_cost_info, "Using Black Market page {$classLocale['eco_mrk_info']} - getting info about user ID {$user_info['id']}")) |
|
78 | 78 | { |
79 | 79 | // TODO: throw new Exception(MARKET_INFO_PLAYER_SAME, ERR_ERROR); |
80 | 80 | } |