Ejemplo n.º 1
0
 public function onTick(ServerClient $client)
 {
     $time = (int) $client->getAttribute('tick');
     if ($time == time()) {
         return;
     }
     $client->setAttribute('tick', time());
     $this->output->writeln(sprintf('<info>Client[%s:%d]</info> :: <comment>%s</comment>', $client->getHost(), $client->getPort(), __METHOD__));
 }
Ejemplo n.º 2
0
 public function onTick(ServerClient $client)
 {
     static $time;
     $time = isset($time) ? $time : 0;
     if ($time == time()) {
         return;
     }
     $time = time();
     $this->output->writeln(sprintf('<info>Client[%s:%d]</info> :: <comment>%s</comment>', $client->getHost(), $client->getPort(), __METHOD__));
 }