Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
LoginScript
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace AqwSocketClient\Scripts;
6
7use 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 */
22final 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}