Browse Source

Fixing a bug

tags/1.1
Ad5001 4 years ago
parent
commit
26a0822850
2 changed files with 2 additions and 0 deletions
  1. +1
    -0
      src/Ad5001/Online/Main.php
  2. +1
    -0
      src/Ad5001/Online/OnlineTask.php

+ 1
- 0
src/Ad5001/Online/Main.php 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"));


+ 1
- 0
src/Ad5001/Online/OnlineTask.php 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);


Loading…
Cancel
Save