Пример #1
0
<?php

Dog_Log::error(Dog::getIRCMsg()->getArg(0));
Пример #2
0
<?php

# :gizmore!gizmore@localhost PRIVMSG Dog :.join #sr
if (false === ($user = Dog::getOrCreateUser())) {
    return;
}
$serv = Dog::getServer();
$serv->addUser($user);
$user = Dog::setupUser();
$chan = Dog::setupChannel();
if ($user === false) {
    return Dog::suppressModules();
}
# Log PRIVMSGs
$msg = Dog::getIRCMsg()->getArg(1);
if (Dog::getIRCMsg()->shouldLog()) {
    Dog_Log::user($user, $msg);
    Dog_Log::channel($chan, $msg);
}
# Exec Stuff
if (!$user->isBot()) {
    if ('' !== ($trigger = Common::substrUntil($msg, ' '))) {
        if (Dog_Init::isTrigger($serv, $chan, $trigger[0])) {
            if ($user->isFlooding()) {
                return;
            }
            Dog::setTriggered();
            $trigger = substr($trigger, 1);
            if (false !== ($plug = Dog_Plugin::getPlug($trigger))) {
                if (!$plug->isInScope($serv, $chan)) {
                    Dog::scopeError($plug->getScope());
Пример #3
0
 public function msg()
 {
     return trim(Common::substrFrom(Dog::getIRCMsg()->getArg(1), ' ', ''));
 }
Пример #4
0
<?php

# :Dog!Dawg@localhost JOIN :#sr
$msg = Dog::getIRCMsg();
$serv = Dog::getServer();
if (false === ($user = Dog::getOrCreateUser())) {
    return Dog_Log::critical("Cannot create user!");
}
$serv->addUser($user);
if (false === Dog::setupUser()) {
    return Dog_Log::critical('Cannot setup user!');
}
$chan_name = $msg->getArg(0);
if (false === ($channel = $serv->getChannelByName($chan_name))) {
    if (false === ($channel = Dog_Channel::getOrCreate($serv, $chan_name))) {
        return;
    }
    $serv->addChannel($channel);
}
$channel->addUser($user);
if (false === Dog::setupChannel()) {
    Dog_Log::critical('Cannot setup channel.');
}
Пример #5
0
<?php

if (false === ($user = Dog::getOrCreateUser())) {
    return;
}
$serv = Dog::getServer();
$serv->addUser($user);
$user = Dog::setupUser();
$chan = Dog::setupChannel();
$msg = Dog::getIRCMsg()->getArg(0);
if ($user !== false) {
    Dog_Log::user($user, $msg);
}
if ($chan !== false) {
    Dog_Log::channel($chan, $msg);
}
Пример #6
0
 public function msg()
 {
     return Dog::getIRCMsg()->getArg(1);
 }
Пример #7
0
<?php

$user = Dog::getUser();
$server = Dog::getServer();
$message = Dog::getIRCMsg()->getArg(1);
$cmd = strtolower(Common::substrUntil($message, ' ', $message));
$msg = Common::substrFrom($message, ' ', $message);
switch ($cmd) {
    case "ping":
    case "time":
    case "action":
    case "finger":
        break;
    case 'version':
        $user->sendCTCP(sprintf('VERSION Dog v%s. Http://dog.gizmore.org', DOG_VERSION));
        break;
}
Dog_Module::map('trigger_ctcp', array($cmd, $msg));
Пример #8
0
 /**
  * Called by events to get or create the user.
  * @return Dog_User
  */
 public static function getOrCreateUser()
 {
     $username = Common::substrUntil(Dog::getIRCMsg()->getFrom(), '!');
     return self::getOrCreateUserByName($username);
 }