Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
KillingFloor
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 2
30
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
20
 getProtocolName
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php declare(strict_types=1);
2
3/**
4 * Clansuite Server Query
5 *
6 * SPDX-FileCopyrightText: 2003-2025 Jens A. Koch
7 * SPDX-License-Identifier: MIT
8 *
9 * For the full copyright and license information, please view
10 * the LICENSE file that was distributed with this source code.
11 */
12
13namespace Clansuite\ServerQuery\ServerProtocols;
14
15use Clansuite\Capture\Protocol\ProtocolInterface;
16use Override;
17
18/**
19 * Killing Floor Protocol implementation.
20 *
21 * Extends Unreal2 protocol for Killing Floor specific features.
22 */
23class KillingFloor extends Unreal2 implements ProtocolInterface
24{
25    /**
26     * Protocol name.
27     */
28    public string $name = 'KillingFloor';
29
30    /**
31     * List of supported games.
32     *
33     * @var array<string>
34     */
35    public array $supportedGames = ['KillingFloor'];
36
37    /**
38     * Protocol identifier.
39     */
40    public string $protocol = 'killingfloor';
41
42    /**
43     * Constructor.
44     */
45    public function __construct(?string $address = null, ?int $queryport = null)
46    {
47        $address   = $address === null ? null : $address;
48        $queryport = $queryport === null ? null : $queryport;
49        parent::__construct($address, $queryport);
50
51        // Killing Floor uses queryport + 1 for the game port
52        if ($queryport !== null) {
53            $this->hostport = $queryport + 1;
54        }
55    }
56
57    /**
58     * getProtocolName method.
59     */
60    #[Override]
61    public function getProtocolName(): string
62    {
63        return $this->protocol;
64    }
65}