From 26a0822850fa0c9ad7716e6cfd4c8203ed400783 Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Tue, 31 May 2016 19:43:30 +0200 Subject: [PATCH] Fixing a bug --- src/Ad5001/Online/Main.php | 1 + src/Ad5001/Online/OnlineTask.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Ad5001/Online/Main.php b/src/Ad5001/Online/Main.php index d1c2348..27738e2 100644 --- a/src/Ad5001/Online/Main.php +++ b/src/Ad5001/Online/Main.php @@ -33,6 +33,7 @@ $port = $this->getConfig()->get("port"); $sock = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n"); $result = socket_bind($sock, $address, $port) or die('Could not bind to address'); +$this->getLogger()->info("Website open in port §a" . $port); $this->socket = new isOnlineTask($this, $sock, $this->getDataFolder()); $this->getServer()->getScheduler()->scheduleRepeatingTask($this->socket, $this->getConfig()->get("TimePerConnection")); diff --git a/src/Ad5001/Online/OnlineTask.php b/src/Ad5001/Online/OnlineTask.php index 928dc19..72eb2c7 100644 --- a/src/Ad5001/Online/OnlineTask.php +++ b/src/Ad5001/Online/OnlineTask.php @@ -29,6 +29,7 @@ use pocketmine\math\Vector3; $this->isRunning = false; } public function onRun() { + socket_listen($this->sock); $sock = $this->sock; $client = socket_accept($sock); $input = socket_read($client, 1024);