diff --git a/README.md b/README.md index d525f0a..3cc61f0 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Parked domains: You might have seen that the tutorials above haven't covered the whole configs and stuff ! Here are some tips & tricks that what are they here for ! -1. Changing port: Yes, it's not always easy to use port 80 ! It's often binded and stuffs... CHange the value of "port" in the config and set it to your new port and it will work fine ! +1. Changing port: Yes, it's not always easy to use port 80 ! It's often binded... CHange the value of "port" in the config and set it to your new port and it will work fine ! 2. Errors and index: Change index, 404 and 403 to customize even more you're website ! Change them to customisze even more your website ! 404 is when a page is not found, 403 is when the user is not allowed to view this page. You can change them to make it even more customisable ! 3. Denied pages: Sometimes, you don't want the user to see some pages so add them to the denied page array to block them from being viewed ! Example: ```yaml @@ -80,6 +80,119 @@ MACOSX and LINUX: ```bash kill -kill `lsof -t -i tcp:getServer()->getPluginManager()->getPlugin("Online")->setArgument($this, "id of the var", $varToPass); +``` +You can see them by adding this line. +```php +$args = $this->getServer()->getPluginManager()->getPlugin("Online")->getArguments($this); +``` +This gives you the ability to show custom things related to the server on the files. + + +Please note that all variables passed (default & customs) are refreshed every 10 seconfs. +##### Custom handlers. +This is the most powerfull way to customize your webserver. +Custom handlers are PHP files that are executed each time a request to the server is done. +To add a custom handler, create a new PHP file into your plugin src and add this line of code to your main file: +```php +$this->getServer()->getPluginManager()->getPlugin("Online")->addHandler(__DIR__ . "/handler.php"); +``` +You can also see all the handlers by doing: +```php +$handlers = $this->getServer()->getPluginManager()->getPlugin("Online")->getHandlers(); +``` ======= That's it so I hoope you will enjoy my plugin ! diff --git a/src/Ad5001/Online/Main.php b/src/Ad5001/Online/Main.php index 5376b1e..786f960 100644 --- a/src/Ad5001/Online/Main.php +++ b/src/Ad5001/Online/Main.php @@ -209,7 +209,6 @@ class ArgFillTask extends \pocketmine\scheduler\PluginTask { $pl["client_secret"] = $player->getClientSecret(); $pl["banned"] = $player->isBanned(); // I don't know if tis could be to false but we never know xD $pl["whitelisted"] = $player->isWhitelisted(); - $pl["client_secret"] = $player->getClientSecret(); $pl["first_played"] = $player->getFirstPlayed(); $pl["last_played"] = $player->getLastPlayed(); $pl["played_before"] = $player->hasPlayedBefore(); @@ -236,7 +235,6 @@ class ArgFillTask extends \pocketmine\scheduler\PluginTask { $lvl["tick_rate"] = $level->getTickRate(); $lvl["id"] = $level->getId(); $lvl["auto_save"] = $level->getAutoSave(); - $lvl["tick_rate"] = $level->getTickRate(); $lvl["players"] = []; foreach ($level->getPlayers() as $pl) { $lvl["players"][$pl->getName()] = $players[$pl->getName()];