diff --git a/README.md b/README.md index 7c2dd33..b9fd0c0 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,7 @@ Features - [x] Server-customized messages - [x] Extensive audit logging - [ ] An extensive API (W.I.P.) + +Entry script +=== +Open this phar directly with PHP binaries to automatically extract the config files. diff --git a/compile/HereAuth_Dev.phar b/compile/HereAuth_Dev.phar index a23034a..6beea8c 100644 Binary files a/compile/HereAuth_Dev.phar and b/compile/HereAuth_Dev.phar differ diff --git a/compile/info.json b/compile/info.json index ded3203..8010d39 100644 --- a/compile/info.json +++ b/compile/info.json @@ -9,5 +9,5 @@ "major": 1, "minor": 0 }, - "nextBuild": 83 + "nextBuild": 84 } \ No newline at end of file diff --git a/resources/config.yml b/resources/config.yml index 61e4438..0156fa7 100644 --- a/resources/config.yml +++ b/resources/config.yml @@ -86,6 +86,19 @@ MultiSesCtrl: # This won't block the message if it contains anything other than the pssword, including spaces. BlockPasswordChat: true +# Send chat/tip/popup to remind player to register/login +RemindLogin: + # Messages to send to players + Message: + Register: Please register by typing password into chat + Login: Please login by typing password into chat + # Type of message. + # Options: chat, popup, tip + Type: popup + # Frequency interval, in seconds, of how often to send the message + # Value is rounded down to 0.05 second + Interval: 0.5 + # Force players to register before playing ForceRegister: # If this is set to false, players have to execute /register to register. diff --git a/src/HereAuth/Task/RemindLoginTask.php b/src/HereAuth/Task/RemindLoginTask.php new file mode 100644 index 0000000..09b017e --- /dev/null +++ b/src/HereAuth/Task/RemindLoginTask.php @@ -0,0 +1,56 @@ +main = $main); + $period = (int) ($main->getConfig()->getNested("RemindLogin.Interval", 0.5) * 20); + $main->getServer()->getScheduler()->scheduleDelayedRepeatingTask($this, $period, $period); + } + + public function onRun($currentTick){ + $reg = $this->main->getConfig()->getNested("RemindLogin.Message.Register", "Register please"); + $log = $this->main->getConfig()->getNested("RemindLogin.Message.Login", "Login please"); + $method = $this->main->getConfig()->getNested("RemindLogin.Type", "popup"); + if($method === "chat"){ + $fx = "sendMessage"; + }elseif($method === "tip"){ + $fx = "sendTip"; + }else{ + $fx = "sendPopup"; + } + foreach($this->main->getUsers() as $user){ + if($user->isRegistering()){ + $user->getPlayer()->$fx($reg); + }elseif($user->isLoggingIn()){ + $user->getPlayer()->$fx($log); + } + } + } +}