| 1: | <?php declare(strict_types=1); |
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | namespace Clansuite\Capture; |
| 14: | |
| 15: | |
| 16: | |
| 17: | |
| 18: | final class ServerInfo |
| 19: | { |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | |
| 35: | |
| 36: | |
| 37: | |
| 38: | public function __construct( |
| 39: | public ?string $address = null, |
| 40: | public ?int $queryport = null, |
| 41: | public bool $online = false, |
| 42: | public ?string $gamename = null, |
| 43: | public ?string $gameversion = null, |
| 44: | public ?string $servertitle = null, |
| 45: | public ?string $mapname = null, |
| 46: | public ?string $gametype = null, |
| 47: | public int $numplayers = 0, |
| 48: | public int $maxplayers = 0, |
| 49: | public array $rules = [], |
| 50: | public array $players = [], |
| 51: | public array $channels = [], |
| 52: | public ?string $errstr = null, |
| 53: | public ?bool $password = null, |
| 54: | public ?string $name = null, |
| 55: | public ?string $map = null, |
| 56: | public ?int $players_current = null, |
| 57: | public ?int $players_max = null, |
| 58: | public ?string $version = null, |
| 59: | public ?string $motd = null, |
| 60: | ) { |
| 61: | } |
| 62: | |
| 63: | |
| 64: | |
| 65: | |
| 66: | |
| 67: | |
| 68: | public function toArray(): array |
| 69: | { |
| 70: | return [ |
| 71: | 'address' => $this->address, |
| 72: | 'queryport' => $this->queryport, |
| 73: | 'online' => $this->online, |
| 74: | 'gamename' => $this->gamename, |
| 75: | 'gameversion' => $this->gameversion, |
| 76: | 'servertitle' => $this->servertitle, |
| 77: | 'mapname' => $this->mapname, |
| 78: | 'gametype' => $this->gametype, |
| 79: | 'numplayers' => $this->numplayers, |
| 80: | 'maxplayers' => $this->maxplayers, |
| 81: | 'rules' => $this->rules, |
| 82: | 'players' => $this->players, |
| 83: | 'channels' => $this->channels, |
| 84: | 'errstr' => $this->errstr, |
| 85: | 'password' => $this->password, |
| 86: | 'name' => $this->name, |
| 87: | 'map' => $this->map, |
| 88: | 'players_current' => $this->players_current, |
| 89: | 'players_max' => $this->players_max, |
| 90: | 'version' => $this->version, |
| 91: | 'motd' => $this->motd, |
| 92: | ]; |
| 93: | } |
| 94: | } |
| 95: | |