當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dog::getUser方法代碼示例

本文整理匯總了PHP中Dog::getUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dog::getUser方法的具體用法?PHP Dog::getUser怎麽用?PHP Dog::getUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dog的用法示例。


在下文中一共展示了Dog::getUser方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: on_note_Pb

 public function on_note_Pb()
 {
     $server = Dog::getServer();
     $user = Dog::getUser();
     $message = $this->msgarg();
     $command = Common::substrUntil($message, ' ', $message);
     $message = Common::substrFrom($message, ' ', '');
     switch ($command) {
         case 'send':
             $out = $this->onSend($server, $user, $message);
             break;
         case 'read':
             $out = $this->onRead($server, $user, $message);
             break;
         case 'delete':
             $out = $this->onDelete($server, $user, $message);
             break;
         case 'search':
             $out = $this->onSearch($server, $user, $message);
             break;
         default:
         case 'help':
             $this->onHelp();
             return;
     }
     $this->reply($out);
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:27,代碼來源:DOGMOD_Notes.php

示例2: on_autojoin_Ac

 public function on_autojoin_Ac()
 {
     $user = Dog::getUser();
     $server = Dog::getServer();
     $argv = $this->argv();
     $argc = count($argv);
     # Invoked in channel.
     switch ($argc) {
         # .autojoin
         case 0:
             return $this->showStatus($channel);
             # .autojoin on|#channel
         # .autojoin on|#channel
         case 1:
             if (Dog_Var::isValid('b', $argv[0])) {
                 return $this->setEnabled($channel, Dog_Var::parseValue('b', $argv[0]));
             } elseif (false === ($channel = Dog::getOrLoadChannelByArg($argv[0]))) {
                 return Dog::rply('err_channel');
             } else {
                 return $this->showStatus($channel);
             }
             # .autojoin #wechall on
         # .autojoin #wechall on
         case 2:
             if (false === ($channel = Dog::getOrLoadChannelByArg($argv[0]))) {
                 return Dog::rply('err_channel');
             }
             if (!Dog::hasPermission($server, $channel, $user, 'A')) {
                 return Dog::noPermission('s');
             }
             return $this->setEnabled($channel, Dog_Var::parseValue('b', $argv[1]));
     }
     $this->showHelp('autojoin');
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:34,代碼來源:DOGMOD_AutoJoin.php

示例3: event_join

 public function event_join()
 {
     $user = Dog::getUser();
     $server = Dog::getServer();
     $channel = Dog::getChannel();
     $cid = $channel->getID();
     if (Dog::isItself() || Dog_Greeting::hasBeenGreeted($user->getID(), $cid) || false === ($greeting = Dog_GreetMsg::getGreetMsg($server, $channel)) || $greeting->isDisabled()) {
         return;
     }
     $message = $greeting->getVar('dgm_msg');
     switch ($greeting->getGreetMode()) {
         case Dog_GreetMsg::MODE_CHAN:
             $server->sendPRIVMSG($channel->getName(), $user->getName() . ': ' . $message);
             break;
         case Dog_GreetMsg::MODE_NOTICE:
             $server->sendNOTICE($user->getName(), $message);
             break;
         case Dog_GreetMsg::MODE_PRIVMSG:
             $server->sendPRIVMSG($user->getName(), $message);
             break;
         default:
             Dog_Log::error('Invalid type of greeting in ' . __FILE__ . ' line ' . __LINE__ . '!');
             return;
     }
     Dog_Greeting::markGreeted($user->getID(), $cid);
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:26,代碼來源:DOGMOD_Greetings.php

示例4: getAutoTargetISO

 private static function getAutoTargetISO()
 {
     if (false !== ($channel = Dog::getChannel())) {
         return $channel->getLangISO();
     } else {
         return Dog::getUser()->getLangISO();
     }
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:8,代碼來源:DOGMOD_Translate.php

示例5: event_privmsg

 /**
  * We hook into PRIVMSG to record activity.
  */
 public function event_privmsg()
 {
     if (!Dog::isTriggered()) {
         if (false !== Dog::getUser()) {
             Dog_Seen::record(Dog::getUser(), Dog::getChannel(), 'privmsg', $this->msg());
         }
     }
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:11,代碼來源:DOGMOD_Seen.php

示例6: on_hang_Pc

 public function on_hang_Pc()
 {
     $channel = Dog::getChannel();
     if (false === isset($this->instances[$channel->getID()])) {
         $config = array('solution_allowed_everytime' => $this->getConfig('solve_anytime', 'c') === '1', 'placeholder' => $this->getConfig('placeholder', 'c'), 'lives' => $this->getConfig('lives', 'c'), 'singleplayer' => $this->getConfig('singleplayer', 'c') === '1');
         $this->instances[$channel->getID()] = new HangmanGame($config);
     }
     $hang = $this->instances[$channel->getID()];
     $hang instanceof HangmanGame;
     $this->reply($hang->onGuess(Dog::getUser()->getName(), $this->msgarg()));
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:11,代碼來源:DOGMOD_Hangman.php

示例7: announceVideo

 private function announceVideo(array $data)
 {
     // Pick ISO for channel?
     if (false !== ($chan = Dog::getChannel())) {
         $iso = $chan->getLangISO();
     } else {
         $iso = Dog::getUser()->getLangISO();
     }
     $vars = array($data['title'], GWF_TimeConvert::humanDurationISO($iso, $data['duration']), sprintf('%.02f', $data['rating']), number_format($data['views']), number_format($data['num_raters']));
     Dog::reply($this->langISO($iso, 'video', $vars));
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:11,代碼來源:DOGMOD_YouTube.php

示例8: event_privmsg

 public function event_privmsg()
 {
     if (!Dog::isTriggered() && $this->collectorEnabled()) {
         $user = Dog::getUser();
         if (preg_match_all('#(https?://[^\\ ]+)#D', $this->msg(), $matches)) {
             array_shift($matches);
             foreach ($matches as $match) {
                 $this->onAdd($user, $match[0]);
             }
         }
     }
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:12,代碼來源:DOGMOD_Link.php

示例9: on_scum_Pc

 public function on_scum_Pc()
 {
     if (false === ($chanel = Dog::getChannel())) {
         return Dog::rply('err_only_channel');
     }
     $user = Dog::getUser();
     $msg = $this->msgarg();
     $command = Common::substrUntil($msg, ' ', $msg);
     $message = Common::substrFrom($msg, ' ', '');
     switch ($command) {
         case '':
         case 'help':
             $out = $this->scumHelp($message);
             break;
         case 'init':
             $out = $this->scumInit($user);
             break;
         case 'join':
             $out = $this->scumJoin($user);
             break;
         case 'start':
             $out = $this->scumStart($user);
             break;
         case 'cards':
             $out = $this->scumCards($user);
             break;
         case 'turn':
         case 'deck':
             $out = $this->scumDeck($user);
             break;
         case 'top5':
             $out = $this->scumTop5($user, $message);
             break;
         case 'stats':
             $out = $this->scumStats($user, $message);
             break;
         case 'abort':
             $out = $this->scumAbort($user);
             break;
         case 'pass':
             $out = $this->scumPass($user);
             break;
         default:
             $out = $this->scumPlay($user, $msg, false);
             break;
     }
     return Dog::reply($out);
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:48,代碼來源:DOGMOD_Scum.php

示例10: event_notice

 public function event_notice()
 {
     if (false !== ($user = Dog::getUser())) {
         if (!strcasecmp($user->getName(), 'NickServ')) {
             if (preg_match('/^STATUS ([^ ]+) ([0-9])$/Di', $this->msgarg(), $matches)) {
                 $server = Dog::getServer();
                 $nickname = $matches[1];
                 $status = (int) $matches[2];
                 if (!$this->probingNickservStatus($server, $nickname, $status) && $status === 3) {
                     if (false !== ($user = $server->getUserByName($nickname))) {
                         $this->onAutoLogin($user);
                     }
                 }
             }
         }
     }
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:17,代碼來源:DOGMOD_AutoLogin.php

示例11: getItemDescription

 public function getItemDescription()
 {
     if (false === ($user = Dog::getUser())) {
         $username = '';
     } else {
         $username = $user->getName();
     }
     $partner = 'Your PC';
     switch ($username) {
         case 'ynori7':
             $partner = 'CPUkiller';
             break;
         case 'CPUkiller':
             $partner = 'ynori7';
             break;
     }
     return 'Your wedding ring. You are currently married to ' . $partner . '.';
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:18,代碼來源:WeddingRing.php

示例12: dogplug_help_all

 function dogplug_help_all($entry, $fullpath, $cutlen)
 {
     global $DPH_ALL;
     $priv = $entry[0];
     $chan = Dog::getChannel();
     $serv = Dog::getServer();
     $user = Dog::getUser();
     $name = substr($entry, 0, -7);
     if (false !== ($plug = Dog_Plugin::getPlugWithPerms($serv, $chan, $user, $name)) && $plug->isEnabled($serv, $chan)) {
         $dir = substr($fullpath, $cutlen);
         $dir = substr($dir, 0, strrpos($dir, '/'));
         if (!isset($DPH_ALL[$dir])) {
             $DPH_ALL[$dir] = array();
         }
         if (!array_search($name, $DPH_ALL[$dir], true)) {
             $DPH_ALL[$dir][] = $name;
         }
     }
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:19,代碼來源:help_Pb.php

示例13: parse_url

    $prot = $server->isSSL() ? 'ircs' : 'irc';
    $port = $server->getPort();
} else {
    $url = parse_url($argv[0]);
    if (!isset($url['host'])) {
        return $plugin->rply('err_url');
    }
    $host = $url['host'];
    $prot = isset($url['scheme']) ? strtolower($url['scheme']) : 'irc';
    if ($prot !== 'irc' && $prot !== 'ircs') {
        return $plugin->rply('err_url');
    }
    $default_port = $prot === 'ircs' ? 6697 : 6667;
    $port = isset($url['port']) ? intval($url['port']) : $default_port;
    $options = Dog_Server::DEFAULT_OPTIONS;
    $options |= $prot === 'ircs' ? Dog_Server::SSL : 0;
}
if (false !== ($server = Dog::getServerByArg($argv[0])) || false !== ($server = Dog::getServerByArg($host))) {
    $plugin->reply('reconnecting');
    $server->saveOption(Dog_Server::ACTIVE, true);
    $server->saveOption(Dog_Server::SSL, $prot === 'ircs');
    $server->saveVar('serv_port', $port);
} else {
    $plugin->reply('adding_server');
    $server = Dog_Server::getOrCreate($host, $port, $options);
    $server->setVar('dog_connector', Dog::getUser());
    $server->setConf('ircoppass', GWF_Random::randomKey(8));
    Dog::addServer($server);
}
$server->setConnectIn(0.5);
$plugin->rply('connect');
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:31,代碼來源:join_server_Ib.php

示例14: array

<?php

$lang = array('en' => array('help' => 'You can use this function to goto bed. It works!', 'm1' => 'nighty night %s!', 'm2' => 'good night %s.'));
$plugin = Dog::getPlugin();
$channel = Dog::getChannel();
$plugin->reply($plugin->lang('m' . rand(1, 2), array(Dog::getUser()->displayName())));
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:6,代碼來源:bed_Pc.php

示例15: on_slaptop5_Pb

 public function on_slaptop5_Pb()
 {
     $this->reply($this->onTop5(Dog::getUser(), $this->msgarg()));
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:4,代碼來源:DOGMOD_Slapwarz.php


注:本文中的Dog::getUser方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。