diff --git a/admin.php b/admin.php index 5f8a769..b2f5af2 100644 --- a/admin.php +++ b/admin.php @@ -66,6 +66,10 @@ include_once('includes/pages/adm/ShowConfigUniPage.php'); ShowConfigUniPage(); break; + case 'configmods': + include_once('includes/pages/adm/ShowConfigModsPage.php'); + ShowConfigModsPage(); + break; case 'chat': include_once('includes/pages/adm/ShowChatConfigPage.php'); ShowChatConfigPage(); diff --git a/includes/classes/missions/MissionCaseExpedition.class.php b/includes/classes/missions/MissionCaseExpedition.class.php index 4ce00a3..03af2b1 100644 --- a/includes/classes/missions/MissionCaseExpedition.class.php +++ b/includes/classes/missions/MissionCaseExpedition.class.php @@ -122,7 +122,11 @@ function EndStayEvent() $maxFactor = 2400; } - $founded = round(min($fleetCapacity,min($maxFactor, max(200, $factor)) * $fleetPoints)); + if ($config->expedition_limit_res_active == 1) { + $founded = round(min($config->expedition_limit_res, $fleetCapacity)); + } else { + $founded = round(min($fleetCapacity,min($maxFactor, max(200, $factor)) * $fleetPoints)); + } $fleetColName = 'fleet_resource_'.$resource[$resourceId]; $this->UpdateFleet($fleetColName, $this->_fleet[$fleetColName] + $founded); diff --git a/includes/pages/adm/ShowConfigModsPage.php b/includes/pages/adm/ShowConfigModsPage.php new file mode 100644 index 0000000..38de8f7 --- /dev/null +++ b/includes/pages/adm/ShowConfigModsPage.php @@ -0,0 +1,57 @@ + $config->expedition_limit_res, + 'expedition_limit_res_active' => $config->expedition_limit_res_active, + ); + + $expedition_limit_res_active = isset($_POST['expedition_limit_res_active']) && $_POST['expedition_limit_res_active'] == 'on' ? 1 : 0; + + $expedition_limit_res = HTTP::_GP('expedition_limit_res', 0); + + $config_after = array( + 'expedition_limit_res' => $expedition_limit_res, + 'expedition_limit_res_active' => $expedition_limit_res_active, + ); + + foreach($config_after as $key => $value) + { + $config->$key = $value; + } + $config->save(); + + $LOG = new Log(3); + $LOG->target = 0; + $LOG->old = $config_before; + $LOG->new = $config_after; + $LOG->save(); + } + + $template = new template(); + + $template->assign_vars(array( + 'expedition_limit_res' => $config->expedition_limit_res, + 'expedition_limit_res_active' => $config->expedition_limit_res_active, + )); + + $template->show('ConfigModsBody.tpl'); +} \ No newline at end of file diff --git a/install/install.sql b/install/install.sql index da219e3..7c70672 100644 --- a/install/install.sql +++ b/install/install.sql @@ -288,6 +288,8 @@ CREATE TABLE `%PREFIX%config` ( `disclamerMail` text NOT NULL, `disclamerNotice` text NOT NULL, `alliance_create_min_points` BIGINT UNSIGNED NOT NULL DEFAULT 0, + `expedition_limit_res_active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `expedition_limit_res` double(255,0) unsigned NOT NULL DEFAULT '1000000', PRIMARY KEY (`uni`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/language/en/CUSTOM.php b/language/en/CUSTOM.php index c2c961b..70129b7 100644 --- a/language/en/CUSTOM.php +++ b/language/en/CUSTOM.php @@ -31,4 +31,16 @@ $LNG['ov_create_moon'] = "Create moon"; $LNG['ov_list_title_build'] = "Building"; $LNG['ov_list_title_tech'] = "Research"; -$LNG['ov_list_title_fleet'] = "Fleet/Defense"; \ No newline at end of file +$LNG['ov_list_title_fleet'] = "Fleet/Defense"; + +/** + * Admin + */ +// ShowMenuPage.tpl +$LNG['mu_mods_settings'] = "Configure Mods"; +// ConfigModsBody.tpl +$LNG['msg_expedition'] = "Shipping Configuration"; +$LNG['msg_expedition_active'] = "Limit system"; +$LNG['msg_expedition_active_desc'] = "When activating this system you can put a limit on the resources to find during an expedition by the players"; +$LNG['msg_expedition_active_price'] = "Maximum amount of resources"; +$LNG['msg_expedition_active_price_desc'] = "Maximum amount the player can find on an expedition even if the capacity is higher"; \ No newline at end of file diff --git a/language/fr/CUSTOM.php b/language/fr/CUSTOM.php index 694ad15..52acf24 100644 --- a/language/fr/CUSTOM.php +++ b/language/fr/CUSTOM.php @@ -44,3 +44,15 @@ $LNG['ov_list_title_build'] = "Bâtiment"; $LNG['ov_list_title_tech'] = "Recherche"; $LNG['ov_list_title_fleet'] = "Flotte/Défense"; + +/** + * Admin + */ +// ShowMenuPage.tpl +$LNG['mu_mods_settings'] = "Configurer les Mods"; +// ConfigModsBody.tpl +$LNG['msg_expedition'] = "Configuration Expédition"; +$LNG['msg_expedition_active'] = "Système de limite"; +$LNG['msg_expedition_active_desc'] = "Lors de l'activation de ce système vous pouvez mettre une limite sur les ressource trouver lors d'une expédition par les joueurs"; +$LNG['msg_expedition_active_price'] = "Montant des ressources maximum"; +$LNG['msg_expedition_active_price_desc'] = "Montant maximum que le joueur peut trouver lors d'une expédition même si la capacité est supérieur"; \ No newline at end of file diff --git a/styles/templates/adm/ConfigModsBody.tpl b/styles/templates/adm/ConfigModsBody.tpl new file mode 100644 index 0000000..e77d574 --- /dev/null +++ b/styles/templates/adm/ConfigModsBody.tpl @@ -0,0 +1,25 @@ +{include file="overall_header.tpl"} +
+
+ + + + + + + + + + + + + + + + + +
{$LNG.msg_expedition} 
{$LNG.msg_expedition_active}
{$LNG.msg_expedition_active_price}
+
+
+{include file="overall_footer.tpl"} \ No newline at end of file diff --git a/styles/templates/adm/ShowMenuPage.tpl b/styles/templates/adm/ShowMenuPage.tpl index c8ee1a0..36ca540 100644 --- a/styles/templates/adm/ShowMenuPage.tpl +++ b/styles/templates/adm/ShowMenuPage.tpl @@ -6,6 +6,7 @@ {if allowedTo('ShowInformationPage')}
  • {$LNG.mu_game_info}
  • {/if} {if allowedTo('ShowConfigBasicPage')}
  • {$LNG.mu_settings}
  • {/if} {if allowedTo('ShowConfigUniPage')}
  • {$LNG.mu_unisettings}
  • {/if} + {if allowedTo('ShowConfigModsPage')}
  • {$LNG.mu_mods_settings}
  • {/if} {if allowedTo('ShowChatConfigPage')}
  • {$LNG.mu_chat}
  • {/if} {if allowedTo('ShowTeamspeakPage')}
  • {$LNG.mu_ts_options}
  • {/if} {if allowedTo('ShowFacebookPage')}
  • {$LNG.mu_fb_options}
  • {/if}