| 1: | <?php declare(strict_types=1); |
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | namespace Clansuite\ServerQuery\ServerProtocols; |
| 14: | |
| 15: | use function is_int; |
| 16: | use function is_string; |
| 17: | use Clansuite\Capture\Protocol\ProtocolInterface; |
| 18: | use Clansuite\Capture\ServerAddress; |
| 19: | use Clansuite\Capture\ServerInfo; |
| 20: | use Override; |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | |
| 27: | class Conan extends Steam implements ProtocolInterface |
| 28: | { |
| 29: | |
| 30: | |
| 31: | |
| 32: | public string $name = 'Conan'; |
| 33: | |
| 34: | |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | public array $supportedGames = ['Conan Exiles']; |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | public string $protocol = 'conan'; |
| 45: | |
| 46: | |
| 47: | |
| 48: | |
| 49: | public function __construct(mixed $address = null, mixed $queryport = null) |
| 50: | { |
| 51: | $address = $address === null ? null : (is_string($address) ? $address : null); |
| 52: | $queryport = $queryport === null ? null : (is_int($queryport) ? $queryport : null); |
| 53: | parent::__construct($address, $queryport); |
| 54: | } |
| 55: | |
| 56: | |
| 57: | |
| 58: | |
| 59: | #[Override] |
| 60: | public function query(ServerAddress $addr): ServerInfo |
| 61: | { |
| 62: | return parent::query($addr); |
| 63: | } |
| 64: | |
| 65: | |
| 66: | |
| 67: | |
| 68: | #[Override] |
| 69: | public function getProtocolName(): string |
| 70: | { |
| 71: | return $this->protocol; |
| 72: | } |
| 73: | |
| 74: | |
| 75: | |
| 76: | |
| 77: | #[Override] |
| 78: | public function getVersion(ServerInfo $info): string |
| 79: | { |
| 80: | return $info->gameversion ?? 'unknown'; |
| 81: | } |
| 82: | } |
| 83: | |