|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
|
|
4
|
|
|
namespace eXpansion\Framework\Core\ChatCommand; |
|
5
|
|
|
use eXpansion\Framework\AdminGroups\Helpers\AdminGroups; |
|
6
|
|
|
use eXpansion\Framework\AdminGroups\Model\AbstractAdminChatCommand; |
|
7
|
|
|
use eXpansion\Framework\Core\Helpers\ChatNotification; |
|
8
|
|
|
use eXpansion\Framework\Core\Services\Application; |
|
9
|
|
|
use eXpansion\Framework\Core\Storage\PlayerStorage; |
|
10
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
|
11
|
|
|
|
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Class StopExpansion |
|
15
|
|
|
* |
|
16
|
|
|
* @package eXpansion\Framework\Core\ChatCommand; |
|
17
|
|
|
* @author oliver de Cramer <[email protected]> |
|
18
|
|
|
*/ |
|
19
|
|
|
class StopExpansion extends AbstractAdminChatCommand |
|
20
|
|
|
{ |
|
21
|
|
|
/** @var ChatNotification */ |
|
22
|
|
|
protected $chatNotificaiton; |
|
23
|
|
|
|
|
24
|
|
|
/** @var Application */ |
|
25
|
|
|
protected $application; |
|
26
|
|
|
|
|
27
|
|
|
/** @var PlayerStorage */ |
|
28
|
|
|
protected $playerStorage; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* StopExpansion constructor. |
|
32
|
|
|
* |
|
33
|
|
|
* @param ChatNotification $chatNotification |
|
34
|
|
|
* @param Application $application |
|
35
|
|
|
* @param PlayerStorage $playerStorage |
|
36
|
|
|
*/ |
|
37
|
|
|
public function __construct( |
|
38
|
|
|
$command, |
|
39
|
|
|
$permission, |
|
40
|
|
|
array $aliases = [], |
|
41
|
|
|
AdminGroups $adminGroups, |
|
42
|
|
|
ChatNotification $chatNotification, |
|
43
|
|
|
Application $application, |
|
44
|
|
|
PlayerStorage $playerStorage |
|
45
|
|
|
) { |
|
46
|
|
|
parent::__construct($command, $permission, $aliases, $adminGroups); |
|
47
|
|
|
|
|
48
|
|
|
$this->chatNotificaiton = $chatNotification; |
|
49
|
|
|
$this->application = $application; |
|
50
|
|
|
$this->playerStorage = $playerStorage; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
public function getDescription() |
|
54
|
|
|
{ |
|
55
|
|
|
return "expansion_core.chat_commands.stop.help"; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function getHelp() |
|
59
|
|
|
{ |
|
60
|
|
|
return "expansion_core.chat_commands.stop.help"; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @inheritdoc |
|
66
|
|
|
*/ |
|
67
|
|
|
public function execute($login, InputInterface $input) |
|
68
|
|
|
{ |
|
69
|
|
|
$player = $this->playerStorage->getPlayerInfo($login); |
|
70
|
|
|
$this->chatNotificaiton->sendMessage( |
|
71
|
|
|
'expansion_core.chat_commands.stop.message', |
|
72
|
|
|
null, |
|
73
|
|
|
['%nickname%' => $player->getNickName()] |
|
74
|
|
|
); |
|
75
|
|
|
|
|
76
|
|
|
$this->application->stopApplication(); |
|
77
|
|
|
} |
|
78
|
|
|
} |
|
79
|
|
|
|