Added upload/download speed on title bar, referenced ChunkRequestTask

This commit is contained in:
Shoghi Cervantes
2014-07-11 02:23:40 +02:00
parent 756a8fead6
commit f2fa13119a
6 changed files with 22 additions and 6 deletions

View File

@ -99,6 +99,9 @@ class RakLibInterface implements ServerInstance, SourceInterface{
private $tickTask;
private $upload = 0;
private $download = 0;
public function __construct(Server $server){
$this->server = $server;
$this->identifers = new \SplObjectStorage();
@ -181,7 +184,19 @@ class RakLibInterface implements ServerInstance, SourceInterface{
}
public function handleOption($name, $value){
//TODO
if($name === "bandwidth"){
$v = unserialize($value);
$this->upload = $v["up"];
$this->download = $v["down"];
}
}
public function getUploadUsage(){
return $this->upload;
}
public function getDownloadUsage(){
return $this->download;
}
public function putPacket(Player $player, DataPacket $packet, $needACK = false, $immediate = false){