Changing code parts [Hey! Don't look here!]

This commit is contained in:
Shoghi Cervantes Pueyo 2013-01-10 23:59:03 +01:00
parent eebbc263b0
commit 8d3ad0c5ec
7 changed files with 74 additions and 51 deletions

View file

@ -26,13 +26,20 @@ the Free Software Foundation, either version 3 of the License, or
*/
class TickLoop extends Thread{
var $stop = false, $lastTick = 0;
var $tick = false, $stop = false, $lastTick = 0;
private $server;
public function __construct(PocketMinecraftServer $server){
$this->server = $server;
}
public function run(){
while($this->stop !== true){
usleep(1);
$time = microtime(true);
if($this->lastTick <= ($time - 0.05)){
$this->lastTick = $time;
$this->tick = true;
$this->wait();
$this->tick = false;
}
}
exit(0);