X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=Bots%2FMCBot.class.php;h=8b502809c3ff196cfee4dffbd8caf75947b8d970;hb=cba81599e819e50231c50c531cca7964667a8b0e;hp=1370d97416a3b7b37833973d83002411399e9a68;hpb=d4c87d18a15476cf935e16ed73247c8f0ed6416a;p=PHP-P10.git diff --git a/Bots/MCBot.class.php b/Bots/MCBot.class.php index 1370d97..8b50280 100644 --- a/Bots/MCBot.class.php +++ b/Bots/MCBot.class.php @@ -1,12 +1,12 @@ . * * * ************************************************************************ - * + * * Bots/MCBot.class.php * * MCBot bot... @@ -26,14 +26,14 @@ class {$_NAME} extends Bot { private $uplink; private $mcbot; - + public function load($uplink, $old = false) { $this->uplink = $uplink; if(!$old) { $nick = "MCBot"; $ident = "mcbot"; - $ip = "::0"; //coca cola adds life maybe someone undestands it :D - $host = $ip; + $ip = "0::0"; + $host = "Services.WebGamesNet.net"; $realname = "MineCraft Bot"; $modes = "ioknISD"; $this->mcbot = $this->uplink->addUser($nick,$ident,$host,$ip,$modes,$realname); @@ -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);