当前位置: 首页>>代码示例>>PHP>>正文


PHP Shadowrun4::getTime方法代码示例

本文整理汇总了PHP中Shadowrun4::getTime方法的典型用法代码示例。如果您正苦于以下问题:PHP Shadowrun4::getTime方法的具体用法?PHP Shadowrun4::getTime怎么用?PHP Shadowrun4::getTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shadowrun4的用法示例。


在下文中一共展示了Shadowrun4::getTime方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: hasToLeave

 public function hasToLeave()
 {
     if (!$this->hasConst(self::HIRE_END)) {
         return false;
     }
     return $this->getConst(self::HIRE_END) < Shadowrun4::getTime();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:SR_HireNPC.php

示例2: ai_tick

 public function ai_tick($function, $args = null)
 {
     if (0 < ($interval = $this->getInterval())) {
         if (Shadowrun4::getTime() % $interval === 0) {
             call_user_func_array($this->getArg(1), $this->getArg(2, array()));
         }
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:interval.php

示例3: resetTimer

 public function resetTimer(SR_Player $player)
 {
     $time = Seattle::TIME_TO_DELAWARE + 60;
     $player->setConst('__AURIS_TIMEOUT', Shadowrun4::getTime() + $time);
     $player->message($this->lang('fluid', array(GWF_Time::humanDuration($time))));
     // 		$player->message(sprintf("Your pot of Auris is fluid for %s.", GWF_Time::humanDuration($time)));
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:Delaware_Exams5.php

示例4: setAlert

 public function setAlert(SR_Party $party, $duration = 600, $announce = true)
 {
     $party->setTemp($this->getAlertKey($party), Shadowrun4::getTime() + $duration);
     if ($announce) {
         $party->ntice('5021');
         // 			$party->notice(sprintf('You hear the alarm sound!'));
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:SR_Dungeon.php

示例5: isNoShout

 public static function isNoShout($pid)
 {
     $pid = (int) $pid;
     if (false === ($ends = self::table(__CLASS__)->selectVar('sr4ns_ends', "sr4ns_pid={$pid}"))) {
         return -1;
     }
     if ($ends == 0) {
         return GWF_Time::ONE_DAY;
     }
     return $ends - Shadowrun4::getTime();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:11,代码来源:SR_NoShout.php

示例6: cleanupWhisper

 private static function cleanupWhisper($pid)
 {
     $data = self::$WHISPER[$pid];
     if (count($data) < 2) {
         return;
     }
     $time = Shadowrun4::getTime() - self::WB_TIME;
     foreach ($data as $fid => $t) {
         if ($t < $time) {
             unset(self::$WHISPER[$pid][$fid]);
         }
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:13,代码来源:whisper.php

示例7: tell

 public static function tell($pid, $msg)
 {
     // 		print('TELL: '.$msg.PHP_EOL);
     $pid = (int) $pid;
     $table = self::table(__CLASS__);
     if (false === $table->insertAssoc(array('sr4tl_pid' => $pid, 'sr4tl_time' => Shadowrun4::getTime(), 'sr4tl_msg' => $msg))) {
         return false;
     }
     $where = "sr4tl_pid={$pid}";
     $rows = $table->countRows($where);
     if ($rows > self::MAX_MSGS) {
         // @todo: This is currently broken Oo
         //			if (false === $table->deleteWhere($where, 'sr4tl_time ASC', NULL, 5, 0))
         //			{
         //				return false;
         //			}
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:19,代码来源:SR_Tell.php

示例8: checkKillProtection

 private static function checkKillProtection(SR_Player $player, SR_Party $ep)
 {
     $p = $player->getParty();
     // 		$ep = $p->getEnemyParty();
     if (SR_KillProtect::isKillProtectedRealNPCParty($ep)) {
         return false;
     }
     if (SR_KillProtect::isKillProtectedPartyLevel($p, $ep, $player, true)) {
         return false;
     }
     if (false !== ($time = SR_KillProtect::isKillProtectedParty($p, $ep))) {
         $wait = GWF_Time::humanDuration($time - Shadowrun4::getTime());
         self::rply($player, '1060', array($wait));
         // 			$player->message(sprintf('You cannot attack this party again. Please wait %s.', $wait));
         return false;
     }
     SR_BadKarma::onFight($player, $ep);
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:19,代码来源:fight.php

示例9: cleanupItems

 private static function cleanupItems()
 {
     echo __METHOD__ . PHP_EOL;
     $players = GDO::table('SR_Player');
     $pids = $players->selectColumn('sr4pl_id');
     $items = GDO::table('SR_Item');
     $before = $items->countRows();
     if (false === ($result = $items->select('sr4it_id, sr4it_uid', 'sr4it_uid!=0'))) {
         echo GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
         return;
     }
     $sr_time = Shadowrun4::getTime();
     while (false !== ($row = $items->fetch($result, GDO::ARRAY_N))) {
         if (!in_array($row[1], $pids, true)) {
             $items->deleteWhere("sr4it_id={$row[0]}");
         }
     }
     $items->free($result);
     $after = $items->countRows();
     printf("I removed %s items from the database and %s are left.\n", $before - $after, $after);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:21,代码来源:Shadowcron.php

示例10: isOver

 public function isOver()
 {
     return $this->time_end < Shadowrun4::getTime();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:4,代码来源:SR_Effect.php

示例11: onKilled

 public static function onKilled(SR_Player $killer, SR_Player $victim)
 {
     echo __METHOD__;
     return self::table(__CLASS__)->insertAssoc(array('sr4kp_killer' => $killer->getID(), 'sr4kp_victim' => $victim->getID(), 'sr4kp_srtime' => Shadowrun4::getTime() + self::getKillTime($killer, $victim)));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:5,代码来源:SR_KillProtect.php

示例12: displayContactETA

 public function displayContactETA()
 {
     $duration = $this->getVar('sr4pa_contact_eta') - Shadowrun4::getTime();
     return $duration <= 0 ? '0s' : GWF_Time::humanDuration($duration);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:5,代码来源:SR_Party.php

示例13: getBusyLeft

 public function getBusyLeft()
 {
     return $this->combat_eta - Shadowrun4::getTime();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:4,代码来源:SR_Player.php

示例14: getEffects

 public static function getEffects(SR_Player $player)
 {
     // 		$b = chr(2);
     $e = $player->getEffects();
     if (count($e) === 0) {
         return Shadowrun4::lang('none');
     }
     $sorted = array();
     foreach ($e as $effect) {
         $effect instanceof SR_Effect;
         $t = $effect->getTimeEnd();
         $raw = $effect->getModifiersRaw();
         foreach ($raw as $k => $v) {
             if (isset($sorted[$k])) {
                 $sorted[$k][0] += $v;
                 if ($t < $sorted[$k][1]) {
                     $sorted[$k][1] = $t;
                 }
             } else {
                 $sorted[$k] = array($v, $t);
             }
         }
     }
     $t2 = Shadowrun4::getTime();
     $format = Shadowrun4::lang('fmt_effect');
     $back = '';
     foreach ($sorted as $k => $data) {
         list($v, $t) = $data;
         $back .= sprintf($format, $k, $v, GWF_Time::humanDuration($t - $t2));
         // 			$back .= sprintf(', %s:%s(%s)', $b.$k.$b, $v, GWF_Time::humanDuration($t-$t2));
     }
     return ltrim($back, ',; ');
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:33,代码来源:Shadowfunc.php

示例15: isBreaking

 public function isBreaking()
 {
     if ($this->isItemStackable()) {
         return false;
     }
     $d = $this->getDuration();
     if ($d > 0) {
         return $d < Shadowrun4::getTime();
     } else {
         return false;
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:12,代码来源:SR_Item.php


注:本文中的Shadowrun4::getTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。