Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| LoginScript | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AqwSocketClient\Scripts; |
| 6 | |
| 7 | use AqwSocketClient\Objects\Names\PlayerName; |
| 8 | |
| 9 | /** |
| 10 | * Orchestrates the full login sequence: |
| 11 | * 1. Establish connection and authenticate. |
| 12 | * 2. Join the battleon area. |
| 13 | * 3. Load the player inventory. |
| 14 | * |
| 15 | * Equivalent to: |
| 16 | * new SequenceScript([ |
| 17 | * new ConnectAndLoginScript($playerName, $token), |
| 18 | * new JoinBattleonScript(), |
| 19 | * new LoadInventoryScript(), |
| 20 | * ]) |
| 21 | */ |
| 22 | final class LoginScript extends SequenceScript |
| 23 | { |
| 24 | public function __construct(PlayerName $playerName, #[\SensitiveParameter] string $token) |
| 25 | { |
| 26 | parent::__construct([ |
| 27 | new ConnectAndLoginScript($playerName, $token), |
| 28 | new JoinBattleonScript(), |
| 29 | new LoadInventoryScript(), |
| 30 | ]); |
| 31 | } |
| 32 | } |