本文整理汇总了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();
}
示例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()));
}
}
}
示例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;
}
示例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!'));
}
}
示例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();
}
示例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]);
}
}
}
示例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;
}
示例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;
}
示例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);
}
示例10: isOver
public function isOver()
{
return $this->time_end < Shadowrun4::getTime();
}
示例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)));
}
示例12: displayContactETA
public function displayContactETA()
{
$duration = $this->getVar('sr4pa_contact_eta') - Shadowrun4::getTime();
return $duration <= 0 ? '0s' : GWF_Time::humanDuration($duration);
}
示例13: getBusyLeft
public function getBusyLeft()
{
return $this->combat_eta - Shadowrun4::getTime();
}
示例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, ',; ');
}
示例15: isBreaking
public function isBreaking()
{
if ($this->isItemStackable()) {
return false;
}
$d = $this->getDuration();
if ($d > 0) {
return $d < Shadowrun4::getTime();
} else {
return false;
}
}