Packet broadcast to players

This commit is contained in:
Shoghi Cervantes Pueyo
2013-05-19 22:49:40 +02:00
parent b9e3acd017
commit 48b5afac46
3 changed files with 19 additions and 9 deletions

View File

@ -63,14 +63,17 @@ class Level{
}
public function checkThings(){
$players = $this->server->api->player->getAll($this);
$now = microtime(true);
$time = $this->startTime + ($now - $this->startCheck) * 20;
if($this->server->api->dhandle("time.change", array("level" => $this, "time" => $time)) !== false){
$this->time = $time;
$this->server->api->player->broadcastPacket($players, MC_SET_TIME, array(
"time" => $this->time,
));
}
if(count($this->changedCount) > 0){
$players = $this->server->api->player->getAll($this);
arsort($this->changedCount);
$resendChunks = array();
foreach($this->changedCount as $index => $count){