pl = $plugin; $this->sock = $sock; $this->datapath = $datapath; $this->isRunning = true; } public function close() { $this->isRunning = false; } public function onRun($tick) { if($this->isRunning) { socket_listen($this->sock); $this->pl->getServer()->getScheduler()->scheduleAsyncTask(new OnlineTask($this->pl, $this->sock, $this->datapath)); } } }