diff --git a/player-counter/src/Extensions/Query/Schemas/CitizenFXQueryTypeSchema.php b/player-counter/src/Extensions/Query/Schemas/CitizenFXQueryTypeSchema.php index 63828d52..d2f2c5fd 100644 --- a/player-counter/src/Extensions/Query/Schemas/CitizenFXQueryTypeSchema.php +++ b/player-counter/src/Extensions/Query/Schemas/CitizenFXQueryTypeSchema.php @@ -44,8 +44,9 @@ public function process(Server $server, string $ip, int $port): ?array 'max_players' => $info['sv_maxclients'], 'players' => array_map(fn ($player) => ['id' => (string) $player['id'], 'name' => (string) $player['name']], $players), ]; - } catch (Exception $exception) { - report($exception); + } catch (Exception) { + // Not reported: a failed query almost always just means the server is offline, + // starting or otherwise unreachable, not an application error. } return null; diff --git a/player-counter/src/Extensions/Query/Schemas/MinecraftBedrockQueryTypeSchema.php b/player-counter/src/Extensions/Query/Schemas/MinecraftBedrockQueryTypeSchema.php index 946dcdf5..43d7226c 100644 --- a/player-counter/src/Extensions/Query/Schemas/MinecraftBedrockQueryTypeSchema.php +++ b/player-counter/src/Extensions/Query/Schemas/MinecraftBedrockQueryTypeSchema.php @@ -40,8 +40,9 @@ public function process(Server $server, string $ip, int $port): ?array 'max_players' => $info['MaxPlayers'], 'players' => null, // Bedrock has no player list ]; - } catch (Exception $exception) { - report($exception); + } catch (Exception) { + // Not reported: a failed query almost always just means the server is offline, + // starting or otherwise unreachable, not an application error. } return null; diff --git a/player-counter/src/Extensions/Query/Schemas/MinecraftJavaQueryTypeSchema.php b/player-counter/src/Extensions/Query/Schemas/MinecraftJavaQueryTypeSchema.php index ea4d6857..a353915f 100644 --- a/player-counter/src/Extensions/Query/Schemas/MinecraftJavaQueryTypeSchema.php +++ b/player-counter/src/Extensions/Query/Schemas/MinecraftJavaQueryTypeSchema.php @@ -58,8 +58,10 @@ protected function tryQuery(string $ip, int $port): false|array 'max_players' => $info['MaxPlayers'], 'players' => array_map(fn ($player) => ['id' => (string) $player, 'name' => (string) $player], $players), ]; - } catch (Exception $exception) { - report($exception); + } catch (Exception) { + // Not reported: a failed query almost always just means the server is offline, + // starting or otherwise unreachable, not an application error. It falls back to + // tryPing() below, and the UI already reflects an unreachable server on its own. } return false; @@ -84,8 +86,8 @@ protected function tryPing(string $ip, int $port): false|array 'max_players' => $data['players']['max'], 'players' => $data['players']['sample'] ?? [], ]; - } catch (Exception $exception) { - report($exception); + } catch (Exception) { + // Not reported, see tryQuery() above - same reasoning applies to the ping fallback. } finally { if (isset($ping)) { $ping->Close(); diff --git a/player-counter/src/Extensions/Query/Schemas/PalworldQueryTypeSchema.php b/player-counter/src/Extensions/Query/Schemas/PalworldQueryTypeSchema.php index 97105f84..b55b8403 100644 --- a/player-counter/src/Extensions/Query/Schemas/PalworldQueryTypeSchema.php +++ b/player-counter/src/Extensions/Query/Schemas/PalworldQueryTypeSchema.php @@ -50,9 +50,9 @@ public function process(Server $server, string $ip, int $port): ?array 'players' => array_map(fn ($player) => ['id' => (string) ($player['playerId'] ?? $player['userId']), 'name' => (string) $player['name']], $players), ]; - } catch (Exception $exception) { - report($exception); - + } catch (Exception) { + // Not reported: a failed query almost always just means the server is offline, + // starting or otherwise unreachable, not an application error. return null; } } diff --git a/player-counter/src/Extensions/Query/Schemas/SourceQueryTypeSchema.php b/player-counter/src/Extensions/Query/Schemas/SourceQueryTypeSchema.php index 5d4902fd..8d95586c 100644 --- a/player-counter/src/Extensions/Query/Schemas/SourceQueryTypeSchema.php +++ b/player-counter/src/Extensions/Query/Schemas/SourceQueryTypeSchema.php @@ -43,8 +43,9 @@ protected function run(string $ip, int $port, int $engine): ?array 'max_players' => $info['MaxPlayers'], 'players' => array_map(fn ($player) => ['id' => (string) $player['Id'], 'name' => (string) $player['Name']], $players), ]; - } catch (Exception $exception) { - report($exception); + } catch (Exception) { + // Not reported: a failed query almost always just means the server is offline, + // starting or otherwise unreachable, not an application error. } finally { $query->Disconnect(); }