Fixed things

This commit is contained in:
Shoghi Cervantes Pueyo 2013-05-15 18:38:20 +02:00
parent cef4347a02
commit 991436993f
3 changed files with 16 additions and 7 deletions

View File

@ -326,7 +326,7 @@ class BanAPI{
$username = strtolower($username);
if($this->isOp($username)){
return true;
}elseif($this->server->api->dhandle("api.ban.whitelist.check", $ip) === false){
}elseif($this->server->api->dhandle("api.ban.whitelist.check", $username) === false){
return true;
}elseif($this->whitelist->exists($username)){
return true;

View File

@ -576,11 +576,6 @@ class Player{
if($pitch === false){
$pitch = $this->entity->yaw;
}
if($pos instanceof Position and $pos->level !== $this->level){
$this->level = $pos->level;
$this->chunksLoaded = array();
$terrain = true;
}
$this->lastCorrect = $pos;
$this->entity->fallY = false;
$this->entity->fallStart = false;
@ -588,6 +583,20 @@ class Player{
$this->entity->resetSpeed();
$this->entity->updateLast();
$this->entity->calculateVelocity();
if($pos instanceof Position and $pos->level !== $this->level){
foreach($this->server->api->entity->getAll($this->level) as $e){
if($e !== $this->entity){
$this->dataPacket(MC_REMOVE_ENTITY, array(
"eid" => $e->eid,
));
}
}
$this->level = $pos->level;
$this->chunksLoaded = array();
$this->server->api->entity->spawnToAll($this->level, $this->eid);
$this->server->api->entity->spawnAll($this);
$terrain = true;
}
if($terrain === true){
$this->orderChunks();
$this->getNextChunk();

View File

@ -123,7 +123,7 @@ class RCONInstance extends Thread{
}
@socket_set_block($client);
$size = Utils::readLInt($d);
if($size < 0){
if($size < 0 or $size > 65535){
return false;
}
$requestID = Utils::readLInt(socket_read($client, 4));