예제 #1
0
파일: nickserv.php 프로젝트: unnes/deerkins
 function identify()
 {
     if (Mootyconf::get_value($this->pluginspace . '::password') != '') {
         $this->main->log('Identifying with NickServ...', __CLASS__);
         $this->main->message(IRCINE_TYPE_PRIV, $this->nickserv, 'IDENTIFY ' . Mootyconf::get_value($this->pluginspace . '::password'), IRCINE_PRIO_CRITICAL);
     }
 }
예제 #2
0
파일: ctcp.php 프로젝트: unnes/deerkins
 function call($processed_data)
 {
     $reply = false;
     $ctcp = explode(' ', trim($processed_data['message']));
     $command = array_shift($ctcp);
     $rest = implode(' ', $ctcp);
     switch ($command) {
         case 'VERSION':
             $reply = 'VERSION ' . Mootyconf::get_value('deerkins::ircname');
             break;
         case 'PING':
             $reply = 'PING ' . $rest;
             break;
         case 'TIME':
             $reply = 'TIME ' . date("D M j H:i:s Y");
             break;
         case 'ACTION':
             return;
         default:
             $this->log('unknown CTCP type: ' . $command);
             return NULL;
     }
     if ($reply) {
         $this->log('Plugin triggered, sending ' . $command . ' reply');
         $this->message(IRCINE_TYPE_CTCP_REPLY, $processed_data['nick'], $reply, IRCINE_PRIO_CRITICAL);
     }
 }
예제 #3
0
파일: admin.php 프로젝트: unnes/deerkins
 function install()
 {
     parent::install();
     $admins = Mootyconf::get_values($this->pluginspace . '::admins');
     foreach ($admins as $a => $admin) {
         if ($admin == '') {
             continue;
         }
         $this->admins[] = array('nick' => $admin, 'host' => Mootyconf::get_value('plugin::' . $this->module . '::' . $admin . '::host'), 'password' => Mootyconf::get_value('plugin::' . $this->module . '::' . $admin . '::password'));
     }
 }
예제 #4
0
 public function install()
 {
     $triggers = Mootyconf::get_values($this->pluginspace . '::active');
     foreach ($triggers as $a => $trigger) {
         $this->register_trigger($trigger, Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::type'), Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::description'), Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::message'), Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::args'), Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::exec'));
         if (Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::hide') == '' && (Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::type') == 'PRIVMSG' || Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::type') == 'action')) {
             $this->help_triggers[] = array('trigger' => $trigger, 'description' => Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::description'));
         }
         $this->triggers[] = array('trigger' => $trigger, 'type' => Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::type'));
     }
     $this->log('installed');
 }
예제 #5
0
파일: deerme.php 프로젝트: unnes/deerkins
 function install()
 {
     parent::install();
     $this->deer_timeout = Mootyconf::get_value($this->pluginspace . '::timeout');
     $this->timeout_punish = Mootyconf::get_value($this->pluginspace . '::timeout_punish');
     $this->deeritor = Mootyconf::get_value('plugin::deerme::deeritor');
     $this->banlist = array('nick' => Mootyconf::get_values('plugin::deerme::ignore_nick'), 'host' => Mootyconf::get_values('plugin::deerme::ignore_host'), 'channel' => Mootyconf::get_values('plugin::deerme::ignore_channel'));
     $this->privileged_match = Mootyconf::get_values('plugin::deerme::privileged_match');
     $privileged = Mootyconf::get_values($this->pluginspace . '::privileged');
     foreach ($privileged as $a => $user) {
         $this->deer_privileged[] = array('nick' => $user, 'host' => Mootyconf::get_value('plugin::' . $this->module . '::' . $user . '::host'), 'timeout' => Mootyconf::get_value('plugin::' . $this->module . '::' . $user . '::timeout'));
     }
 }
예제 #6
0
파일: talk.php 프로젝트: unnes/deerkins
 function call($processed_data)
 {
     $message = explode(' ', $processed_data['message']);
     $trigger = array_shift($message);
     $takes_args = Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::args') == 'none' ? false : true;
     if (count($message) > 0 && !$takes_args) {
         return;
     }
     switch (Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::reply_type')) {
         case 'action':
             $this->action($processed_data['recepient'], str_replace(array('%bold', '%sender'), array(chr(2), $processed_data['nick']), Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::message')), IRCINE_PRIO_MEDIUM);
             break;
         case 'notice':
             $this->notice($processed_data['recepient'], str_replace(array('%bold', '%sender'), array(chr(2), $processed_data['nick']), Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::message')), IRCINE_PRIO_MEDIUM);
             break;
         case 'say':
         default:
             $this->say($processed_data['recepient'], str_replace(array('%bold', '%sender'), array(chr(2), $processed_data['nick']), Mootyconf::get_value('plugin::' . $this->module . '::' . $trigger . '::message')), IRCINE_PRIO_MEDIUM);
     }
 }
예제 #7
0
파일: halp.php 프로젝트: unnes/deerkins
 function install()
 {
     parent::install();
     $this->halp_list_file = MODULE_PATH . Mootyconf::get_value('plugin::halp::halplist');
     $this->load_halp_list();
 }
예제 #8
0
 function handshake()
 {
     $match = array();
     $pattern = "/^\\:(.*)\\ ([0-9]{3})\\ (" . Mootyconf::get_value('deerkins::nick') . ")\\ \\:(.*)\$/";
     preg_match($pattern, $this->main->data, $match);
     if (empty($match)) {
         return;
     }
     if ($match[2] == '001') {
         $this->handshake = 1;
         $this->main->log('Successfully authenticated', __CLASS__);
     }
     if ($match[2] == '376') {
         $this->handshake = 2;
         $this->main->log('MOTD complete, joining channels.', __CLASS__);
         $this->part_join_channels($this->info['channels']);
         // Joins the channels.
     }
 }
예제 #9
0
파일: ircine.php 프로젝트: unnes/deerkins
 function log($msg, $handler = __CLASS__)
 {
     $prefix = strpos($msg, '<--') === false && strpos($msg, '-->') === false ? ' -!- ' : ' ';
     $msg = str_replace(array("\n", "\r"), '', $msg);
     if (is_object($handler)) {
         $handler = get_class($handler);
     } elseif (!$handler) {
         $handler = get_class($this);
     }
     $log = date("Y-m-d H:i:s") . ' ' . Mootyconf::get_value('deerkins::nick') . ' ( ' . $handler . ' ) !? ' . $prefix . $msg;
     $output = date("Y-m-d H:i:s") . ' ' . Mootyconf::get_value('deerkins::nick') . ' ' . Bashful::bold() . '(' . Bashful::unbold() . ' ' . $handler . ' ' . Bashful::bold() . ')' . Bashful::unbold() . $prefix . $msg;
     if ($this->debuglevel == IRCINE_DEBUG_HIGH || $this->debuglevel == IRCINE_DEBUG_MEDIUM) {
         if (!@fwrite($this->log_handle, $log . PHP_EOL)) {
             $output .= " [NO LOG]";
         }
     }
     echo $output . PHP_EOL;
 }