raklib\server\SessionManager::tick PHP Метод

tick() приватный Метод

private tick ( )
    private function tick()
    {
        $time = microtime(true);
        foreach ($this->sessions as $session) {
            $session->update($time);
        }
        foreach ($this->ipSec as $address => $count) {
            if ($count >= $this->packetLimit) {
                $this->blockAddress($address);
            }
        }
        $this->ipSec = [];
        if (($this->ticks & 0b1111) === 0) {
            $diff = max(0.005, $time - $this->lastMeasure);
            $this->streamOption("bandwidth", serialize(["up" => $this->sendBytes / $diff, "down" => $this->receiveBytes / $diff]));
            $this->lastMeasure = $time;
            $this->sendBytes = 0;
            $this->receiveBytes = 0;
            if (count($this->block) > 0) {
                asort($this->block);
                $now = microtime(true);
                foreach ($this->block as $address => $timeout) {
                    if ($timeout <= $now) {
                        unset($this->block[$address]);
                    } else {
                        break;
                    }
                }
            }
        }
        ++$this->ticks;
    }