Lines
100.00%
9 / 9
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| toMessage | 100.00% | 8 / 8 | 100.00% | 1 / 1 | 1 | ||
| 13 | final readonly class LoginCommand implements Command | |
| 14 | { | |
| 15 | public function __construct( | |
| 16 | public PlayerName $playerName, | |
| 17 | #[SensitiveParameter] | |
| 18 | public string $token, | |
| 19 | public ClientVersion $version, | |
| 20 | ) {} | |
| 21 | ||
| 22 | #[Override] | |
| 23 | public function toMessage(): string | |
| 24 | { | |
| 25 | return ( | |
| 26 | "<msg t='sys'>" | |
| 27 | . "<body action='login' r='0'>" | |
| 28 | . "<login z='zone_master'>" | |
| 29 | . "<nick><![CDATA[SPIDER#0001~{$this->playerName}~{$this->version}]]></nick>" | |
| 30 | . "<pword><![CDATA[{$this->token}]]></pword>" | |
| 31 | . '</login></body></msg>' | |
| 32 | ); | |
| 33 | } | |
| 34 | } |