Skip to content

Commit

Permalink
Fixes of review.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoTKBR authored and elsongabriel committed Nov 21, 2023
1 parent 0e088fc commit 3d94774
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
24 changes: 12 additions & 12 deletions system/pages/serverinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,22 @@
if(isset($whiteSkullTime))
$whiteSkullTime = eval('return ' . $whiteSkullTime . ';');

$redSkullLength = isset($config['lua']['redSkullDuration']) ? $config['lua']['redSkullDuration'] : NULL;
$redSkullLength = configLua('redSkullDuration') ?? null;
if(!isset($redSkullLength) && isset($config['lua']['red_skull_duration']))
$redSkullLength = $config['lua']['red_skull_duration'];

if(isset($redSkullLength))
$redSkullLength = eval('return ' . $redSkullLength . ';');

$blackSkull = true;
$blackSkullLength = isset($config['lua']['blackSkullDuration']) ? $config['lua']['blackSkullDuration'] : NULL;
$blackSkull = false;
$blackSkullLength = configLua('blackSkullDuration') : null;
if(isset($config['lua']['useBlackSkull']) && getBoolean($config['lua']['useBlackSkull']))
{
$blackSkullLength = $config['lua']['blackSkullDuration'];
$blackSkullLength = configLua('blackSkullDuration');
$blackSkull = true;
}
else if(isset($config['lua']['black_skull_duration'])) {
$blackSkullLength = eval('return ' . $config['lua']['blackSkullDuration'] . ';');
$blackSkullLength = eval('return ' . configLua('blackSkullDuration') . ';');
$blackSkull = true;
}

Expand All @@ -88,7 +88,7 @@
$twig->display('serverinfo.html.twig', array(
'server_save' => $explodeServerSave,
'experienceStages' => isset($config['lua']['experienceStages']) && getBoolean($config['lua']['experienceStages']) ? $config['lua']['experienceStages'] : null,
'serverIp' => str_replace('/', '', str_replace('http://', '', $config['lua']['ip'])),
'serverIp' => str_replace(['http://', 'https://'], '', configLua('url'),
'clientVersion' => $clientVersion,
'globalSaveHour' => isset($config['lua']['globalSaveEnabled']) && getBoolean($config['lua']['globalSaveEnabled']) ? $config['lua']['globalSaveHour'] : null,
'protectionLevel' => $config['lua']['protectionLevel'],
Expand All @@ -106,12 +106,12 @@
'redSkullLength' => $redSkullLength,
'blackSkull' => $blackSkull,
'blackSkullLength' => $blackSkullLength,
'dailyFragsToRedSkull' => isset($config['lua']['dayKillsToRedSkull']) ? $config['lua']['dayKillsToRedSkull'] : (isset($config['lua']['dayKillsToRedSkull']) ? $config['lua']['dayKillsToRedSkull'] : null),
'weeklyFragsToRedSkull' => isset($config['lua']['weekKillsToRedSkull']) ? $config['lua']['weekKillsToRedSkull'] : (isset($config['lua']['weekKillsToRedSkull']) ? $config['lua']['weekKillsToRedSkull'] : null),
'monthlyFragsToRedSkull' => isset($config['lua']['monthKillsToRedSkull']) ? $config['lua']['monthKillsToRedSkull'] : (isset($config['lua']['monthKillsToRedSkull']) ? $config['lua']['monthKillsToRedSkull'] : null),
'dailyFragsToBlackSkull' => isset($config['lua']['dailyFragsToBlackSkull']) ? $config['lua']['dailyFragsToBlackSkull'] : (isset($config['lua']['kills_per_day_black_skull']) ? $config['lua']['kills_per_day_black_skull'] : null),
'weeklyFragsToBlackSkull' => isset($config['lua']['weeklyFragsToBlackSkull']) ? $config['lua']['weeklyFragsToBlackSkull'] : (isset($config['lua']['kills_per_week_black_skull']) ? $config['lua']['kills_per_week_black_skull'] : null),
'monthlyFragsToBlackSkull' => isset($config['lua']['monthlyFragsToBlackSkull']) ? $config['lua']['monthlyFragsToBlackSkull'] : (isset($config['lua']['kills_per_month_black_skull']) ? $config['lua']['kills_per_month_black_skull'] : null),
'dailyFragsToRedSkull' => configLua('dayKillsToRedSkull') ?? null,
'weeklyFragsToRedSkull' => configLua('weekKillsToRedSkull') ?? null,
'monthlyFragsToRedSkull' => configLua('monthKillsToRedSkull') ?? null,
'dailyFragsToBlackSkull' => configLua('dailyFragsToBlackSkull') ?? null,
'weeklyFragsToBlackSkull' => configLua('weeklyFragsToBlackSkull') ?? null,
'monthlyFragsToBlackSkull' => configLua('monthlyFragsToBlackSkull') ?? null,
'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,
Expand Down
4 changes: 1 addition & 3 deletions system/templates/serverinfo.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@
<tr bgcolor="#F1E0C6"><td><b>BlackSkull Duration: </b> {{ blackSkullLength }} days</td></tr>
{% endif %}
{% if dayKillsToRedSkull is defined %}
<li>Kills to red skull: <b>{{ config.lua.dayKillsToRedSkull }}</b></li>
{% elseif config.lua.dayKillsToRedSkull is defined or config.lua.kills_per_day_red_skull is defined %}
<li>Kills to red skull: <b>{{ dayKillsToRedSkull }}</b></li>

<h3>Red skull</h3>
<ul>
Expand All @@ -249,7 +248,6 @@
</ul>
{% endif %}

{% endif %}
{% if banishmentLength %}
<li>Banishment length: <b>{{ banishmentLength }} days</b></li>
{% endif %}
Expand Down

0 comments on commit 3d94774

Please sign in to comment.