コード例 #1
0
ファイル: core.php プロジェクト: rickihastings/acorairc
 public static function log_changes(&$ircdata, $startup = false)
 {
     if (ircd::on_server(&$ircdata)) {
         ircd::handle_on_server(&$ircdata);
     }
     // let's us keep track of the linked servers
     if (ircd::on_squit(&$ircdata)) {
         ircd::handle_on_squit(&$ircdata);
     }
     // let's us keep track of the linked servers
     if (ircd::on_connect(&$ircdata)) {
         ircd::handle_on_connect(&$ircdata, $startup);
     }
     // log shit on connect, basically the users host etc.
     if (ircd::on_nick_change(&$ircdata)) {
         ircd::handle_nick_change(&$ircdata, $startup);
     }
     // on nick change, make sure the variable changes too.
     if (ircd::on_quit(&$ircdata)) {
         ircd::handle_quit(&$ircdata, $startup);
     }
     // on quit.
     if (ircd::on_fhost(&$ircdata)) {
         ircd::handle_host_change(&$ircdata);
     }
     // on hostname change.
     if (ircd::on_ident_change(&$ircdata)) {
         ircd::handle_ident_change(&$ircdata);
     }
     // on ident change
     if (ircd::on_gecos_change(&$ircdata)) {
         ircd::handle_gecos_change(&$ircdata);
     }
     // on realname (gecos) change
     if (ircd::on_mode(&$ircdata)) {
         ircd::handle_mode(&$ircdata);
     }
     // on mode
     if (ircd::on_ftopic(&$ircdata)) {
         ircd::handle_ftopic(&$ircdata);
     }
     // on ftopic
     if (ircd::on_topic(&$ircdata)) {
         ircd::handle_topic(&$ircdata);
     }
     // on topic
     if (ircd::on_chan_create(&$ircdata)) {
         ircd::handle_channel_create(&$ircdata);
     }
     // on channel create
     if (ircd::on_join(&$ircdata)) {
         ircd::handle_join(&$ircdata);
     }
     // on join
     if (ircd::on_part(&$ircdata)) {
         ircd::handle_part(&$ircdata);
     }
     // and on part.
     if (ircd::on_kick(&$ircdata)) {
         ircd::handle_kick(&$ircdata);
     }
     // and on kick.
     if (ircd::on_oper_up(&$ircdata)) {
         ircd::handle_oper_up(&$ircdata);
     }
     // on oper ups
 }
コード例 #2
0
ファイル: chanserv.php プロジェクト: rickihastings/acorairc
 public static function on_kick(&$ircdata)
 {
     if (ircd::on_kick(&$ircdata)) {
         $nick = core::get_nick(&$ircdata, 0);
         $chan = core::get_chan(&$ircdata, 2);
         $who = core::get_nick(&$ircdata, 3);
         if ($who == core::$config->chanserv->nick || str_replace(':', '', $ircdata[0]) == array_search(core::$config->chanserv->nick, core::$uids)) {
             ircd::join_chan(core::$config->chanserv->nick, $chan);
             // join the chan.
             core::$chans[$chan]['users'][core::$config->chanserv->nick] = '';
             // add chanserv to the users array, housekeeping it :D
             if (ircd::$protect) {
                 ircd::mode(core::$config->chanserv->nick, $chan, '+ao ' . core::$config->chanserv->nick . ' ' . core::$config->chanserv->nick);
             } else {
                 ircd::mode(core::$config->chanserv->nick, $chan, '+o ' . core::$config->chanserv->nick);
             }
             // +o its self.
         }
         // what the f**k is this tool doing.. kicking us!!?! we SHOULD kick their ass
         // but we're not gonna x]
         if (count(core::$chans[$chan]['users']) == 1 && isset(core::$chans[$chan]['users'][core::$config->chanserv->nick])) {
             ircd::part_chan(core::$config->chanserv->nick, $chan);
             // leave the channel.
         }
         // we're the only person in the channel.. hopefully, lets leave x]
     }
 }