Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Admin/Package/Screens/MonitoringTestScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function layout(): array
'auto' => __('monitoring.admin.protocol_auto'),
'source' => 'Source Engine',
'goldsrc' => 'GoldSource (CS 1.6)',
'xash3d' => 'Xash3D FWGS Engine',
'minecraft' => 'Minecraft',
'samp' => 'SA-MP',
'gta5' => 'GTA V (FiveM/RageMP)',
Expand Down Expand Up @@ -175,6 +176,7 @@ protected function runTest(): void
$protocolMap = [
'source' => '730',
'goldsrc' => '10',
'xash3d' => 'xash3d',
'minecraft' => 'minecraft',
'samp' => 'samp',
'gta5' => 'gta5',
Expand Down
29 changes: 23 additions & 6 deletions Resources/views/admin/test-result.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,19 @@
</div>
<div class="mtest__players mtest__players--simple">
@foreach (array_slice($playersData, 0, 20) as $player)
@php
// Normalise keys — formatPlayersData stores Name/Score/Time (capital),
// but some drivers return name/score/time (lowercase)
$playerName = $player['Name'] ?? $player['name'] ?? null;
$playerScore = $player['Score'] ?? $player['score'] ?? null;
$playerTime = $player['Time'] ?? $player['time'] ?? null;
@endphp
<div class="mtest__player mtest__player--simple">
<span class="mtest__player-name">{{ $player['name'] ?? 'Unknown' }}</span>
@if (isset($player['score']))
<span class="mtest__player-score">{{ $player['score'] }}</span>
@endif
@if (isset($player['time']))
<span class="mtest__player-time">{{ gmdate('H:i:s', $player['time'] ?? 0) }}</span>
<span class="mtest__player-name">
{{ $playerName ?? 'Unknown' }}@if ($playerScore !== null) <span class="mtest__player-score">({{ $playerScore }})</span>@endif
</span>
@if ($playerTime !== null)
<span class="mtest__player-time">{{ gmdate('H:i:s', (int) $playerTime) }}</span>
@endif
</div>
@endforeach
Expand Down Expand Up @@ -483,17 +489,28 @@

.mtest__players--simple .mtest__player {
border-left: none;
display: flex;
justify-content: space-between;
align-items: center;
}

.mtest__player--simple {
padding: 0.5rem 1rem;
}

.mtest__player-stats-simple {
display: flex;
gap: 0.75rem;
align-items: center;
flex-shrink: 0;
}

.mtest__player-score,
.mtest__player-time {
font-size: 0.8125rem;
color: var(--text-400);
font-family: var(--font-mono, monospace);
text-align: right;
}

.mtest__more {
Expand Down
8 changes: 7 additions & 1 deletion Services/MapImageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ public function getMapPreview(?ServerStatus $status): string

protected function getMapImagePath(ServerStatus $status): string
{
$mod = preg_replace('/[^a-zA-Z0-9_\-]/', '', $status->server->mod);
$mod = $status->server->mod;

if ($mod === 'xash3d') {
$mod = in_array($status->game, ['cstrike', 'czero'], true) ? '10' : null;
}

$mod = preg_replace('/[^a-zA-Z0-9_\-]/', '', $mod ?? '');
$map = preg_replace('/[^a-zA-Z0-9_\-]/', '', $status->map ?? '-');

return 'assets/img/maps/' . $mod . '/' . $map . '.webp';
Expand Down
7 changes: 6 additions & 1 deletion Services/MonitoringPingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MonitoringPingService
private const PING_TIMEOUT = 2;

/** @var string[] Game mods that have no TCP listener — must use UDP probe */
private const UDP_ONLY_MODS = ['samp', 'minecraft_bedrock'];
private const UDP_ONLY_MODS = ['samp', 'minecraft_bedrock', 'xash3d'];

/** @var string[] Game mods queried via HTTP */
private const HTTP_MODS = ['gta5', 'fivem', 'redm'];
Expand Down Expand Up @@ -182,6 +182,11 @@ private function getUdpProbePacket(string $ip, int $port, string $mod): string
return $header . 'i';
}

// Xash3D FWGS — "info 49" out-of-band query
if ($mod === 'xash3d') {
return "\xFF\xFF\xFF\xFFinfo 49";
}

// Minecraft Bedrock (RakNet Unconnected Ping)
$packet = chr(0x01);
$packet .= pack('J', (int) (microtime(true) * 1000));
Expand Down