All pastes #340220 Raw Edit

Mortal

public php v1 · immutable
·published 2007-02-04 17:14 UTC
rendered paste body
$hasmsg = true;if (!isset($sentmsgs)) $sentmsgs = array();$now = microtime(true);while (count($sentmsgs) > 0 and $sentmsgs[0] < $now) array_shift($sentmsgs);logmsg('Number of sent messages the last 4 seconds: '.count($sentmsgs), DEBUG_DEBUG);if (count($sentmsgs) < 4) {  if (!($msg = array_shift($messages[0]))) if (!($msg = array_shift($messages[1]))) $hasmsg = false;  if ($hasmsg) {    $lastsend = time();    $sentmsgs[] = $now + 2 + 2 * count($sentmsgs);    issuecommand($msg[0], $msg[1]);  }}