diff --git a/system/pages/serverinfo.php b/system/pages/serverinfo.php index f7b6ccb2..b3b21f19 100644 --- a/system/pages/serverinfo.php +++ b/system/pages/serverinfo.php @@ -5,184 +5,105 @@ * @package MyAAC * @author Gesior * @author Slawkens - * @copyright 2017 MyAAC + * @author whiteblXK + * @copyright 2019 MyAAC * @link http://my-aac.org */ defined('MYAAC') or die('Direct access not allowed!'); $title = 'Server info'; if(isset($config['lua']['experience_stages'])) - $config['lua']['experienceStages'] = $config['lua']['experience_stages']; + $config['lua']['experienceStages'] = $config['lua']['experience_stages']; + +if(isset($config['lua']['min_pvp_level'])) + $config['lua']['protectionLevel'] = $config['lua']['min_pvp_level']; + +$rent = trim(strtolower($config['lua']['houseRentPeriod'])); +if($rent != 'yearly' && $rent != 'monthly' && $rent != 'weekly' && $rent != 'daily') + $rent = 'never'; + +if(isset($config['lua']['houseCleanOld'])) + $cleanOld = (int)(eval('return ' . $config['lua']['houseCleanOld'] . ';') / (24 * 60 * 60)); + +if(isset($config['lua']['rate_exp'])) + $config['lua']['rateExp'] = $config['lua']['rate_exp']; +if(isset($config['lua']['rateExperience'])) + $config['lua']['rateExp'] = $config['lua']['rateExperience']; +if(isset($config['lua']['rate_mag'])) + $config['lua']['rateMagic'] = $config['lua']['rate_mag']; +if(isset($config['lua']['rate_skill'])) + $config['lua']['rateSkill'] = $config['lua']['rate_skill']; +if(isset($config['lua']['rate_loot'])) + $config['lua']['rateLoot'] = $config['lua']['rate_loot']; +if(isset($config['lua']['rate_spawn'])) + $config['lua']['rateSpawn'] = $config['lua']['rate_spawn']; + +$house_level = NULL; +if(isset($config['lua']['levelToBuyHouse'])) + $house_level = $config['lua']['levelToBuyHouse']; +else if(isset($config['lua']['house_level'])) + $house_level = $config['lua']['house_level']; + +if(isset($config['lua']['in_fight_duration'])) + $config['lua']['pzLocked'] = $config['lua']['in_fight_duration']; + +$pzLocked = eval('return ' . $config['lua']['pzLocked'] . ';'); +$whiteSkullTime = isset($config['lua']['whiteSkullTime']) ? $config['lua']['whiteSkullTime'] : NULL; +if(!isset($whiteSkullTime) && isset($config['lua']['unjust_skull_duration'])) + $whiteSkullTime = $config['lua']['unjust_skull_duration']; + +if(isset($whiteSkullTime)) + $whiteSkullTime = eval('return ' . $whiteSkullTime . ';'); + +$redSkullLength = isset($config['lua']['redSkullLength']) ? $config['lua']['redSkullLength'] : NULL; +if(!isset($redSkullLength) && isset($config['lua']['red_skull_duration'])) + $redSkullLength = $config['lua']['red_skull_duration']; + +if(isset($redSkullLength)) + $redSkullLength = eval('return ' . $redSkullLength . ';'); + +$blackSkull = false; +$blackSkullLength = NULL; +if(isset($config['lua']['useBlackSkull']) && getBoolean($config['lua']['useBlackSkull'])) +{ + $blackSkullLength = $config['lua']['blackSkullLength']; + $blackSkull = true; +} +else if(isset($config['lua']['black_skull_duration'])) { + $blackSkullLength = eval('return ' . $config['lua']['blackSkullLength'] . ';'); + $blackSkull = true; +} + +$twig->display('serverinfo.html.twig', array( + 'experienceStages' => isset($config['lua']['experienceStages']) && getBoolean($config['lua']['experienceStages']) ? $config['lua']['experienceStages'] : null, + 'serverIp' => str_replace('/', '', str_replace('http://', '', $config['lua']['url'])), + 'clientVersion' => isset($status['online']) ? $status['clientVersion'] : null, + 'globalSaveHour' => isset($config['lua']['globalSaveEnabled']) && getBoolean($config['lua']['globalSaveEnabled']) ? $config['lua']['globalSaveHour'] : null, + 'protectionLevel' => $config['lua']['protectionLevel'], + 'houseRent' => $rent == 'never' ? 'disabled' : $rent, + 'houseOld' => isset($cleanOld) ? $cleanOld : null, + 'rateExp' => $config['lua']['rateExp'], + 'rateExpFromPlayers' => isset($config['lua']['rateExperienceFromPlayers']) ? $config['lua']['rateExperienceFromPlayers'] : null, + 'rateMagic' => $config['lua']['rateMagic'], + 'rateSkill' => $config['lua']['rateSkill'], + 'rateLoot' => $config['lua']['rateLoot'], + 'rateSpawn' => $config['lua']['rateSpawn'], + 'houseLevel' => $house_level, + 'pzLocked' => $pzLocked, + 'whiteSkullTime' => $whiteSkullTime, + 'redSkullLength' => $redSkullLength, + 'blackSkull' => $blackSkull, + 'blackSkullLength' => $blackSkullLength, + 'dailyFragsToRedSkull' => isset($config['lua']['dailyFragsToRedSkull']) ? $config['lua']['dailyFragsToRedSkull'] : $config['lua']['kills_per_day_red_skull'], + 'weeklyFragsToRedSkull' => isset($config['lua']['weeklyFragsToRedSkull']) ? $config['lua']['weeklyFragsToRedSkull'] : $config['lua']['kills_per_week_red_skull'], + 'monthlyFragsToRedSkull' => isset($config['lua']['monthlyFragsToRedSkull']) ? $config['lua']['monthlyFragsToRedSkull'] : $config['lua']['kills_per_month_red_skull'], + 'dailyFragsToBlackSkull' => isset($config['lua']['dailyFragsToBlackSkull']) ? $config['lua']['dailyFragsToBlackSkull'] : $config['lua']['kills_per_day_black_skull'], + 'weeklyFragsToBlackSkull' => isset($config['lua']['weeklyFragsToBlackSkull']) ? $config['lua']['weeklyFragsToBlackSkull'] : $config['lua']['kills_per_week_black_skull'], + 'monthlyFragsToBlackSkull' => isset($config['lua']['monthlyFragsToBlackSkull']) ? $config['lua']['monthlyFragsToBlackSkull'] : $config['lua']['kills_per_month_black_skull'], + 'banishmentLength' => isset($config['lua']['banishment_length']) ? eval('return (' . $config['lua']['banishment_length'] . ') / (24 * 60 * 60);') : null, + 'finalBanishmentLength' => isset($config['lua']['final_banishment_length']) ? eval('return (' . $config['lua']['final_banishment_length'] . ') / (24 * 60 * 60);') : null, + 'ipBanishmentLength' => isset($config['lua']['ip_banishment_length']) ? eval('return (' . $config['lua']['ip_banishment_length'] . ') / (24 * 60 * 60);') : null, +)); ?> -
-

-

- - Experience stages: Look here
- - Commands: Look here
- Team: Look here
-

-
- diff --git a/system/templates/serverinfo.html.twig b/system/templates/serverinfo.html.twig new file mode 100644 index 00000000..2202ba74 --- /dev/null +++ b/system/templates/serverinfo.html.twig @@ -0,0 +1,102 @@ +
+

{{ config.lua.serverName }}

+

+ {% if experienceStages %} + Experience stages: {{ experienceStages }}
+ {% endif %} + Commands: Look here
+ Team: Look here
+

+
+ + \ No newline at end of file