@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | public function onDisable() |
38 | 38 | { |
39 | - if($this->connector !== null) |
|
39 | + if ($this->connector !== null) |
|
40 | 40 | { |
41 | 41 | $this->connector->close(); |
42 | 42 | } |
@@ -21,8 +21,7 @@ discard block |
||
21 | 21 | private $manager; |
22 | 22 | /** @var DataConnector */ |
23 | 23 | private $connector; |
24 | - public function onEnable() |
|
25 | - { |
|
24 | + public function onEnable() { |
|
26 | 25 | $this->saveDefaultConfig(); |
27 | 26 | $this->connector = $connector = libasynql::create( |
28 | 27 | $this, |
@@ -34,10 +33,8 @@ discard block |
||
34 | 33 | $this->manager = new TableManager($connector); |
35 | 34 | } |
36 | 35 | |
37 | - public function onDisable() |
|
38 | - { |
|
39 | - if($this->connector !== null) |
|
40 | - { |
|
36 | + public function onDisable() { |
|
37 | + if($this->connector !== null) { |
|
41 | 38 | $this->connector->close(); |
42 | 39 | } |
43 | 40 | } |
@@ -26,8 +26,7 @@ |
||
26 | 26 | /** @var Dual */ |
27 | 27 | protected $dual; |
28 | 28 | |
29 | - public function __construct(DataConnector $connector) |
|
30 | - { |
|
29 | + public function __construct(DataConnector $connector) { |
|
31 | 30 | $this->connector = $connector; |
32 | 31 | $this->accounts = new Accounts($connector); |
33 | 32 | $this->ffapvp = new FFAPvP($connector); |
@@ -15,8 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | /** @var DataConnector */ |
17 | 17 | protected $connector; |
18 | - public final function __construct(DataConnector $connector) |
|
19 | - { |
|
18 | + public final function __construct(DataConnector $connector) { |
|
20 | 19 | $this->connector = $connector; |
21 | 20 | $this->init(); |
22 | 21 | } |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | |
14 | 14 | class FFAPvP extends TableBase |
15 | 15 | { |
16 | - public const INIT = 'userdataprovider.ffapvp.init'; |
|
17 | - public const REGISTER = 'userdataprovider.ffapvp.register'; |
|
18 | - public const UNREGISTER = 'userdataprovider.ffapvp.unregister'; |
|
19 | - public const GET = 'userdataprovider.ffapvp.get'; |
|
20 | - public const ADD_COUNT = 'userdataprovider.ffapvp.addcount'; |
|
16 | + public const INIT = 'userdataprovider.ffapvp.init'; |
|
17 | + public const REGISTER = 'userdataprovider.ffapvp.register'; |
|
18 | + public const UNREGISTER = 'userdataprovider.ffapvp.unregister'; |
|
19 | + public const GET = 'userdataprovider.ffapvp.get'; |
|
20 | + public const ADD_COUNT = 'userdataprovider.ffapvp.addcount'; |
|
21 | 21 | public const GET_RANKING_BY_KILL = 'userdataprovider.ffapvp.getrankingbykill'; |
22 | 22 | public const GET_RANKING_BY_EXP = 'userdataprovider.ffapvp.getrankingbyexp'; |
23 | 23 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function unregister(IPLayer $player, ?callable $onSuccess = null, ?callable $onError = null): void |
50 | 50 | { |
51 | - $this->connector->executeChange(self::UNREGISTER, [$player->getName()], $onSuccess, $onError ); |
|
51 | + $this->connector->executeChange(self::UNREGISTER, [$player->getName()], $onSuccess, $onError); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * @param IPlayer $player |
105 | 105 | * @param int $exp |
106 | 106 | */ |
107 | - public function addExp(IPlayer $player,int $exp) |
|
107 | + public function addExp(IPlayer $player, int $exp) |
|
108 | 108 | { |
109 | 109 | $this->add($player, 0, 0, $exp); |
110 | 110 | } |
@@ -71,8 +71,7 @@ discard block |
||
71 | 71 | * @param int $death |
72 | 72 | * @param int $exp |
73 | 73 | */ |
74 | - public function add(IPlayer $player, int $kill = 0, int $death = 0, int $exp = 0) |
|
75 | - { |
|
74 | + public function add(IPlayer $player, int $kill = 0, int $death = 0, int $exp = 0) { |
|
76 | 75 | $this->connector->executeChange(self::ADD_COUNT, [$player->getName(), $kill, $death, $exp]); |
77 | 76 | } |
78 | 77 | |
@@ -82,8 +81,7 @@ discard block |
||
82 | 81 | * @param IPlayer $player |
83 | 82 | * @param int $kill |
84 | 83 | */ |
85 | - public function addKill(IPlayer $player, int $kill) |
|
86 | - { |
|
84 | + public function addKill(IPlayer $player, int $kill) { |
|
87 | 85 | $this->add($player, $kill); |
88 | 86 | } |
89 | 87 | |
@@ -93,8 +91,7 @@ discard block |
||
93 | 91 | * @param IPlayer $player |
94 | 92 | * @param int $death |
95 | 93 | */ |
96 | - public function addDeath(IPlayer $player, int $death) |
|
97 | - { |
|
94 | + public function addDeath(IPlayer $player, int $death) { |
|
98 | 95 | $this->add($player, 0, $death); |
99 | 96 | } |
100 | 97 | |
@@ -104,8 +101,7 @@ discard block |
||
104 | 101 | * @param IPlayer $player |
105 | 102 | * @param int $exp |
106 | 103 | */ |
107 | - public function addExp(IPlayer $player,int $exp) |
|
108 | - { |
|
104 | + public function addExp(IPlayer $player,int $exp) { |
|
109 | 105 | $this->add($player, 0, 0, $exp); |
110 | 106 | } |
111 | 107 |
@@ -54,7 +54,7 @@ |
||
54 | 54 | * @param callable|null $onSelect |
55 | 55 | * @param callable|null $onError |
56 | 56 | */ |
57 | - public function get(IPlayer $player, ?callable $onSelect = null, ?callable $onError = null){ |
|
57 | + public function get(IPlayer $player, ?callable $onSelect = null, ?callable $onError = null) { |
|
58 | 58 | $this->connector->executeSelect(self::ACCOUNT_GET, [$player->getName()], $onSelect, $onError); |
59 | 59 | } |
60 | 60 | } |
61 | 61 | \ No newline at end of file |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | * @param callable|null $onInserted |
31 | 31 | * @param callable|null $onError |
32 | 32 | */ |
33 | - public function register(IPlayer $player, ?callable $onInserted = null, ?callable $onError = null) |
|
34 | - { |
|
33 | + public function register(IPlayer $player, ?callable $onInserted = null, ?callable $onError = null) { |
|
35 | 34 | $this->connector->executeInsert(self::ACCOUNT_REGISTER, [$player->getName()], $onInserted, $onError); |
36 | 35 | } |
37 | 36 | |
@@ -42,8 +41,7 @@ discard block |
||
42 | 41 | * @param callable|null $onSuccess |
43 | 42 | * @param callable|null $onError |
44 | 43 | */ |
45 | - public function unregister(IPlayer $player, ?callable $onSuccess = null, ?callable $onError = null) |
|
46 | - { |
|
44 | + public function unregister(IPlayer $player, ?callable $onSuccess = null, ?callable $onError = null) { |
|
47 | 45 | $this->connector->executeChange(self::ACCOUNT_UNREGISTER, [$player->getName()], $onSuccess, $onError); |
48 | 46 | } |
49 | 47 | |
@@ -54,7 +52,7 @@ discard block |
||
54 | 52 | * @param callable|null $onSelect |
55 | 53 | * @param callable|null $onError |
56 | 54 | */ |
57 | - public function get(IPlayer $player, ?callable $onSelect = null, ?callable $onError = null){ |
|
55 | + public function get(IPlayer $player, ?callable $onSelect = null, ?callable $onError = null) { |
|
58 | 56 | $this->connector->executeSelect(self::ACCOUNT_GET, [$player->getName()], $onSelect, $onError); |
59 | 57 | } |
60 | 58 | } |
61 | 59 | \ No newline at end of file |
@@ -13,11 +13,11 @@ |
||
13 | 13 | |
14 | 14 | class Dual extends TableBase |
15 | 15 | { |
16 | - public const INIT = 'userdataprovider.duel.init'; |
|
17 | - public const REGISTER = 'userdataprovider.duel.register'; |
|
16 | + public const INIT = 'userdataprovider.duel.init'; |
|
17 | + public const REGISTER = 'userdataprovider.duel.register'; |
|
18 | 18 | public const UNREGISTER = 'userdataprovider.duel.unregister'; |
19 | - public const GET = 'userdataprovider.duel.get'; |
|
20 | - public const ADD_COUNT = 'userdataprovider.duel.addcount'; |
|
19 | + public const GET = 'userdataprovider.duel.get'; |
|
20 | + public const ADD_COUNT = 'userdataprovider.duel.addcount'; |
|
21 | 21 | public const GET_RANKING = 'userdataprovider.duel.getrankingbywin'; |
22 | 22 | |
23 | 23 | public function init(): void |