From 4695a6b2da1bfdc25f2dfb408472e8433e9f2c74 Mon Sep 17 00:00:00 2001 From: PEMapModder Date: Fri, 22 Jan 2016 01:32:15 +0800 Subject: [PATCH] Added login reminder --- README.md | 4 ++ compile/HereAuth_Dev.phar | Bin 125563 -> 127902 bytes compile/info.json | 2 +- resources/config.yml | 13 ++++++ src/HereAuth/Task/RemindLoginTask.php | 56 ++++++++++++++++++++++++++ 5 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 src/HereAuth/Task/RemindLoginTask.php 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 a23034a4a57718539a2bbc5e2c0456f762161db3..6beea8c8e4665c72988a857bd41a551796474345 100644 GIT binary patch delta 1535 zcmah}U2GIp6rS7Zbbq=_S__2|rPu8ecI{+;TAG@vTcj<}V#`mhHI@fEbZ&P?r!(Ws ztYza*)9_?4p=AQgOEH8<)CZ$!LSy2CKaBwsj3j7cj1o)~-UzRh5br&A3mY(TANITF z-1D9D-S6Jrwd;X%w*m{VNJdl;vWpXKk%s2;p~X zlmk42UI6?B@%@&Xeu!VM=>c4-8Gv@zngqc(yL!T(7u)?U;zrm^i+cf&iGzUOi~9i^ zYWD$7)D8h&tmSogYKI~2l@0)&lz9B7^b*8!9T#QP^+Eh)-C;l}!228yaFM42U68*T z$S^z=>;R1m+XTUiB){=LLM{HQ!L3l^1$nQpf-gdRKe!99H^jA`2#rAedx#(W*>G-z z`8Om9!tinR@+Bm|XFL6NovHL7amenXS4fYk?wjdRGNYT?u$9+M7N_ijy)z&PtO3It z2RBdqZ-lcj;aphZlfth7cGn*PJYCP@yY*ub4@S6~euTU8SELj2TcQcT{%Eq{pB_Gh zVRnC0zyEIZH`KX2zCmmZbSs@%rR(|QldUV0t!S-j<*5{s#ri6#<-sgUN%0v~H~pI@ zoBfH^PXEE^rt+>1)Y4!RN4GSb!wKE=k~rb3S6X*ekyAsaN1V4+BPQcasw;_~!yTDq zPc$3~#r?)YyF5S)wM4X0ViVQV%{((E5%&tZE8{rt{%}!NPoZbZpLd|mqC@ij&8rEe zdejJUT{TZqqa?4pbSfPgTVG?_AgW7ZmC=R;^zQ$n!~HNWEFL4y5U*fqZ1h|;cdTR+ zMzJlsXjg{l(}_4Q$GKb%$EFIZ7fZgwjvk6nAETbdTw-b!)iLnoJz}`zaiXWwmQV1u zkJ0oa(i8iKKuYlZht;6reAbRr*skCw1kvgupFw(7dGmZM?%_$&~~8et4K_mBvJ z{+HE;*(G9Y8qZYT5vZQS2W?NcOjm*aG6n}^OwC~XjHB=zl;gb)d8{JCsn6^NrYo2| z!1Q5eFEA~@;tr;xSUkb>G8Txs_bfhOz8$L{nC@qV@b9sDgZVma5J%;(If3~b*#f~d zD?7xTKz4{Dr?Q)Z#m}-EfapmaMqoEikYixT=g~Ycc|N1$*19KifP z9QI(^juYb6Zcbk?|28MYmain = $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); + } + } + } +}