Updated RakLib version

This commit is contained in:
Shoghi Cervantes 2014-07-11 00:53:48 +02:00
parent 5c826cb9ab
commit 91b2f81f3c
2 changed files with 10 additions and 1 deletions

View File

@ -73,6 +73,7 @@ use pocketmine\network\protocol\UnloadChunkPacket;
use pocketmine\network\protocol\UpdateBlockPacket;
use pocketmine\network\protocol\UseItemPacket;
use pocketmine\Player;
use pocketmine\scheduler\CallbackTask;
use pocketmine\Server;
use pocketmine\utils\TextFormat;
use raklib\protocol\EncapsulatedPacket;
@ -96,6 +97,8 @@ class RakLibInterface implements ServerInstance, SourceInterface{
/** @var ServerHandler */
private $interface;
private $tickTask;
public function __construct(Server $server){
$this->server = $server;
$this->identifers = new \SplObjectStorage();
@ -103,7 +106,11 @@ class RakLibInterface implements ServerInstance, SourceInterface{
$server = new RakLibServer($this->server->getLogger(), $this->server->getLoader(), $this->server->getPort(), $this->server->getIp() === "" ? "0.0.0.0" : $this->server->getIp());
$this->interface = new ServerHandler($server, $this);
$this->setName($this->server->getMotd());
$this->tickTask = $this->server->getScheduler()->scheduleRepeatingTask(new CallbackTask([$this, "doTick"]), 1);
}
public function doTick(){
$this->interface->sendTick();
}
public function process(){
@ -130,10 +137,12 @@ class RakLibInterface implements ServerInstance, SourceInterface{
}
public function shutdown(){
$this->tickTask->cancel();
$this->interface->shutdown();
}
public function emergencyShutdown(){
$this->tickTask->cancel();
$this->interface->emergencyShutdown();
}

@ -1 +1 @@
Subproject commit 85237bba6b6290397f2e1346587518437b96933b
Subproject commit bf60d62c08353720ef0e65ae1c5c399c80e16b87