Fixing a bug

This commit is contained in:
Ad5001 2016-05-31 19:43:30 +02:00
parent 03643fb4af
commit 26a0822850
2 changed files with 2 additions and 0 deletions

View File

@ -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"));

View File

@ -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);