| @@ 7-27 (lines=21) @@ | ||
| 4 | ||
| 5 | use eXpansion\Framework\Core\Storage\Data\Player; |
|
| 6 | ||
| 7 | class Players extends Spectators |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * @inheritdoc |
|
| 11 | */ |
|
| 12 | public function onPlayerConnect(Player $player) |
|
| 13 | { |
|
| 14 | if (!$player->isSpectator()) { |
|
| 15 | $this->userGroup->addLogin($player->getLogin()); |
|
| 16 | } |
|
| 17 | } |
|
| 18 | ||
| 19 | public function onPlayerInfoChanged(Player $oldPlayer, Player $player) |
|
| 20 | { |
|
| 21 | if (!$player->isSpectator()) { |
|
| 22 | $this->userGroup->addLogin($player->getLogin()); |
|
| 23 | } else { |
|
| 24 | $this->userGroup->removeLogin($player->getLogin()); |
|
| 25 | } |
|
| 26 | } |
|
| 27 | } |
|
| @@ 7-27 (lines=21) @@ | ||
| 4 | ||
| 5 | use eXpansion\Framework\Core\Storage\Data\Player; |
|
| 6 | ||
| 7 | class Spectators extends AbstractUserGroupPlugin |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * @inheritdoc |
|
| 11 | */ |
|
| 12 | public function onPlayerConnect(Player $player) |
|
| 13 | { |
|
| 14 | if ($player->isSpectator()) { |
|
| 15 | $this->userGroup->addLogin($player->getLogin()); |
|
| 16 | } |
|
| 17 | } |
|
| 18 | ||
| 19 | public function onPlayerInfoChanged(Player $oldPlayer, Player $player) |
|
| 20 | { |
|
| 21 | if ($player->isSpectator()) { |
|
| 22 | $this->userGroup->addLogin($player->getLogin()); |
|
| 23 | } else { |
|
| 24 | $this->userGroup->removeLogin($player->getLogin()); |
|
| 25 | } |
|
| 26 | } |
|
| 27 | } |
|