X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=blobdiff_plain;f=Bots%2FMCBot.class.php;fp=Bots%2FMCBot.class.php;h=8b502809c3ff196cfee4dffbd8caf75947b8d970;hp=6d88ed31a79c5d835f8d7d8153701a7d4bd57080;hb=7f51193ddac01b0540000c756c50167ff015e02a;hpb=811bc0c7a1f583fb624a0f8c3601146e063c5a25 diff --git a/Bots/MCBot.class.php b/Bots/MCBot.class.php index 6d88ed3..8b50280 100644 --- a/Bots/MCBot.class.php +++ b/Bots/MCBot.class.php @@ -6,7 +6,7 @@ * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * - * * + * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * @@ -16,7 +16,7 @@ * along with this program. If not, see . * * * ************************************************************************ - * + * * Bots/MCBot.class.php * * MCBot bot... @@ -26,7 +26,7 @@ class {$_NAME} extends Bot { private $uplink; private $mcbot; - + public function load($uplink, $old = false) { $this->uplink = $uplink; if(!$old) { @@ -44,11 +44,11 @@ class {$_NAME} extends Bot { } else { $this->mcbot = $old; } - + ModCMD::bind($this, BIND_JOIN, "recive_join"); ModCMD::bind($this, BIND_QUIT, "recive_quit"); } - + public function unload($rehash = false) { if($rehash) { return $this->mcbot; @@ -56,19 +56,19 @@ class {$_NAME} extends Bot { $this->uplink->delUser($this->mcbot, "Bye."); } } - + private function botOppedOnChannel($channel) { $privs = $channel->getUserPrivs($this->mcbot); return ($privs & P10_Channel::USERPRIV_OPED); } - + public function recive_join($user, $channel, $isBurst) { if(!$this->botOppedOnChannel($channel)) return false; if(preg_match("#(.*).spoof.minecraft.WebGamesNet#i",$user->getHost())) { $this->uplink->mode($this->mcbot, $channel, "+v ".$user->getNumeric()); } } - + public function recive_quit($user, $reason) { if($user === $this->mcbot) { $this->load($this->uplink);