Fixing a bug
This commit is contained in:
parent
03643fb4af
commit
26a0822850
2 changed files with 2 additions and 0 deletions
|
@ -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"));
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue