From aa8309145809d608e0d7af6bd3f992194e5703ab Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 27 Sep 2020 12:51:34 -0400 Subject: [PATCH] Cap health if server doesn't have a description --- src/classes/Pollers/Server.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/classes/Pollers/Server.php b/src/classes/Pollers/Server.php index f490af7..e6c160c 100644 --- a/src/classes/Pollers/Server.php +++ b/src/classes/Pollers/Server.php @@ -199,7 +199,8 @@ class Server $probe_result['time'], $version, $probe_result['ssl_state'], - $avg_ping + $avg_ping, + $probe_result['data']['info'] ?? null ); $this->atlas->perform( @@ -324,7 +325,8 @@ class Server ?int $time, ?string $version, ?int $ssl_state, - ?float $avg_ping + ?float $avg_ping, + ?string $description ): int { //Probe failed, costs you 30 points. @@ -396,6 +398,11 @@ class Server } } + // No description available penalty + if (!$description) { + $max_health = min(75, $max_health); + } + // No ping penalty if (!$avg_ping) { $max_health -= 5;