mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Update to API 12
This commit is contained in:
parent
731ada7b38
commit
c59b4776ae
149 changed files with 6850 additions and 1918 deletions
|
|
@ -362,10 +362,8 @@ class BanAPI{
|
|||
return true;
|
||||
}elseif($this->bannedIPs->exists($ip, true)){
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -380,10 +378,8 @@ class BanAPI{
|
|||
return true;
|
||||
}elseif($this->banned->exists($username, true)){
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -170,8 +170,8 @@ class BlockAPI{
|
|||
array(CARPET, 8),
|
||||
|
||||
//Tools
|
||||
array(RAIL, 0),
|
||||
array(POWERED_RAIL, 0),
|
||||
array(RAILS, 0),
|
||||
array(POWERED_RAILS, 0),
|
||||
array(TORCH, 0),
|
||||
array(BUCKET, 0),
|
||||
array(BUCKET, 8),
|
||||
|
|
@ -194,7 +194,7 @@ class BlockAPI{
|
|||
array(SPAWN_EGG, MOB_SKELETON),
|
||||
array(SPAWN_EGG, MOB_SPIDER),
|
||||
array(SPAWN_EGG, MOB_PIGMAN),
|
||||
|
||||
|
||||
//Seeds
|
||||
array(SUGARCANE, 0),
|
||||
array(WHEAT, 0),
|
||||
|
|
@ -322,13 +322,13 @@ class BlockAPI{
|
|||
}
|
||||
|
||||
private function cancelAction(Block $block, Player $player, $send = true){
|
||||
$player->dataPacket(MC_UPDATE_BLOCK, array(
|
||||
"x" => $block->x,
|
||||
"y" => $block->y,
|
||||
"z" => $block->z,
|
||||
"block" => $block->getID(),
|
||||
"meta" => $block->getMetadata()
|
||||
));
|
||||
$pk = new UpdateBlockPacket;
|
||||
$pk->x = $block->x;
|
||||
$pk->y = $block->y;
|
||||
$pk->z = $block->z;
|
||||
$pk->block = $block->getID();
|
||||
$pk->meta = $block->getMetadata();
|
||||
$player->dataPacket($pk);
|
||||
if($send === true){
|
||||
$player->sendInventorySlot($player->slot);
|
||||
}
|
||||
|
|
@ -341,11 +341,15 @@ class BlockAPI{
|
|||
$item = $player->getSlot($player->slot);
|
||||
|
||||
if($this->server->api->dhandle("player.block.touch", array("type" => "break", "player" => $player, "target" => $target, "item" => $item)) === false){
|
||||
return $this->cancelAction($target, $player, false);
|
||||
if($this->server->api->dhandle("player.block.break.bypass", array("player" => $player, "target" => $target, "item" => $item)) !== true){
|
||||
return $this->cancelAction($target, $player, false);
|
||||
}
|
||||
}
|
||||
|
||||
if((!$target->isBreakable($item, $player) and $this->server->api->dhandle("player.block.break.invalid", array("player" => $player, "target" => $target, "item" => $item)) !== true) or ($player->gamemode & 0x02) === 0x02 or (($player->lastBreak - $player->getLag() / 1000) + $target->getBreakTime($item, $player) - 0.2) >= microtime(true)){
|
||||
return $this->cancelAction($target, $player, false);
|
||||
if($this->server->api->dhandle("player.block.break.bypass", array("player" => $player, "target" => $target, "item" => $item)) !== true){
|
||||
return $this->cancelAction($target, $player, false);
|
||||
}
|
||||
}
|
||||
$player->lastBreak = microtime(true);
|
||||
|
||||
|
|
@ -380,12 +384,16 @@ class BlockAPI{
|
|||
$item = $player->getSlot($player->slot);
|
||||
|
||||
if($target->getID() === AIR and $this->server->api->dhandle("player.block.place.invalid", array("player" => $player, "block" => $block, "target" => $target, "item" => $item)) !== true){ //If no block exists or not allowed in CREATIVE
|
||||
$this->cancelAction($target, $player);
|
||||
return $this->cancelAction($block, $player);
|
||||
if($this->server->api->dhandle("player.block.place.bypass", array("player" => $player, "block" => $block, "target" => $target, "item" => $item)) !== true){
|
||||
$this->cancelAction($target, $player);
|
||||
return $this->cancelAction($block, $player);
|
||||
}
|
||||
}
|
||||
|
||||
if($this->server->api->dhandle("player.block.touch", array("type" => "place", "player" => $player, "block" => $block, "target" => $target, "item" => $item)) === false){
|
||||
return $this->cancelAction($block, $player);
|
||||
if($this->server->api->dhandle("player.block.place.bypass", array("player" => $player, "block" => $block, "target" => $target, "item" => $item)) !== true){
|
||||
return $this->cancelAction($block, $player);
|
||||
}
|
||||
}
|
||||
$this->blockUpdate($target, BLOCK_UPDATE_TOUCH);
|
||||
|
||||
|
|
@ -396,7 +404,9 @@ class BlockAPI{
|
|||
}
|
||||
|
||||
if(($player->gamemode & 0x02) === 0x02){ //Adventure mode!!
|
||||
return $this->cancelAction($block, $player, false);
|
||||
if($this->server->api->dhandle("player.block.place.bypass", array("player" => $player, "block" => $block, "target" => $target, "item" => $item)) !== true){
|
||||
return $this->cancelAction($block, $player, false);
|
||||
}
|
||||
}
|
||||
|
||||
if($block->y > 127 or $block->y < 0){
|
||||
|
|
@ -454,363 +464,6 @@ class BlockAPI{
|
|||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
public function flowLavaOn($source, $face){
|
||||
$down = 0;
|
||||
if($face === BlockFace::BOTTOM){
|
||||
$level = 0;
|
||||
$down = 1;
|
||||
}else{
|
||||
$level = ($source[1] & 0x07) + 2;
|
||||
if($level > 0x07){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$spread = $this->server->api->level->getBlockFace($source, $face);
|
||||
if(($source[0] === 10 or $source[0] === 11) and $spread[0] === 10){
|
||||
if($level < ($spread[1] & 0x07)){
|
||||
$this->server->schedule(20, array($this, "blockScheduler"), array(
|
||||
"x" => $spread[2][0],
|
||||
"y" => $spread[2][1],
|
||||
"z" => $spread[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], $spread[0], $level | $down, false);
|
||||
return true;
|
||||
}
|
||||
}elseif($spread[0] === 9 or $spread[0] === 8){
|
||||
if($source[0] === 11){
|
||||
$this->server->api->level->setBlock($source[2][0], $source[2][1], $source[2][2], 49, 0);
|
||||
}elseif($face === 0){
|
||||
$this->server->api->level->setBlock($source[2][0], $source[2][1], $source[2][2], 1, 0);
|
||||
}else{
|
||||
$this->server->api->level->setBlock($source[2][0], $source[2][1], $source[2][2], 4, 0);
|
||||
}
|
||||
return true;
|
||||
}elseif(isset(Material::$flowable[$spread[0]])){
|
||||
$this->server->schedule(20, array($this, "blockScheduler"), array(
|
||||
"x" => $spread[2][0],
|
||||
"y" => $spread[2][1],
|
||||
"z" => $spread[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], 10, $level | $down, false);
|
||||
return true;
|
||||
}elseif(($source[1] & 0x08) === 0x08){
|
||||
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], $source[0], $source[1] & 0x07, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function flowWaterOn($source, $face, &$spread = null){
|
||||
$down = 0;
|
||||
if($face === BlockFace::BOTTOM){
|
||||
$level = 0;
|
||||
$down = 1;
|
||||
}else{
|
||||
$level = ($source[1] & 0x07) + 1;
|
||||
if($level > 0x07){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$spread = $this->server->api->level->getBlockFace($source, $face);
|
||||
if(($source[0] === 8 or $source[0] === 9) and $spread[0] === 8){
|
||||
if($level < ($spread[1] & 0x07)){
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $spread[2][0],
|
||||
"y" => $spread[2][1],
|
||||
"z" => $spread[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], $spread[0], $level | $down, false);
|
||||
return true;
|
||||
}
|
||||
}elseif($spread[0] === 11){
|
||||
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], 49, 0, true);
|
||||
return true;
|
||||
}elseif($spread[0] === 10){
|
||||
if($face === 0 or ($spread[1] & 0x08) === 0){
|
||||
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], 4, 0, true);
|
||||
return true;
|
||||
}
|
||||
}elseif(isset(Material::$flowable[$spread[0]])){
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $spread[2][0],
|
||||
"y" => $spread[2][1],
|
||||
"z" => $spread[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], 8, $level | $down, false);
|
||||
return true;
|
||||
}elseif(($source[1] & 0x08) === 0x08){
|
||||
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], $source[0], $source[1] & 0x07, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function updateBlock($x, $y, $z, $type = BLOCK_UPDATE_NORMAL){
|
||||
$block = $this->server->api->level->getBlock($x, $y, $z);
|
||||
$changed = false;
|
||||
|
||||
switch($block[0]){
|
||||
case 8:
|
||||
case 9:
|
||||
$faces = array();
|
||||
if(!$this->flowWaterOn($block, 0, $floor) or $block[0] === 9){
|
||||
$this->flowWaterOn($block, 2, $faces[0]);
|
||||
$this->flowWaterOn($block, 3, $faces[1]);
|
||||
$this->flowWaterOn($block, 4, $faces[2]);
|
||||
$this->flowWaterOn($block, 5, $faces[3]);
|
||||
}
|
||||
if($block[0] === 8){
|
||||
//Source creation
|
||||
if(!isset(Material::$flowable[$floor[0]])){
|
||||
$sources = 0;
|
||||
foreach($faces as $i => $b){
|
||||
if($b[0] === 9){
|
||||
++$sources;
|
||||
}
|
||||
}
|
||||
if($sources >= 2){
|
||||
$this->server->api->level->setBlock($block[2][0], $block[2][1], $block[2][2], 9, 0, false);
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$drained = true;
|
||||
$level = $block[1] & 0x07;
|
||||
$up = $this->server->api->level->getBlockFace($block, BlockFace::UP);
|
||||
if($up[0] === 8 or $up[0] === 9){
|
||||
$drained = false;
|
||||
}else{
|
||||
$b = $this->server->api->level->getBlockFace($block, BlockFace::NORTH);
|
||||
if($b[0] === 9 or ($b[0] === 8 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
|
||||
$drained = false;
|
||||
}else{
|
||||
$b = $this->server->api->level->getBlockFace($block, BlockFace::SOUTH);
|
||||
if($b[0] === 9 or ($b[0] === 8 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
|
||||
$drained = false;
|
||||
}else{
|
||||
$b = $this->server->api->level->getBlockFace($block, BlockFace::EAST);
|
||||
if($b[0] === 9 or ($b[0] === 8 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
|
||||
$drained = false;
|
||||
}else{
|
||||
$b = $this->server->api->level->getBlockFace($block, BlockFace::WEST);
|
||||
if($b[0] === 9 or ($b[0] === 8 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
|
||||
$drained = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($drained === true){
|
||||
++$level;
|
||||
if($level > 0x07){
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0] + 1,
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0] - 1,
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2] + 1,
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2] - 1,
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1] - 1,
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->api->level->setBlock($block[2][0], $block[2][1], $block[2][2], 0, 0, false);
|
||||
}else{
|
||||
$block[1] = ($block[1] & 0x08) | $level;
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0] + 1,
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0] - 1,
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2] + 1,
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2] - 1,
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1] - 1,
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(10, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->api->level->setBlock($block[2][0], $block[2][1], $block[2][2], $block[0], $block[1], false);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
case 11:
|
||||
if(!$this->flowLavaOn($block, 0) or $block[0] === 11){
|
||||
$this->flowLavaOn($block, 2);
|
||||
$this->flowLavaOn($block, 3);
|
||||
$this->flowLavaOn($block, 4);
|
||||
$this->flowLavaOn($block, 5);
|
||||
}
|
||||
if($block[0] === 10){
|
||||
$drained = true;
|
||||
$level = $block[1] & 0x07;
|
||||
$up = $this->server->api->level->getBlockFace($block, BlockFace::UP);
|
||||
if($up[0] === 10 or $up[0] === 11){
|
||||
$drained = false;
|
||||
}else{
|
||||
$b = $this->server->api->level->getBlockFace($block, BlockFace::NORTH);
|
||||
if($b[0] === 11 or ($b[0] === 10 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
|
||||
$drained = false;
|
||||
}else{
|
||||
$b = $this->server->api->level->getBlockFace($block, BlockFace::SOUTH);
|
||||
if($b[0] === 11 or ($b[0] === 10 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
|
||||
$drained = false;
|
||||
}else{
|
||||
$b = $this->server->api->level->getBlockFace($block, BlockFace::EAST);
|
||||
if($b[0] === 11 or ($b[0] === 10 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
|
||||
$drained = false;
|
||||
}else{
|
||||
$b = $this->server->api->level->getBlockFace($block, BlockFace::WEST);
|
||||
if($b[0] === 11 or ($b[0] === 10 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
|
||||
$drained = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($drained === true){
|
||||
++$level;
|
||||
if($level > 0x07){
|
||||
$this->server->schedule(20, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0] + 1,
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(20, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0] - 1,
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(20, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2] + 1,
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(20, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2] - 1,
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(20, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1] - 1,
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->api->level->setBlock($block[2][0], $block[2][1], $block[2][2], 0, 0, false);
|
||||
}else{
|
||||
$block[1] = ($block[1] & 0x08) | $level;
|
||||
$this->server->schedule(20, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0] + 1,
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(20, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0] - 1,
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(20, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2] + 1,
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(20, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2] - 1,
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(20, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1] - 1,
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->schedule(20, array($this, "blockScheduler"), array(
|
||||
"x" => $block[2][0],
|
||||
"y" => $block[2][1],
|
||||
"z" => $block[2][2],
|
||||
"type" => BLOCK_UPDATE_NORMAL,
|
||||
));
|
||||
$this->server->api->level->setBlock($block[2][0], $block[2][1], $block[2][2], $block[0], $block[1], false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
if($type === BLOCK_TYPE_SCHEDULED){
|
||||
$type = BLOCK_UPDATE_WEAK;
|
||||
}
|
||||
if($changed === true){
|
||||
$this->updateBlocksAround($x, $y, $z, $type);
|
||||
}
|
||||
}*/
|
||||
|
||||
public function blockUpdateAround(Position $pos, $type = BLOCK_UPDATE_NORMAL, $delay = false){
|
||||
if($delay !== false){
|
||||
$this->scheduleBlockUpdate($pos->getSide(0), $delay, $type);
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@ class ConsoleAPI{
|
|||
if(!defined("NO_THREADS")){
|
||||
$this->loop->stop();
|
||||
$this->loop->notify();
|
||||
//@fclose($this->loop->fp);
|
||||
usleep(50000);
|
||||
$this->loop->kill();
|
||||
//$this->loop->join();
|
||||
}
|
||||
}
|
||||
|
|
@ -204,22 +207,16 @@ class ConsoleAPI{
|
|||
break;
|
||||
case "a":
|
||||
case "all":
|
||||
if($issuer instanceof Player)
|
||||
{
|
||||
if($this->server->api->ban->isOp($issuer->username))
|
||||
{
|
||||
if($issuer instanceof Player){
|
||||
if($this->server->api->ban->isOp($issuer->username)){
|
||||
$output = "";
|
||||
foreach($this->server->api->player->getAll() as $p){
|
||||
$output .= $this->run($cmd . " ". substr_replace($params, $p->username, $selector[1] + $offsetshift - 1, strlen($selector[0]) + 1), $issuer, $alias);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
}else{
|
||||
$issuer->sendChat("You don't have permissions to use this command.\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
}else{
|
||||
$output = "";
|
||||
foreach($this->server->api->player->getAll() as $p){
|
||||
$output .= $this->run($cmd . " ". substr_replace($params, $p->username, $selector[1] + $offsetshift - 1, strlen($selector[0]) + 1), $issuer, $alias);
|
||||
|
|
@ -294,7 +291,7 @@ class ConsoleLoop extends Thread{
|
|||
public $stop;
|
||||
public $base;
|
||||
public $ev;
|
||||
public $fp;
|
||||
public $fp;
|
||||
public function __construct(){
|
||||
$this->line = false;
|
||||
$this->stop = false;
|
||||
|
|
@ -319,7 +316,7 @@ class ConsoleLoop extends Thread{
|
|||
|
||||
public function run(){
|
||||
if(!extension_loaded("readline")){
|
||||
$this->fp = fopen( "php://stdin", "r" );
|
||||
$this->fp = fopen("php://stdin", "r");
|
||||
}
|
||||
|
||||
while($this->stop === false){
|
||||
|
|
@ -328,7 +325,7 @@ class ConsoleLoop extends Thread{
|
|||
$this->line = false;
|
||||
}
|
||||
|
||||
if(!$this->haveReadline){
|
||||
if(!extension_loaded("readline")){
|
||||
@fclose($fp);
|
||||
}
|
||||
exit(0);
|
||||
|
|
|
|||
|
|
@ -142,7 +142,6 @@ class EntityAPI{
|
|||
//"speedZ" => mt_rand(-3, 3) / 8,
|
||||
"item" => $item,
|
||||
);
|
||||
|
||||
if($this->server->api->handle("item.drop", $data) !== false){
|
||||
for($count = $item->count; $count > 0; ){
|
||||
$item->count = min($item->getMaxStackSize(), $count);
|
||||
|
|
@ -170,18 +169,18 @@ class EntityAPI{
|
|||
$entity->closed = true;
|
||||
$this->server->query("DELETE FROM entities WHERE EID = ".$eid.";");
|
||||
if($entity->class === ENTITY_PLAYER){
|
||||
$this->server->api->player->broadcastPacket($this->server->api->player->getAll(), MC_REMOVE_PLAYER, array(
|
||||
"clientID" => 0,
|
||||
"eid" => $entity->eid,
|
||||
));
|
||||
$pk = new RemovePlayerPacket;
|
||||
$pk->eid = $entity->eid;
|
||||
$pk->clientID = 0;
|
||||
$this->server->api->player->broadcastPacket($this->server->api->player->getAll(), $pk);
|
||||
}else{
|
||||
$this->server->api->player->broadcastPacket($this->server->api->player->getAll($entity->level), MC_REMOVE_ENTITY, array(
|
||||
"eid" => $entity->eid,
|
||||
));
|
||||
$pk = new RemoveEntityPacket;
|
||||
$pk->eid = $entity->eid;
|
||||
$this->server->api->player->broadcastPacket($this->server->api->player->getAll($entity->level), $pk);
|
||||
}
|
||||
$this->server->api->dhandle("entity.remove", $entity);
|
||||
$entity = null;
|
||||
unset($entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,8 +241,7 @@ class LevelAPI{
|
|||
}
|
||||
}
|
||||
|
||||
public function getAll()
|
||||
{
|
||||
public function getAll(){
|
||||
return $this->levels;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class PlayerAPI{
|
|||
$this->server->api->console->register("kill", "<player>", array($this, "commandHandler"));
|
||||
$this->server->api->console->register("gamemode", "<mode> [player]", array($this, "commandHandler"));
|
||||
$this->server->api->console->register("tp", "[target player] <destination player|w:world> OR /tp [target player] <x> <y> <z>", array($this, "commandHandler"));
|
||||
$this->server->api->console->register("setspawn", "[player] [x] [y] [z]", array($this, "commandHandler"));
|
||||
$this->server->api->console->register("spawnpoint", "[player] [x] [y] [z]", array($this, "commandHandler"));
|
||||
$this->server->api->console->register("spawn", "", array($this, "commandHandler"));
|
||||
$this->server->api->console->register("ping", "", array($this, "commandHandler"));
|
||||
$this->server->api->console->alias("lag", "ping");
|
||||
|
|
@ -118,7 +118,7 @@ class PlayerAPI{
|
|||
public function commandHandler($cmd, $params, $issuer, $alias){
|
||||
$output = "";
|
||||
switch($cmd){
|
||||
case "setspawn":
|
||||
case "spawnpoint":
|
||||
if(!($issuer instanceof Player)){
|
||||
$output .= "Please run this command in-game.\n";
|
||||
break;
|
||||
|
|
@ -324,7 +324,7 @@ class PlayerAPI{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($multiple === false){
|
||||
if(count($players) > 0){
|
||||
return array_shift($players);
|
||||
|
|
@ -353,11 +353,9 @@ class PlayerAPI{
|
|||
return $this->server->clients;
|
||||
}
|
||||
|
||||
public function broadcastPacket(array $players, $id, $data = array()){
|
||||
$data = new CustomPacketHandler($id, "", $data, true);
|
||||
$packet = array("raw" => chr($id).$data->raw);
|
||||
public function broadcastPacket(array $players, RakNetDataPacket $packet){
|
||||
foreach($players as $p){
|
||||
$p->dataPacket(false, $packet);
|
||||
$p->dataPacket(clone $packet);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -404,14 +402,14 @@ class PlayerAPI{
|
|||
if($p !== $player and ($p->entity instanceof Entity)){
|
||||
$p->entity->spawn($player);
|
||||
if($p->level !== $player->level){
|
||||
$player->dataPacket(MC_MOVE_ENTITY_POSROT, array(
|
||||
"eid" => $p->entity->eid,
|
||||
"x" => -256,
|
||||
"y" => 128,
|
||||
"z" => -256,
|
||||
"yaw" => 0,
|
||||
"pitch" => 0,
|
||||
));
|
||||
$pk = new MoveEntityPacket_PosRot;
|
||||
$pk->eid = $p->entity->eid;
|
||||
$pk->x = -256;
|
||||
$pk->y = 128;
|
||||
$pk->z = -256;
|
||||
$pk->yaw = 0;
|
||||
$pk->pitch = 0;
|
||||
$player->dataPacket($pk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -422,14 +420,14 @@ class PlayerAPI{
|
|||
if($p !== $player and ($p->entity instanceof Entity) and ($player->entity instanceof Entity)){
|
||||
$player->entity->spawn($p);
|
||||
if($p->level !== $player->level){
|
||||
$p->dataPacket(MC_MOVE_ENTITY_POSROT, array(
|
||||
"eid" => $player->entity->eid,
|
||||
"x" => -256,
|
||||
"y" => 128,
|
||||
"z" => -256,
|
||||
"yaw" => 0,
|
||||
"pitch" => 0,
|
||||
));
|
||||
$pk = new MoveEntityPacket_PosRot;
|
||||
$pk->eid = $player->entity->eid;
|
||||
$pk->x = -256;
|
||||
$pk->y = 128;
|
||||
$pk->z = -256;
|
||||
$pk->yaw = 0;
|
||||
$pk->pitch = 0;
|
||||
$p->dataPacket($pk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -471,7 +469,7 @@ class PlayerAPI{
|
|||
"z" => $this->server->spawn->z,
|
||||
),
|
||||
"inventory" => array_fill(0, PLAYER_SURVIVAL_SLOTS, array(AIR, 0, 0)),
|
||||
"hotbar" => array(0, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
"hotbar" => array(0, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
"armor" => array_fill(0, 4, array(AIR, 0)),
|
||||
"gamemode" => $this->server->gamemode,
|
||||
"health" => 20,
|
||||
|
|
@ -499,4 +497,4 @@ class PlayerAPI{
|
|||
$this->server->handle("player.offline.save", $data);
|
||||
$data->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,13 @@ class PluginAPI extends stdClass{
|
|||
return $output;
|
||||
}
|
||||
|
||||
public function __destruct(){
|
||||
foreach($this->plugins as $p){
|
||||
$p[0]->__destruct();
|
||||
}
|
||||
unset($plugins);
|
||||
}
|
||||
|
||||
public function getList(){
|
||||
$list = array();
|
||||
foreach($this->plugins as $p){
|
||||
|
|
@ -206,11 +213,11 @@ class PluginAPI extends stdClass{
|
|||
}
|
||||
|
||||
public function readYAML($file){
|
||||
return Spyc::YAMLLoad(file_get_contents($file));
|
||||
return yaml_parse(preg_replace("#^([ ]*)([a-zA-Z_]{1}[^\:]*)\:#m", "$1\"$2\":", file_get_contents($file)));
|
||||
}
|
||||
|
||||
public function writeYAML($file, $data){
|
||||
return file_put_contents($file, Spyc::YAMLDump($data));
|
||||
return file_put_contents($file, yaml_emit($data, YAML_UTF8_ENCODING));
|
||||
}
|
||||
|
||||
public function init(){
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ class ServerAPI{
|
|||
private $apiList = array();
|
||||
private $asyncCnt = 0;
|
||||
private $rcon;
|
||||
private $query;
|
||||
|
||||
public $query;
|
||||
|
||||
//TODO: Instead of hard-coding functions, use PHPDoc-compatible methods to load APIs.
|
||||
|
||||
|
|
@ -97,6 +98,14 @@ class ServerAPI{
|
|||
@mkdir(DATA_PATH."players/", 0755);
|
||||
@mkdir(DATA_PATH."worlds/", 0755);
|
||||
@mkdir(DATA_PATH."plugins/", 0755);
|
||||
|
||||
//Init all the events
|
||||
foreach(get_declared_classes() as $class){
|
||||
if(is_subclass_of($class, "BaseEvent") and property_exists($class, "handlers") and property_exists($class, "handlerPriority")){
|
||||
$class::unregisterAll();
|
||||
}
|
||||
}
|
||||
|
||||
$version = new VersionString();
|
||||
console("[INFO] Starting Minecraft PE server version ".FORMAT_AQUA.CURRENT_MINECRAFT_VERSION);
|
||||
|
||||
|
|
@ -134,27 +143,25 @@ class ServerAPI{
|
|||
));
|
||||
|
||||
$this->parseProperties();
|
||||
|
||||
//Load advanced properties
|
||||
define("DEBUG", $this->getProperty("debug", 1));
|
||||
define("ADVANCED_CACHE", $this->getProperty("enable-advanced-cache", false));
|
||||
if($this->getProperty("port") !== false){
|
||||
$this->setProperty("server-port", $this->getProperty("port"));
|
||||
$this->config->remove("port");
|
||||
$this->config->remove("invisible");
|
||||
define("MAX_CHUNK_RATE", 20 / $this->getProperty("max-chunks-per-second", 8)); //Default rate ~512 kB/s
|
||||
if(ADVANCED_CACHE == true){
|
||||
console("[INFO] Advanced cache enabled");
|
||||
}
|
||||
|
||||
if($this->getProperty("upnp-forwarding") == true){
|
||||
console("[INFO] [UPnP] Trying to port forward...");
|
||||
UPnP_PortForward($this->getProperty("server-port"));
|
||||
}
|
||||
|
||||
$this->server = new PocketMinecraftServer($this->getProperty("server-name"), $this->getProperty("gamemode"), ($seed = $this->getProperty("level-seed")) != "" ? (int) $seed:false, $this->getProperty("server-port"), ($ip = $this->getProperty("server-ip")) != "" ? $ip:"0.0.0.0");
|
||||
$this->server->api = $this;
|
||||
self::$serverRequest = $this->server;
|
||||
console("[INFO] This server is running PocketMine-MP version ".($version->isDev() ? FORMAT_YELLOW:"").MAJOR_VERSION.FORMAT_RESET." \"".CODENAME."\" (MCPE: ".CURRENT_MINECRAFT_VERSION.") (API ".CURRENT_API_VERSION.")", true, true, 0);
|
||||
console("[INFO] PocketMine-MP is distributed under the LGPL License", true, true, 0);
|
||||
|
||||
if(ADVANCED_CACHE == true){
|
||||
console("[INFO] Advanced cache enabled");
|
||||
}
|
||||
|
||||
if($this->getProperty("upnp-forwarding") === true){
|
||||
console("[INFO] [UPnP] Trying to port forward...");
|
||||
UPnP_PortForward($this->getProperty("server-port"));
|
||||
}
|
||||
|
||||
if($this->getProperty("last-update") === false or ($this->getProperty("last-update") + 3600) < time()){
|
||||
console("[INFO] Checking for new server version");
|
||||
|
|
@ -257,7 +264,7 @@ class ServerAPI{
|
|||
"php_version" => PHP_VERSION,
|
||||
"version" => MAJOR_VERSION,
|
||||
"mc_version" => CURRENT_MINECRAFT_VERSION,
|
||||
"protocol" => CURRENT_PROTOCOL,
|
||||
"protocol" => ProtocolInfo::CURRENT_PROTOCOL,
|
||||
"online" => count($this->server->clients),
|
||||
"max" => $this->server->maxClients,
|
||||
"plugins" => $plist,
|
||||
|
|
@ -349,7 +356,7 @@ class ServerAPI{
|
|||
}
|
||||
|
||||
if($this->getProperty("enable-query") === true){
|
||||
$this->query = new Query();
|
||||
$this->query = new QueryHandler();
|
||||
}
|
||||
CraftingRecipes::init();
|
||||
$this->server->init();
|
||||
|
|
@ -445,9 +452,11 @@ class ServerAPI{
|
|||
return ($this->config->exists($name) ? $this->config->get($name):$default);
|
||||
}
|
||||
|
||||
public function setProperty($name, $value){
|
||||
public function setProperty($name, $value, $save = true){
|
||||
$this->config->set($name, $value);
|
||||
$this->writeProperties();
|
||||
if($save == true){
|
||||
$this->writeProperties();
|
||||
}
|
||||
$this->loadProperties();
|
||||
}
|
||||
|
||||
|
|
|
|||
135
src/BaseEvent.php
Normal file
135
src/BaseEvent.php
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
abstract class BaseEvent{
|
||||
const ALLOW = 0;
|
||||
const DENY = 1;
|
||||
const NORMAL = 2;
|
||||
const FORCE = 0x80000000;
|
||||
|
||||
/**
|
||||
* Any callable event must declare the static variables
|
||||
*
|
||||
* public static $handlers;
|
||||
* public static $handlerPriority;
|
||||
*
|
||||
* Not doing so will deny the proper event initialization
|
||||
*/
|
||||
|
||||
protected $eventName = null;
|
||||
private $status = BaseEvent::NORMAL;
|
||||
private $prioritySlot;
|
||||
|
||||
final public function getEventName(){
|
||||
return $this->eventName !== null ? get_class($this) : $this->eventName;
|
||||
}
|
||||
|
||||
final public function setPrioritySlot($slot){
|
||||
$this->prioritySlot = (int) $slot;
|
||||
}
|
||||
|
||||
final public function getPrioritySlot(){
|
||||
return (int) $this->prioritySlot;
|
||||
}
|
||||
|
||||
|
||||
public function isAllowed(){
|
||||
return ($this->status & 0x7FFFFFFF) === BaseEvent::ALLOW;
|
||||
}
|
||||
|
||||
public function setAllowed($forceAllow = false){
|
||||
$this->status = BaseEvent::ALLOW | ($forceAllow === true ? BaseEvent::FORCE : 0);
|
||||
}
|
||||
|
||||
public function isCancelled(){
|
||||
return ($this->status & 0x7FFFFFFF) === BaseEvent::DENY;
|
||||
}
|
||||
|
||||
public function setCancelled($forceCancel = false){
|
||||
if($this instanceof CancellableEvent){
|
||||
$this->status = BaseEvent::DENY | ($forceCancel === true ? BaseEvent::FORCE : 0);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isNormal(){
|
||||
return $this->status === BaseEvent::NORMAL;
|
||||
}
|
||||
|
||||
public function setNormal(){
|
||||
$this->status = BaseEvent::NORMAL;
|
||||
}
|
||||
|
||||
public function isForced(){
|
||||
return ($this->status & BaseEvent::FORCE) > 0;
|
||||
}
|
||||
|
||||
public static function getHandlerList(){
|
||||
return static::$handlers;
|
||||
}
|
||||
|
||||
public static function getPriorityList(){
|
||||
return static::$handlerPriority;
|
||||
}
|
||||
|
||||
public static function unregisterAll(){
|
||||
static::$handlers = array();
|
||||
static::$handlerPriority = array();
|
||||
}
|
||||
|
||||
public static function register(callable $handler, $priority = EventPriority::NORMAL){
|
||||
if($priority < EventPriority::MONITOR or $priority > EventPriority::LOWEST){
|
||||
return false;
|
||||
}
|
||||
$identifier = Utils::getCallableIdentifier($handler);
|
||||
if(isset(static::$handlers[$identifier])){ //Already registered
|
||||
return false;
|
||||
}else{
|
||||
static::$handlers[$identifier] = $handler;
|
||||
if(!isset(static::$handlerPriority[(int) $priority])){
|
||||
static::$handlerPriority[(int) $priority] = array();
|
||||
}
|
||||
static::$handlerPriority[(int) $priority][$identifier] = $handler;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static function unregister(callable $handler, $priority = EventPriority::NORMAL){
|
||||
$identifier = Utils::getCallableIdentifier($handler);
|
||||
if(isset(static::$handlers[$identifier])){
|
||||
if(isset(static::$handlerPriority[(int) $priority][$identifier])){
|
||||
unset(static::$handlerPriority[(int) $priority][$identifier]);
|
||||
}else{
|
||||
for($priority = EventPriority::MONITOR; $priority <= EventPriority::LOWEST; ++$priority){
|
||||
unset(static::$handlerPriority[$priority][$identifier]);
|
||||
if(count(static::$handlerPriority[$priority]) === 0){
|
||||
unset(static::$handlerPriority[$priority]);
|
||||
}
|
||||
}
|
||||
}
|
||||
unset(static::$handlers[$identifier]);
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
1072
src/Player.php
1072
src/Player.php
File diff suppressed because it is too large
Load diff
|
|
@ -414,6 +414,7 @@ class PocketMinecraftServer{
|
|||
if(stripos($er["file"], "plugin") !== false){
|
||||
$dump .= "THIS ERROR WAS CAUSED BY A PLUGIN. REPORT IT TO THE PLUGIN DEVELOPER.\r\n";
|
||||
}
|
||||
|
||||
$dump .= "Code: \r\n";
|
||||
$file = @file($er["file"], FILE_IGNORE_NEW_LINES);
|
||||
for($l = max(0, $er["line"] - 10); $l < $er["line"] + 10; ++$l){
|
||||
|
|
@ -421,7 +422,7 @@ class PocketMinecraftServer{
|
|||
}
|
||||
$dump .= "\r\n\r\n";
|
||||
$version = new VersionString();
|
||||
$dump .= "PocketMine-MP version: ".$version." #".$version->getNumber()." [Protocol ".CURRENT_PROTOCOL."; API ".CURRENT_API_VERSION."]\r\n";
|
||||
$dump .= "PocketMine-MP version: ".$version." #".$version->getNumber()." [Protocol ".ProtocolInfo::CURRENT_PROTOCOL."; API ".CURRENT_API_VERSION."]\r\n";
|
||||
$dump .= "Git commit: ".GIT_COMMIT."\r\n";
|
||||
$dump .= "Source SHA1 sum: ".SOURCE_SHA1SUM."\r\n";
|
||||
$dump .= "uname -a: ".php_uname("a")."\r\n";
|
||||
|
|
@ -444,11 +445,12 @@ class PocketMinecraftServer{
|
|||
}
|
||||
$dump .= "\r\n\r\n";
|
||||
}
|
||||
|
||||
$extensions = array();
|
||||
foreach(get_loaded_extensions() as $ext){
|
||||
$extensions[$ext] = phpversion($ext);
|
||||
}
|
||||
|
||||
|
||||
$dump .= "Loaded Modules: ".var_export($extensions, true)."\r\n";
|
||||
$this->checkMemory();
|
||||
$dump .= "Memory Usage Tracking: \r\n".chunk_split(base64_encode(gzdeflate(implode(";", $this->memoryStats), 9)))."\r\n";
|
||||
|
|
@ -474,29 +476,30 @@ class PocketMinecraftServer{
|
|||
}
|
||||
|
||||
public static function clientID($ip, $port){
|
||||
//faster than string indexes in PHP
|
||||
return crc32($ip . $port) ^ crc32($port . $ip . BOOTUP_RANDOM);
|
||||
//return $ip . ":" . $port;
|
||||
}
|
||||
|
||||
public function packetHandler($packet){
|
||||
$data =& $packet["data"];
|
||||
$CID = PocketMinecraftServer::clientID($packet["ip"], $packet["port"]);
|
||||
public function packetHandler(Packet $packet){
|
||||
$data =& $packet;
|
||||
$CID = PocketMinecraftServer::clientID($packet->ip, $packet->port);
|
||||
if(isset($this->clients[$CID])){
|
||||
$this->clients[$CID]->handlePacket($packet["pid"], $data);
|
||||
$this->clients[$CID]->handlePacket($packet);
|
||||
}else{
|
||||
if($this->handle("server.noauthpacket", $packet) === false){
|
||||
if($this->handle("server.noauthpacket.".$packet->pid(), $packet) === false){
|
||||
return;
|
||||
}
|
||||
switch($packet["pid"]){
|
||||
case 0x01:
|
||||
case 0x02:
|
||||
switch($packet->pid()){
|
||||
case RakNetInfo::UNCONNECTED_PING:
|
||||
case RakNetInfo::UNCONNECTED_PING_OPEN_CONNECTIONS:
|
||||
if($this->invisible === true){
|
||||
$this->send(0x1c, array(
|
||||
$data[0],
|
||||
$this->serverID,
|
||||
RAKNET_MAGIC,
|
||||
$this->serverType,
|
||||
), false, $packet["ip"], $packet["port"]);
|
||||
$pk = new RakNetPacket(RakNetInfo::UNCONNECTED_PONG);
|
||||
$pk->pingID = $packet->pingID;
|
||||
$pk->serverID = $this->serverID;
|
||||
$pk->serverType = $this->serverType;
|
||||
$pk->ip = $packet->ip;
|
||||
$pk->port = $packet->port;
|
||||
$this->send($pk);
|
||||
break;
|
||||
}
|
||||
if(!isset($this->custom["times_".$CID])){
|
||||
|
|
@ -508,64 +511,59 @@ class PocketMinecraftServer{
|
|||
}
|
||||
$txt = substr($this->description, $this->custom["times_".$CID], $ln);
|
||||
$txt .= substr($this->description, 0, $ln - strlen($txt));
|
||||
$this->send(0x1c, array(
|
||||
$data[0],
|
||||
$this->serverID,
|
||||
RAKNET_MAGIC,
|
||||
$this->serverType. $this->name . " [".count($this->clients)."/".$this->maxClients."] ".$txt,
|
||||
), false, $packet["ip"], $packet["port"]);
|
||||
$pk = new RakNetPacket(RakNetInfo::UNCONNECTED_PONG);
|
||||
$pk->pingID = $packet->pingID;
|
||||
$pk->serverID = $this->serverID;
|
||||
$pk->serverType = $this->serverType . $this->name . " [".count($this->clients)."/".$this->maxClients."] ".$txt;
|
||||
$pk->ip = $packet->ip;
|
||||
$pk->port = $packet->port;
|
||||
$this->send($pk);
|
||||
$this->custom["times_".$CID] = ($this->custom["times_".$CID] + 1) % strlen($this->description);
|
||||
break;
|
||||
case 0x05:
|
||||
$version = $data[1];
|
||||
$size = strlen($data[2]);
|
||||
if($version !== CURRENT_STRUCTURE){
|
||||
console("[DEBUG] Incorrect structure #$version from ".$packet["ip"].":".$packet["port"], true, true, 2);
|
||||
$this->send(0x1a, array(
|
||||
CURRENT_STRUCTURE,
|
||||
RAKNET_MAGIC,
|
||||
$this->serverID,
|
||||
), false, $packet["ip"], $packet["port"]);
|
||||
case RakNetInfo::OPEN_CONNECTION_REQUEST_1:
|
||||
if($packet->structure !== RakNetInfo::STRUCTURE){
|
||||
console("[DEBUG] Incorrect structure #".$packet->structure." from ".$packet->ip.":".$packet->port, true, true, 2);
|
||||
$pk = new RakNetPacket(RakNetInfo::INCOMPATIBLE_PROTOCOL_VERSION);
|
||||
$pk->serverID = $this->serverID;
|
||||
$pk->ip = $packet->ip;
|
||||
$pk->port = $packet->port;
|
||||
$this->send($pk);
|
||||
}else{
|
||||
$this->send(0x06, array(
|
||||
RAKNET_MAGIC,
|
||||
$this->serverID,
|
||||
0,
|
||||
strlen($packet["raw"]),
|
||||
), false, $packet["ip"], $packet["port"]);
|
||||
$pk = new RakNetPacket(RakNetInfo::OPEN_CONNECTION_REPLY_1);
|
||||
$pk->serverID = $this->serverID;
|
||||
$pk->mtuSize = strlen($packet->buffer);
|
||||
$pk->ip = $packet->ip;
|
||||
$pk->port = $packet->port;
|
||||
$this->send($pk);
|
||||
}
|
||||
break;
|
||||
case 0x07:
|
||||
case RakNetInfo::OPEN_CONNECTION_REQUEST_2:
|
||||
if($this->invisible === true){
|
||||
break;
|
||||
}
|
||||
$port = $data[2];
|
||||
$MTU = $data[3];
|
||||
$clientID = $data[4];
|
||||
if(count($this->clients) < $this->maxClients){
|
||||
$this->clients[$CID] = new Player($clientID, $packet["ip"], $packet["port"], $MTU); //New Session!
|
||||
$this->send(0x08, array(
|
||||
RAKNET_MAGIC,
|
||||
$this->serverID,
|
||||
$this->port,
|
||||
$data[3],
|
||||
0,
|
||||
), false, $packet["ip"], $packet["port"]);
|
||||
}
|
||||
|
||||
$this->clients[$CID] = new Player($packet->clientID, $packet->ip, $packet->port, $packet->mtuSize); //New Session!
|
||||
$pk = new RakNetPacket(RakNetInfo::OPEN_CONNECTION_REPLY_2);
|
||||
$pk->serverID = $this->serverID;
|
||||
$pk->port = $this->port;
|
||||
$pk->mtuSize = $packet->mtuSize;
|
||||
$pk->ip = $packet->ip;
|
||||
$pk->port = $packet->port;
|
||||
$this->send($pk);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function send($pid, $data = array(), $raw = false, $dest = false, $port = false){
|
||||
return $this->interface->writePacket($pid, $data, $raw, $dest, $port);
|
||||
public function send(Packet $packet){
|
||||
return $this->interface->writePacket($packet);
|
||||
}
|
||||
|
||||
public function process(){
|
||||
$lastLoop = 0;
|
||||
while($this->stop === false){
|
||||
$packet = $this->interface->readPacket();
|
||||
if($packet !== false){
|
||||
if($packet instanceof Packet){
|
||||
$this->packetHandler($packet);
|
||||
$lastLoop = 0;
|
||||
}elseif($this->tick() > 0){
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
#!/bin/bash
|
||||
COMPILER_VERSION="0.14"
|
||||
COMPILER_VERSION="0.16"
|
||||
|
||||
PHP_VERSION="5.5.8"
|
||||
PHP_VERSION="5.5.9"
|
||||
ZEND_VM="GOTO"
|
||||
|
||||
LIBEDIT_VERSION="0.3"
|
||||
ZLIB_VERSION="1.2.8"
|
||||
PTHREADS_VERSION="0.0.45"
|
||||
CURL_VERSION="curl-7_34_0"
|
||||
PTHREADS_VERSION="0.1.0"
|
||||
PHPYAML_VERSION="1.1.1"
|
||||
YAML_VERSION="0.1.4"
|
||||
CURL_VERSION="curl-7_35_0"
|
||||
|
||||
echo "[PocketMine] PHP installer and compiler for Linux & Mac"
|
||||
DIR="$(pwd)"
|
||||
|
|
@ -19,11 +21,27 @@ type autoconf >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \
|
|||
type automake >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"automake\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||
type libtool >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"libtool\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||
type m4 >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"m4\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||
type wget >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"wget\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||
type wget >> "$DIR/install.log" 2>&1 || type curl >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"wget\" or \"curl\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||
type getconf >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"getconf\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||
|
||||
#Needed to use aliases
|
||||
shopt -s expand_aliases
|
||||
type wget >> "$DIR/install.log" 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
alias download_file="wget --no-check-certificate -q -O -"
|
||||
else
|
||||
type curl >> "$DIR/install.log" 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
alias download_file="curl --insecure --silent --location"
|
||||
else
|
||||
echo "error, curl or wget not found"
|
||||
fi
|
||||
fi
|
||||
|
||||
export CC="gcc"
|
||||
COMPILE_FOR_ANDROID=no
|
||||
RANLIB=ranlib
|
||||
HAVE_MYSQLI="--with-mysqli=mysqlnd"
|
||||
if [ "$1" == "rpi" ]; then
|
||||
[ -z "$march" ] && march=armv6zk;
|
||||
[ -z "$mtune" ] && mtune=arm1176jzf-s;
|
||||
|
|
@ -34,24 +52,31 @@ elif [ "$1" == "mac" ]; then
|
|||
[ -z "$mtune" ] && mtune=generic;
|
||||
[ -z "$CFLAGS" ] && CFLAGS="-fomit-frame-pointer";
|
||||
echo "[INFO] Compiling for Intel MacOS"
|
||||
elif [ "$1" == "ios" ]; then
|
||||
[ -z "$march" ] && march=armv6;
|
||||
[ -z "$mtune" ] && mtune=cortex-a8;
|
||||
echo "[INFO] Compiling for iOS ARMv6"
|
||||
elif [ "$1" == "crosscompile" ]; then
|
||||
HAVE_MYSQLI="--without-mysqli"
|
||||
if [ "$2" == "android" ] || [ "$2" == "android-armv6" ]; then
|
||||
COMPILE_FOR_ANDROID=yes
|
||||
[ -z "$march" ] && march=armv6;
|
||||
[ -z "$mtune" ] && mtune=generic;
|
||||
TOOLCHAIN_PREFIX="arm-none-linux-gnueabi"
|
||||
[ -z "$mtune" ] && mtune=arm1136jf-s;
|
||||
TOOLCHAIN_PREFIX="arm-unknown-linux-uclibcgnueabi"
|
||||
export CC="$TOOLCHAIN_PREFIX-gcc"
|
||||
CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX"
|
||||
[ -z "$CFLAGS" ] && CFLAGS="-uclibc";
|
||||
CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX --enable-static-link --disable-ipv6"
|
||||
CFLAGS="-uclibc --static $CFLAGS";
|
||||
LDFLAGS="--static"
|
||||
echo "[INFO] Cross-compiling for Android ARMv6"
|
||||
elif [ "$2" == "android-armv7" ]; then
|
||||
COMPILE_FOR_ANDROID=yes
|
||||
[ -z "$march" ] && march=armv7a;
|
||||
[ -z "$mtune" ] && mtune=generic-armv7-a;
|
||||
TOOLCHAIN_PREFIX="arm-none-linux-gnueabi"
|
||||
[ -z "$march" ] && march=armv7-a;
|
||||
[ -z "$mtune" ] && mtune=cortex-a8;
|
||||
TOOLCHAIN_PREFIX="arm-unknown-linux-uclibcgnueabi"
|
||||
export CC="$TOOLCHAIN_PREFIX-gcc"
|
||||
CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX"
|
||||
[ -z "$CFLAGS" ] && CFLAGS="-uclibc";
|
||||
CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX --enable-static-link --disable-ipv6"
|
||||
CFLAGS="-uclibc --static $CFLAGS";
|
||||
LDFLAGS="--static"
|
||||
echo "[INFO] Cross-compiling for Android ARMv7"
|
||||
elif [ "$2" == "rpi" ]; then
|
||||
TOOLCHAIN_PREFIX="arm-linux-gnueabihf"
|
||||
|
|
@ -72,50 +97,74 @@ elif [ "$1" == "crosscompile" ]; then
|
|||
#zlib doesn't use the correct ranlib
|
||||
RANLIB=$TOOLCHAIN_PREFIX-ranlib
|
||||
echo "[INFO] Cross-compiling for Intel MacOS"
|
||||
elif [ "$2" == "ios" ] || [ "$2" == "ios-armv6" ]; then
|
||||
[ -z "$march" ] && march=armv6;
|
||||
[ -z "$mtune" ] && mtune=generic-armv6;
|
||||
CONFIGURE_FLAGS="--target=arm-apple-darwin10"
|
||||
elif [ "$2" == "ios-armv7" ]; then
|
||||
[ -z "$march" ] && march=armv7-a;
|
||||
[ -z "$mtune" ] && mtune=generic-armv7-a;
|
||||
CONFIGURE_FLAGS="--target=arm-apple-darwin10"
|
||||
else
|
||||
echo "Please supply a proper platform [android android-armv6 android-armv7 rpi mac] to cross-compile"
|
||||
echo "Please supply a proper platform [android android-armv6 android-armv7 rpi mac ios ios-armv6 ios-armv7] to cross-compile"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "[INFO] Compiling for current machine"
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
CFLAGS="-mx32 $CFLAGS"
|
||||
elif [ -z "$CFLAGS" ]; then
|
||||
if [ `getconf LONG_BIT` = "64" ]; then
|
||||
echo "[INFO] Compiling for current machine using 64-bit"
|
||||
CFLAGS="-m64 $CFLAGS"
|
||||
else
|
||||
echo "[INFO] Compiling for current machine using 32-bit"
|
||||
CFLAGS="-m32 $CFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
cat > test.c <<'CTEST'
|
||||
#include <stdio.h>
|
||||
main(){
|
||||
printf("Hello world\n");
|
||||
}
|
||||
CTEST
|
||||
|
||||
|
||||
type $CC >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"$CC\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||
|
||||
[ -z "$THREADS" ] && THREADS=1;
|
||||
[ -z "$march" ] && march=native;
|
||||
[ -z "$mtune" ] && mtune=native;
|
||||
[ -z "$CFLAGS" ] && CFLAGS="";
|
||||
[ -z "$LDFLAGS" ] && LDFLAGS="";
|
||||
[ -z "$CONFIGURE_FLAGS" ] && CONFIGURE_FLAGS="";
|
||||
|
||||
$CC -O3 -march=$march -mtune=$mtune -fno-gcse $CFLAGS -Q --help=target >> "$DIR/install.log" 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
$CC -O3 -fno-gcse $CFLAGS -Q --help=target >> "$DIR/install.log" 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
export CFLAGS="-O3 -fno-gcse "
|
||||
else
|
||||
export CFLAGS="-O3 -fno-gcse $CFLAGS"
|
||||
|
||||
if [ "$mtune" != "none" ]; then
|
||||
$CC -march=$march -mtune=$mtune $CFLAGS -o test test.c >> "$DIR/install.log" 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
CFLAGS="-march=$march -mtune=$mtune -fno-gcse $CFLAGS"
|
||||
fi
|
||||
else
|
||||
export CFLAGS="-O3 -march=$march -mtune=$mtune -fno-gcse $CFLAGS"
|
||||
$CC -march=$march $CFLAGS -o test test.c >> "$DIR/install.log" 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
CFLAGS="-march=$march -fno-gcse $CFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
rm test >> "$DIR/install.log" 2>&1
|
||||
rm test.c >> "$DIR/install.log" 2>&1
|
||||
|
||||
export CFLAGS="-O2 $CFLAGS"
|
||||
export LDFLAGS="$LDFLAGS"
|
||||
|
||||
rm -r -f install_data/ >> "$DIR/install.log" 2>&1
|
||||
rm -r -f php5/ >> "$DIR/install.log" 2>&1
|
||||
rm -r -f bin/ >> "$DIR/install.log" 2>&1
|
||||
mkdir -m 0777 install_data >> "$DIR/install.log" 2>&1
|
||||
mkdir -m 0777 php5 >> "$DIR/install.log" 2>&1
|
||||
mkdir -m 0777 bin >> "$DIR/install.log" 2>&1
|
||||
cd install_data
|
||||
set -e
|
||||
|
||||
#PHP 5
|
||||
echo -n "[PHP] downloading $PHP_VERSION..."
|
||||
wget http://php.net/get/php-$PHP_VERSION.tar.gz/from/this/mirror -q -O - | tar -zx >> "$DIR/install.log" 2>&1
|
||||
download_file "http://php.net/get/php-$PHP_VERSION.tar.gz/from/this/mirror" | tar -zx >> "$DIR/install.log" 2>&1
|
||||
mv php-$PHP_VERSION php
|
||||
echo " done!"
|
||||
|
||||
|
|
@ -124,7 +173,7 @@ if [ 1 ] || [ "$1" == "crosscompile" ] || [ "$1" == "rpi" ]; then
|
|||
else
|
||||
#libedit
|
||||
echo -n "[libedit] downloading $LIBEDIT_VERSION..."
|
||||
wget http://download.sourceforge.net/project/libedit/libedit/libedit-$LIBEDIT_VERSION/libedit-$LIBEDIT_VERSION.tar.gz -q -O - | tar -zx >> "$DIR/install.log" 2>&1
|
||||
download_file "http://download.sourceforge.net/project/libedit/libedit/libedit-$LIBEDIT_VERSION/libedit-$LIBEDIT_VERSION.tar.gz" | tar -zx >> "$DIR/install.log" 2>&1
|
||||
echo -n " checking..."
|
||||
cd libedit
|
||||
./configure --prefix="$DIR/install_data/php/ext/libedit" --enable-static >> "$DIR/install.log" 2>&1
|
||||
|
|
@ -145,7 +194,7 @@ fi
|
|||
|
||||
#zlib
|
||||
echo -n "[zlib] downloading $ZLIB_VERSION..."
|
||||
wget http://zlib.net/zlib-$ZLIB_VERSION.tar.gz -q -O - | tar -zx >> "$DIR/install.log" 2>&1
|
||||
download_file "http://zlib.net/zlib-$ZLIB_VERSION.tar.gz" | tar -zx >> "$DIR/install.log" 2>&1
|
||||
mv zlib-$ZLIB_VERSION zlib
|
||||
echo -n " checking..."
|
||||
cd zlib
|
||||
|
|
@ -161,16 +210,19 @@ rm -r -f ./zlib
|
|||
echo " done!"
|
||||
|
||||
if [ "$(uname -s)" == "Darwin" ] && [ "$1" != "crosscompile" ] && [ "$2" != "curl" ]; then
|
||||
HAVE_CURL="shared,/usr/local"
|
||||
HAVE_CURL="shared,/usr"
|
||||
else
|
||||
#curl
|
||||
echo -n "[cURL] downloading $CURL_VERSION..."
|
||||
wget https://github.com/bagder/curl/archive/$CURL_VERSION.tar.gz --no-check-certificate -q -O - | tar -zx >> "$DIR/install.log" 2>&1
|
||||
download_file "https://github.com/bagder/curl/archive/$CURL_VERSION.tar.gz" | tar -zx >> "$DIR/install.log" 2>&1
|
||||
mv curl-$CURL_VERSION curl
|
||||
echo -n " checking..."
|
||||
cd curl
|
||||
./buildconf >> "$DIR/install.log" 2>&1
|
||||
./configure --enable-ipv6 \
|
||||
if [ ! -f ./configure ]; then
|
||||
./buildconf --force >> "$DIR/install.log" 2>&1
|
||||
fi
|
||||
./configure --disable-dependency-tracking \
|
||||
--enable-ipv6 \
|
||||
--enable-optimize \
|
||||
--enable-http \
|
||||
--enable-ftp \
|
||||
|
|
@ -183,8 +235,13 @@ else
|
|||
--disable-smtp \
|
||||
--disable-telnet \
|
||||
--disable-tftp \
|
||||
--disable-ldap \
|
||||
--disable-ldaps \
|
||||
--without-libidn \
|
||||
--enable-threaded-resolver \
|
||||
--prefix="$DIR/install_data/php/ext/curl" \
|
||||
--disable-shared \
|
||||
--enable-static \
|
||||
$CONFIGURE_FLAGS >> "$DIR/install.log" 2>&1
|
||||
echo -n " compiling..."
|
||||
make -j $THREADS >> "$DIR/install.log" 2>&1
|
||||
|
|
@ -199,10 +256,35 @@ fi
|
|||
|
||||
#pthreads
|
||||
echo -n "[PHP pthreads] downloading $PTHREADS_VERSION..."
|
||||
wget http://pecl.php.net/get/pthreads-$PTHREADS_VERSION.tgz --no-check-certificate -q -O - | tar -zx >> "$DIR/install.log" 2>&1
|
||||
download_file "http://pecl.php.net/get/pthreads-$PTHREADS_VERSION.tgz" | tar -zx >> "$DIR/install.log" 2>&1
|
||||
mv pthreads-$PTHREADS_VERSION "$DIR/install_data/php/ext/pthreads"
|
||||
echo " done!"
|
||||
|
||||
#PHP YAML
|
||||
echo -n "[PHP YAML] downloading $PHPYAML_VERSION..."
|
||||
download_file "http://pecl.php.net/get/yaml-$PHPYAML_VERSION.tgz" | tar -zx >> "$DIR/install.log" 2>&1
|
||||
mv yaml-$PHPYAML_VERSION "$DIR/install_data/php/ext/yaml"
|
||||
echo " done!"
|
||||
|
||||
#YAML
|
||||
echo -n "[YAML] downloading $YAML_VERSION..."
|
||||
download_file "http://pyyaml.org/download/libyaml/yaml-$YAML_VERSION.tar.gz" | tar -zx >> "$DIR/install.log" 2>&1
|
||||
mv yaml-$YAML_VERSION yaml
|
||||
echo -n " checking..."
|
||||
cd yaml
|
||||
RANLIB=$RANLIB ./configure \
|
||||
--prefix="$DIR/install_data/php/ext/yaml" \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
$CONFIGURE_FLAGS >> "$DIR/install.log" 2>&1
|
||||
echo -n " compiling..."
|
||||
make -j $THREADS >> "$DIR/install.log" 2>&1
|
||||
echo -n " installing..."
|
||||
make install >> "$DIR/install.log" 2>&1
|
||||
echo -n " cleaning..."
|
||||
cd ..
|
||||
rm -r -f ./yaml
|
||||
echo " done!"
|
||||
|
||||
echo -n "[PHP]"
|
||||
set +e
|
||||
|
|
@ -230,11 +312,12 @@ if [ "$1" == "crosscompile" ]; then
|
|||
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-opcache=no"
|
||||
|
||||
fi
|
||||
./configure $OPTIMIZATION--prefix="$DIR/php5" \
|
||||
--exec-prefix="$DIR/php5" \
|
||||
./configure $OPTIMIZATION--prefix="$DIR/bin/php5" \
|
||||
--exec-prefix="$DIR/bin/php5" \
|
||||
--with-curl="$HAVE_CURL" \
|
||||
--with-zlib="$DIR/install_data/php/ext/zlib" \
|
||||
--with-zlib-dir="$DIR/install_data/php/ext/zlib" \
|
||||
--with-yaml="$DIR/install_data/php/ext/yaml" \
|
||||
$HAVE_LIBEDIT \
|
||||
--disable-libxml \
|
||||
--disable-xml \
|
||||
|
|
@ -259,6 +342,7 @@ $HAVE_LIBEDIT \
|
|||
--enable-pthreads \
|
||||
--enable-maintainer-zts \
|
||||
--enable-zend-signals \
|
||||
$HAVE_MYSQLI \
|
||||
--enable-embedded-mysqli \
|
||||
--enable-bcmath \
|
||||
--enable-cli \
|
||||
|
|
@ -272,12 +356,33 @@ fi
|
|||
make -j $THREADS >> "$DIR/install.log" 2>&1
|
||||
echo -n " installing..."
|
||||
make install >> "$DIR/install.log" 2>&1
|
||||
echo " generating php.ini..."
|
||||
|
||||
TIMEZONE=$(date +%Z)
|
||||
touch "$DIR/bin/php5/lib/php.ini"
|
||||
if [ "$1" != "crosscompile" ]; then
|
||||
OPCACHE_PATH=$(find "$DIR/bin/php5" -name opcache.so)
|
||||
echo "zend_extension=\"$OPCACHE_PATH\"" >> "$DIR/bin/php5/lib/php.ini"
|
||||
echo "opcache.enable=1" >> "$DIR/bin/php5/lib/php.ini"
|
||||
echo "opcache.enable_cli=1" >> "$DIR/bin/php5/lib/php.ini"
|
||||
echo "opcache.save_comments=0" >> "$DIR/bin/php5/lib/php.ini"
|
||||
echo "opcache.fast_shutdown=1" >> "$DIR/bin/php5/lib/php.ini"
|
||||
echo "opcache.max_accelerated_files=4096" >> "$DIR/bin/php5/lib/php.ini"
|
||||
echo "opcache.interned_strings_buffer=8" >> "$DIR/bin/php5/lib/php.ini"
|
||||
echo "opcache.memory_consumption=128" >> "$DIR/bin/php5/lib/php.ini"
|
||||
echo "opcache.optimization_level=0xffffffff" >> "$DIR/bin/php5/lib/php.ini"
|
||||
fi
|
||||
if [ "$HAVE_CURL" == "shared,/usr" ]; then
|
||||
echo "extension=curl.so" >> "$DIR/bin/php5/lib/php.ini"
|
||||
fi
|
||||
echo "date.timezone=$TIMEZONE" >> "$DIR/bin/php5/lib/php.ini"
|
||||
echo "short_open_tag=0" >> "$DIR/bin/php5/lib/php.ini"
|
||||
echo "asp_tags=0" >> "$DIR/bin/php5/lib/php.ini"
|
||||
|
||||
echo " done!"
|
||||
cd "$DIR"
|
||||
echo -n "[INFO] Cleaning up..."
|
||||
rm -r -f install_data/ >> "$DIR/install.log" 2>&1
|
||||
mv php5/bin/php bin/php
|
||||
rm -r -f php5/ >> "$DIR/install.log" 2>&1
|
||||
date >> "$DIR/install.log" 2>&1
|
||||
echo " done!"
|
||||
echo "[PocketMine] You should start the server now using \"./start.sh.\""
|
||||
|
|
|
|||
141
src/build/installer.sh
Normal file
141
src/build/installer.sh
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
#!/bin/bash
|
||||
PMMP_VERSION=""
|
||||
MAC_BUILD="PHP_5.5.9_x86_MacOS"
|
||||
RPI_BUILD="PHP_5.5.9_ARM_Raspbian_hard"
|
||||
AND_BUILD="PHP_5.5.9_ARMv7_Android"
|
||||
IOS_BUILD="PHP_5.5.9_ARMv6_iOS"
|
||||
update=off
|
||||
|
||||
#Needed to use aliases
|
||||
shopt -s expand_aliases
|
||||
type wget > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
alias download_file="wget --no-check-certificate -q -O -"
|
||||
else
|
||||
type curl >> /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
alias download_file="curl --insecure --silent --location"
|
||||
else
|
||||
echo "error, curl or wget not found"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
while getopts "udv:" opt; do
|
||||
case $opt in
|
||||
u)
|
||||
update=on
|
||||
;;
|
||||
d)
|
||||
PMMP_VERSION="master"
|
||||
;;
|
||||
v)
|
||||
PMMP_VERSION="$OPTARG"
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$PMMP_VERSION" == "" ]; then
|
||||
PMMP_VERSION=$(download_file "https://api.github.com/repos/PocketMine/PocketMine-MP/tags" | grep '"name": "[A-Za-z0-9_\.]*",' | head -1 | sed -r 's/[ ]*"name": "([A-Za-z0-9_\.]*)",[ ]*/\1/')
|
||||
if [ "$PMMP_VERSION" == "" ]; then
|
||||
echo "[ERROR] Couldn't get the latest PocketMine-MP version"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "[INFO] PocketMine-MP $PMMP_VERSION downloader & installer for Linux & Mac"
|
||||
|
||||
echo "[0/3] Cleaning..."
|
||||
rm -r -f src/
|
||||
rm -f PocketMine-MP.php
|
||||
rm -f README.md
|
||||
rm -f CONTRIBUTING.md
|
||||
rm -f LICENSE
|
||||
rm -f start.sh
|
||||
rm -f start.bat
|
||||
echo "[1/3] Downloading PocketMine-MP $PMMP_VERSION..."
|
||||
set -e
|
||||
download_file "https://github.com/PocketMine/PocketMine-MP/archive/$PMMP_VERSION.tar.gz" | tar -zx > /dev/null
|
||||
mv -f PocketMine-MP-$PMMP_VERSION/* ./
|
||||
rm -f -r PocketMine-MP-$PMMP_VERSION/
|
||||
rm -f ./start.cmd
|
||||
chmod +x ./start.sh
|
||||
chmod +x ./src/build/compile.sh
|
||||
if [ $update == on ]; then
|
||||
echo "[3/3] Skipping PHP recompilation due to user request"
|
||||
else
|
||||
echo -n "[3/3] Obtaining PHP:"
|
||||
echo " detecting if build is available..."
|
||||
if [ "$(uname -s)" == "Darwin" ]; then
|
||||
set +e
|
||||
UNAME_M=$(uname -m)
|
||||
IS_IOS=$(expr match $UNAME_M 'iP[a-zA-Z0-9,]*')
|
||||
set -e
|
||||
if [ $IS_IOS -gt 0 ]; then
|
||||
rm -r -f bin/ >> /dev/null 2>&1
|
||||
echo -n "[3/3] iOS PHP build available, downloading $IOS_BUILD.tar.gz..."
|
||||
download_file "http://sourceforge.net/projects/pocketmine/files/builds/$IOS_BUILD.tar.gz" | tar -zx > /dev/null 2>&1
|
||||
chmod +x ./bin/php5/bin/*
|
||||
echo -n " regenerating php.ini..."
|
||||
echo "date.timezone=$TIMEZONE" >> "./bin/php5/lib/php.ini"
|
||||
echo "short_open_tag=0" >> "./bin/php5/lib/php.ini"
|
||||
echo "asp_tags=0" >> "./bin/php5/lib/php.ini"
|
||||
echo " done"
|
||||
else
|
||||
rm -r -f bin/ >> /dev/null 2>&1
|
||||
echo -n "[3/3] Mac OSX PHP build available, downloading $MAC_BUILD.tar.gz..."
|
||||
download_file "http://sourceforge.net/projects/pocketmine/files/builds/$MAC_BUILD.tar.gz" | tar -zx > /dev/null 2>&1
|
||||
chmod +x ./bin/php5/bin/*
|
||||
echo -n " regenerating php.ini..."
|
||||
OPCACHE_PATH=$(find "./bin/php5" -name opcache.so)
|
||||
echo "zend_extension=\"$OPCACHE_PATH\"" > "./bin/php5/lib/php.ini"
|
||||
echo "opcache.enable=1" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.enable_cli=1" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.save_comments=0" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.fast_shutdown=1" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.max_accelerated_files=4096" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.interned_strings_buffer=8" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.memory_consumption=128" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.optimization_level=0xffffffff" >> "./bin/php5/lib/php.ini"
|
||||
echo "date.timezone=$TIMEZONE" >> "./bin/php5/lib/php.ini"
|
||||
echo "short_open_tag=0" >> "./bin/php5/lib/php.ini"
|
||||
echo "asp_tags=0" >> "./bin/php5/lib/php.ini"
|
||||
echo " done"
|
||||
fi
|
||||
else
|
||||
set +e
|
||||
grep -q BCM2708 /proc/cpuinfo > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
set -e
|
||||
rm -r -f bin/ >> /dev/null 2>&1
|
||||
echo -n "[3/3] Raspberry Pi PHP build available, downloading $RPI_BUILD.tar.gz..."
|
||||
download_file "http://sourceforge.net/projects/pocketmine/files/builds/$RPI_BUILD.tar.gz" | tar -zx > /dev/null 2>&1
|
||||
chmod +x ./bin/php5/bin/*
|
||||
echo -n " regenerating php.ini..."
|
||||
OPCACHE_PATH=$(find "./bin/php5" -name opcache.so)
|
||||
echo "zend_extension=\"$OPCACHE_PATH\"" > "./bin/php5/lib/php.ini"
|
||||
echo "opcache.enable=1" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.enable_cli=1" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.save_comments=0" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.fast_shutdown=1" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.max_accelerated_files=4096" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.interned_strings_buffer=8" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.memory_consumption=128" >> "./bin/php5/lib/php.ini"
|
||||
echo "opcache.optimization_level=0xffffffff" >> "./bin/php5/lib/php.ini"
|
||||
echo "date.timezone=$TIMEZONE" >> "./bin/php5/lib/php.ini"
|
||||
echo "short_open_tag=0" >> "./bin/php5/lib/php.ini"
|
||||
echo "asp_tags=0" >> "./bin/php5/lib/php.ini"
|
||||
echo " done"
|
||||
else
|
||||
set -e
|
||||
echo "[3/3] no build found, compiling PHP"
|
||||
exec ./src/build/compile.sh
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
echo "[INFO] Everything done! Run ./start.sh to start PocketMine-MP"
|
||||
exit 0
|
||||
182
src/build/jenkins.sh
Normal file
182
src/build/jenkins.sh
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
#!/bin/bash -x
|
||||
export PATH=/opt/arm-2013.05/bin:/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:/opt/arm-unknown-linux-uclibcgnueabi/bin:$PATH
|
||||
export THREADS=2
|
||||
|
||||
#Needed to use aliases
|
||||
shopt -s expand_aliases
|
||||
type wget > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
alias download_file="wget --no-check-certificate -q -O -"
|
||||
else
|
||||
type curl >> /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
alias download_file="curl --insecure --silent --location"
|
||||
else
|
||||
echo "error, curl or wget not found"
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf $WORKSPACE/compile.sh
|
||||
download_file "https://github.com/PocketMine/PocketMine-MP/raw/master/src/build/compile.sh" > $WORKSPACE/compile.sh
|
||||
chmod +x $WORKSPACE/compile.sh
|
||||
SCRIPT="$WORKSPACE/compile.sh"
|
||||
ARCHIVE=$WORKSPACE/archive
|
||||
COMPILEDIR=$WORKSPACE/compile
|
||||
rm -rf $ARCHIVE $COMPILEDIR
|
||||
mkdir -p $ARCHIVE
|
||||
mkdir -p $COMPILEDIR
|
||||
|
||||
if [ "$COMPILE_LINUX_32BIT" = "true" ];
|
||||
then
|
||||
mkdir -p {$COMPILEDIR,$ARCHIVE}/linux/32bit
|
||||
cd $COMPILEDIR/linux/32bit
|
||||
|
||||
CFLAGS=-m32 march=i686 mtune=generic $SCRIPT
|
||||
|
||||
cp -r $COMPILEDIR/linux/32bit/{install.log,bin/*,install_data/*} $ARCHIVE/linux/32bit/
|
||||
if [ ! -f $COMPILEDIR/linux/32bit/bin/php5/bin/php ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$COMPILE_LINUX_64BIT" = "true" ];
|
||||
then
|
||||
mkdir -p {$COMPILEDIR,$ARCHIVE}/linux/64bit
|
||||
cd $COMPILEDIR/linux/64bit
|
||||
|
||||
$SCRIPT
|
||||
|
||||
cp -r $COMPILEDIR/linux/64bit/{install.log,bin/*,install_data/*} $ARCHIVE/linux/64bit/
|
||||
if [ ! -f $COMPILEDIR/linux/64bit/bin/php5/bin/php ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$COMPILE_MAC" = "true" ];
|
||||
then
|
||||
mkdir -p {$COMPILEDIR,$ARCHIVE}/mac
|
||||
cd $COMPILEDIR/mac
|
||||
|
||||
curl -L http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz | tar -xz > /dev/null
|
||||
cd libtool-2.4.2
|
||||
./configure --prefix="$COMPILEDIR/mac/libtool" > /dev/null
|
||||
make > /dev/null
|
||||
make install
|
||||
cd ../
|
||||
rm -rf libtool-2.4.2
|
||||
export LIBTOOL="$COMPILEDIR/mac/libtool/bin/libtool"
|
||||
export LIBTOOLIZE="$COMPILEDIR/mac/libtool/bin/libtoolize"
|
||||
$SCRIPT mac curl
|
||||
|
||||
cp -r $COMPILEDIR/mac/{install.log,bin/*,install_data/*} $ARCHIVE/mac/
|
||||
if [ ! -f $COMPILEDIR/mac/bin/php5/bin/php ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$COMPILE_RPI" = "true" ];
|
||||
then
|
||||
mkdir -p {$COMPILEDIR,$ARCHIVE}/rpi
|
||||
cd $COMPILEDIR/rpi
|
||||
|
||||
$SCRIPT rpi
|
||||
|
||||
cp -r $COMPILEDIR/rpi/{install.log,bin/*,install_data/*} $ARCHIVE/rpi/
|
||||
if [ ! -f $COMPILEDIR/rpi/bin/php5/bin/php ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CROSSCOMPILE_ANDROID_ARMV6" = "true" ];
|
||||
then
|
||||
mkdir -p {$COMPILEDIR,$ARCHIVE}/crosscompile/android-armv6
|
||||
cd $COMPILEDIR/crosscompile/android-armv6
|
||||
|
||||
$SCRIPT crosscompile android-armv6
|
||||
|
||||
cp -r $COMPILEDIR/crosscompile/android-armv6/{install.log,bin/*,install_data/*} $ARCHIVE/crosscompile/android-armv6/
|
||||
if [ ! -f $COMPILEDIR/crosscompile/android-armv6/bin/php5/bin/php ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CROSSCOMPILE_ANDROID_ARMV7" = "true" ];
|
||||
then
|
||||
mkdir -p {$COMPILEDIR,$ARCHIVE}/crosscompile/android-armv7
|
||||
cd $COMPILEDIR/crosscompile/android-armv7
|
||||
|
||||
$SCRIPT crosscompile android-armv7
|
||||
|
||||
cp -r $COMPILEDIR/crosscompile/android-armv7/{install.log,bin/*,install_data/*} $ARCHIVE/crosscompile/android-armv7/
|
||||
if [ ! -f $COMPILEDIR/crosscompile/android-armv7/bin/php5/bin/php ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CROSSCOMPILE_IOS_ARMV6" = "true" ];
|
||||
then
|
||||
mkdir -p {$COMPILEDIR,$ARCHIVE}/crosscompile/ios-armv6
|
||||
cd $COMPILEDIR/crosscompile/ios-armv6
|
||||
curl -L http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz | tar -xz > /dev/null
|
||||
cd libtool-2.4.2
|
||||
./configure --prefix="$COMPILEDIR/crosscompile/ios-armv6/libtool" > /dev/null
|
||||
make > /dev/null
|
||||
make install
|
||||
cd ../
|
||||
rm -rf libtool-2.4.2
|
||||
export LIBTOOL="$COMPILEDIR/crosscompile/ios-armv6/libtool/bin/libtool"
|
||||
export LIBTOOLIZE="$COMPILEDIR/crosscompile/ios-armv6/libtool/bin/libtoolize"
|
||||
PATH="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH" $SCRIPT crosscompile ios-armv6
|
||||
|
||||
cp -r $COMPILEDIR/crosscompile/ios-armv6/{install.log,bin/*,install_data/*} $ARCHIVE/crosscompile/ios-armv6/
|
||||
if [ ! -f $COMPILEDIR/crosscompile/ios-armv6/bin/php5/bin/php ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CROSSCOMPILE_IOS_ARMV7" = "true" ];
|
||||
then
|
||||
mkdir -p {$COMPILEDIR,$ARCHIVE}/crosscompile/ios-armv7
|
||||
cd $COMPILEDIR/crosscompile/ios-armv7
|
||||
curl -L http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz | tar -xz > /dev/null
|
||||
cd libtool-2.4.2
|
||||
./configure --prefix="$COMPILEDIR/crosscompile/ios-armv7/libtool" > /dev/null
|
||||
make > /dev/null
|
||||
make install
|
||||
cd ../
|
||||
rm -rf libtool-2.4.2
|
||||
export LIBTOOL="$COMPILEDIR/crosscompile/ios-armv7/libtool/bin/libtool"
|
||||
export LIBTOOLIZE="$COMPILEDIR/crosscompile/ios-armv7/libtool/bin/libtoolize"
|
||||
PATH="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH" $SCRIPT crosscompile ios-armv7
|
||||
|
||||
cp -r $COMPILEDIR/crosscompile/ios-armv7/{install.log,bin/*,install_data/*} $ARCHIVE/crosscompile/ios-armv7/
|
||||
if [ ! -f $COMPILEDIR/crosscompile/ios-armv7/bin/php5/bin/php ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CROSSCOMPILE_RPI" = "true" ];
|
||||
then
|
||||
mkdir -p {$COMPILEDIR,$ARCHIVE}/crosscompile/rpi
|
||||
cd $COMPILEDIR/crosscompile/rpi
|
||||
|
||||
$SCRIPT crosscompile rpi
|
||||
|
||||
cp -r $COMPILEDIR/crosscompile/rpi/{install.log,bin/*,install_data/*} $ARCHIVE/crosscompile/rpi/
|
||||
if [ ! -f $COMPILEDIR/crosscompile/rpi/bin/php5/bin/php ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CROSSCOMPILE_MAC" = "true" ];
|
||||
then
|
||||
mkdir -p {$COMPILEDIR,$ARCHIVE}/crosscompile/mac
|
||||
cd $COMPILEDIR/crosscompile/mac
|
||||
|
||||
$SCRIPT crosscompile mac curl
|
||||
|
||||
cp -r $COMPILEDIR/crosscompile/mac/{install.log,bin/*,install_data/*} $ARCHIVE/crosscompile/mac/
|
||||
if [ ! -f $COMPILEDIR/crosscompile/mac/bin/php5/bin/php ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
|
@ -38,16 +38,15 @@ if(ini_get("date.timezone") == ""){ //No Timezone set
|
|||
$offset = round((intval(trim($t[0])) - time()) / 60) * 60;
|
||||
}
|
||||
|
||||
$daylight = (int) date("I");
|
||||
|
||||
$d = timezone_name_from_abbr("", $offset, $daylight);
|
||||
ini_set("date.timezone", $d);
|
||||
$daylight = (int) date("I");
|
||||
$d = timezone_name_from_abbr("", $offset, $daylight);
|
||||
@ini_set("date.timezone", $d);
|
||||
date_default_timezone_set($d);
|
||||
}else{
|
||||
$d = @date_default_timezone_get();
|
||||
if(strpos($d, "/") === false){
|
||||
$d = timezone_name_from_abbr($d);
|
||||
ini_set("date.timezone", $d);
|
||||
@ini_set("date.timezone", $d);
|
||||
date_default_timezone_set($d);
|
||||
}
|
||||
}
|
||||
|
|
@ -71,7 +70,7 @@ define("START_TIME", microtime(true));
|
|||
define("MAJOR_VERSION", "Alpha_1.3.11");
|
||||
define("CODENAME", "懐かしさ (Nostalgia)"); //i'm not very creative - kotyaralih
|
||||
define("CURRENT_MINECRAFT_VERSION", "v0.8.1 alpha");
|
||||
define("CURRENT_API_VERSION", 11);
|
||||
define("CURRENT_API_VERSION", 12);
|
||||
define("CURRENT_PHP_VERSION", "5.5");
|
||||
$gitsha1 = false;
|
||||
if(file_exists(FILE_PATH.".git/refs/heads/master")){ //Found Git information!
|
||||
|
|
|
|||
|
|
@ -54,6 +54,15 @@ if(!extension_loaded("sockets") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"")
|
|||
if(!extension_loaded("pthreads") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "pthreads." . PHP_SHLIB_SUFFIX) === false){
|
||||
console("[ERROR] Unable to find the pthreads extension.", true, true, 0);
|
||||
++$errors;
|
||||
}else{
|
||||
$pthreads_version = phpversion("pthreads");
|
||||
if(substr_count($pthreads_version, ".") < 2){
|
||||
$pthreads_version = "0.$pthreads_version";
|
||||
}
|
||||
if(version_compare($pthreads_version, "0.1.0") < 0){
|
||||
console("[ERROR] pthreads >= 0.1.0 is required, while you have $pthreads_version.", true, true, 0);
|
||||
++$errors;
|
||||
}
|
||||
}
|
||||
|
||||
if(!extension_loaded("curl") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "curl." . PHP_SHLIB_SUFFIX) === false){
|
||||
|
|
@ -66,6 +75,11 @@ if(!extension_loaded("sqlite3") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"")
|
|||
++$errors;
|
||||
}
|
||||
|
||||
if(!extension_loaded("yaml") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "yaml." . PHP_SHLIB_SUFFIX) === false){
|
||||
console("[ERROR] Unable to find the YAML extension.", true, true, 0);
|
||||
++$errors;
|
||||
}
|
||||
|
||||
if(!extension_loaded("zlib") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "zlib." . PHP_SHLIB_SUFFIX) === false){
|
||||
console("[ERROR] Unable to find the Zlib extension.", true, true, 0);
|
||||
++$errors;
|
||||
|
|
@ -94,4 +108,10 @@ foreach($inc as $s){
|
|||
$sha1sum ^= sha1_file($s, true);
|
||||
}
|
||||
/***REM_END***/
|
||||
define("SOURCE_SHA1SUM", bin2hex($sha1sum));
|
||||
define("SOURCE_SHA1SUM", bin2hex($sha1sum));
|
||||
|
||||
/***REM_START***/
|
||||
if(!file_exists(DATA_PATH."server.properties") and arg("no-wizard", false) != true){
|
||||
$installer = new Installer();
|
||||
}
|
||||
/***REM_END***/
|
||||
28
src/event/CancellableEvent.php
Normal file
28
src/event/CancellableEvent.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Events that can be cancelled must use the interface CancellableEvent
|
||||
*/
|
||||
|
||||
interface CancellableEvent{
|
||||
|
||||
}
|
||||
52
src/event/EventHandler.php
Normal file
52
src/event/EventHandler.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
abstract class EventHandler{
|
||||
|
||||
public static function callEvent(BaseEvent $event){
|
||||
$status = BaseEvent::NORMAL;
|
||||
foreach($event::$handlerPriority as $priority => $handlerList){
|
||||
if(count($handlerList) > 0){
|
||||
$event->setPrioritySlot($priority);
|
||||
foreach($handlerList as $handler){
|
||||
call_user_func($handler, $event);
|
||||
}
|
||||
if($event->isForced()){
|
||||
if($event instanceof CancellableEvent and $event->isCancelled()){
|
||||
return BaseEvent::DENY;
|
||||
}else{
|
||||
return BaseEvent::ALLOW;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($event instanceof CancellableEvent and $event->isCancelled()){
|
||||
return BaseEvent::DENY;
|
||||
}elseif($event->isAllowed()){
|
||||
return BaseEvent::ALLOW;
|
||||
}else{
|
||||
return BaseEvent::NORMAL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
52
src/event/EventPriority.php
Normal file
52
src/event/EventPriority.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
abstract class EventPriority{
|
||||
/**
|
||||
* Event call is of very low importance and should be ran first, to allow
|
||||
* other plugins to further customise the outcome
|
||||
*/
|
||||
const LOWEST = 5;
|
||||
/**
|
||||
* Event call is of low importance
|
||||
*/
|
||||
const LOW = 4;
|
||||
/**
|
||||
* Event call is neither important or unimportant, and may be ran normally
|
||||
*/
|
||||
const NORMAL = 3;
|
||||
/**
|
||||
* Event call is of high importance
|
||||
*/
|
||||
const HIGH = 2;
|
||||
/**
|
||||
* Event call is critical and must have the final say in what happens
|
||||
* to the event
|
||||
*/
|
||||
const HIGHEST = 1;
|
||||
/**
|
||||
* Event is listened to purely for monitoring the outcome of an event.
|
||||
*
|
||||
* No modifications to the event should be made under this priority
|
||||
*/
|
||||
const MONITOR = 0;
|
||||
|
||||
}
|
||||
29
src/event/PluginEvent.php
Normal file
29
src/event/PluginEvent.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Plugins that create events must use this class as the base
|
||||
*/
|
||||
|
||||
abstract class PluginEvent extends BaseEvent{
|
||||
|
||||
}
|
||||
24
src/event/ServerEvent.php
Normal file
24
src/event/ServerEvent.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
abstract class ServerEvent extends BaseEvent{
|
||||
|
||||
}
|
||||
41
src/event/server/DataPacketReceiveEvent.php
Normal file
41
src/event/server/DataPacketReceiveEvent.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class DataPacketReceiveEvent extends ServerEvent implements CancellableEvent{
|
||||
public static $handlers;
|
||||
public static $handlerPriority;
|
||||
|
||||
private $packet;
|
||||
private $player;
|
||||
|
||||
public function __construct(Player $player, RakNetDataPacket $packet){
|
||||
$this->packet = $packet;
|
||||
$this->player = $player;
|
||||
}
|
||||
|
||||
public function getPacket(){
|
||||
return $this->packet;
|
||||
}
|
||||
|
||||
public function getPlayer(){
|
||||
return $this->player;
|
||||
}
|
||||
}
|
||||
41
src/event/server/DataPacketSendEvent.php
Normal file
41
src/event/server/DataPacketSendEvent.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class DataPacketSendEvent extends ServerEvent implements CancellableEvent{
|
||||
public static $handlers;
|
||||
public static $handlerPriority;
|
||||
|
||||
private $packet;
|
||||
private $player;
|
||||
|
||||
public function __construct(Player $player, RakNetDataPacket $packet){
|
||||
$this->packet = $packet;
|
||||
$this->player = $player;
|
||||
}
|
||||
|
||||
public function getPacket(){
|
||||
return $this->packet;
|
||||
}
|
||||
|
||||
public function getPlayer(){
|
||||
return $this->player;
|
||||
}
|
||||
}
|
||||
36
src/event/server/PacketReceiveEvent.php
Normal file
36
src/event/server/PacketReceiveEvent.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class PacketReceiveEvent extends ServerEvent implements CancellableEvent{
|
||||
public static $handlers;
|
||||
public static $handlerPriority;
|
||||
|
||||
private $packet;
|
||||
|
||||
|
||||
public function __construct(Packet $packet){
|
||||
$this->packet = $packet;
|
||||
}
|
||||
|
||||
public function getPacket(){
|
||||
return $this->packet;
|
||||
}
|
||||
}
|
||||
36
src/event/server/PacketSendEvent.php
Normal file
36
src/event/server/PacketSendEvent.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class PacketSendEvent extends ServerEvent implements CancellableEvent{
|
||||
public static $handlers;
|
||||
public static $handlerPriority;
|
||||
|
||||
private $packet;
|
||||
|
||||
|
||||
public function __construct(Packet $packet){
|
||||
$this->packet = $packet;
|
||||
}
|
||||
|
||||
public function getPacket(){
|
||||
return $this->packet;
|
||||
}
|
||||
}
|
||||
287
src/installer/Installer.php
Normal file
287
src/installer/Installer.php
Normal file
|
|
@ -0,0 +1,287 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/***REM_START***/
|
||||
|
||||
class Installer{
|
||||
const DEFAULT_NAME = "Minecraft: PE Server";
|
||||
const DEFAULT_PORT = 19132;
|
||||
const DEFAULT_MEMORY = 128;
|
||||
const DEFAULT_PLAYERS = 20;
|
||||
const DEFAULT_GAMEMODE = SURVIVAL;
|
||||
|
||||
private $lang, $config;
|
||||
public function __construct(){
|
||||
echo "[*] PocketMine-MP set-up wizard\n";
|
||||
echo "[*] Please select a language:\n";
|
||||
foreach(InstallerLang::$languages as $short => $native){
|
||||
echo " $native => $short\n";
|
||||
}
|
||||
do{
|
||||
echo "[?] Language (en): ";
|
||||
$lang = strtolower($this->getInput("en"));
|
||||
if(!isset(InstallerLang::$languages[$lang])){
|
||||
echo "[!] Couldn't find the language\n";
|
||||
$lang = false;
|
||||
}
|
||||
}while($lang == false);
|
||||
$this->lang = new InstallerLang($lang);
|
||||
echo "[*] ".$this->lang->language_has_been_selected."\n";
|
||||
echo "[?] ".$this->lang->skip_installer." (y/N): ";
|
||||
if(strtolower($this->getInput()) === "y"){
|
||||
return;
|
||||
}
|
||||
echo "\n";
|
||||
$this->welcome();
|
||||
$this->generateBaseConfig();
|
||||
$this->generateUserFiles();
|
||||
|
||||
$this->networkFunctions();
|
||||
|
||||
$this->endWizard();
|
||||
}
|
||||
|
||||
private function welcome(){
|
||||
echo $this->lang->welcome_to_pocketmine."\n";
|
||||
echo <<<LICENSE
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
LICENSE;
|
||||
echo "\n[?] ".$this->lang->accept_license." (y/N): ";
|
||||
if(strtolower($this->getInput("n")) != "y"){
|
||||
echo "[!] ".$this->lang->you_have_to_accept_the_license."\n";
|
||||
sleep(5);
|
||||
exit(0);
|
||||
}
|
||||
echo "[*] ".$this->lang->setting_up_server_now."\n";
|
||||
echo "[*] ".$this->lang->default_values_info."\n";
|
||||
echo "[*] ".$this->lang->server_properties."\n";
|
||||
|
||||
}
|
||||
|
||||
private function generateBaseConfig(){
|
||||
$config = new Config(DATA_PATH . "server.properties", CONFIG_PROPERTIES);
|
||||
echo "[?] ".$this->lang->name_your_server." (".self::DEFAULT_NAME."): ";
|
||||
$config->set("server-name", $this->getInput(self::DEFAULT_NAME));
|
||||
echo "[*] ".$this->lang->port_warning."\n";
|
||||
do{
|
||||
echo "[?] ".$this->lang->server_port." (".self::DEFAULT_PORT."): ";
|
||||
$port = (int) $this->getInput(self::DEFAULT_PORT);
|
||||
if($port <= 0 or $port > 65535){
|
||||
echo "[!] ".$this->lang->invalid_port."\n";
|
||||
}
|
||||
}while($port <= 0 or $port > 65535);
|
||||
$config->set("server-port", $port);
|
||||
echo "[*] ".$this->lang->ram_warning."\n";
|
||||
echo "[?] ".$this->lang->server_ram." (".self::DEFAULT_MEMORY."): ";
|
||||
$config->set("memory-limit", ((int) $this->getInput(self::DEFAULT_MEMORY))."M");
|
||||
echo "[*] ".$this->lang->gamemode_info."\n";
|
||||
do{
|
||||
echo "[?] ".$this->lang->default_gamemode.": (".self::DEFAULT_GAMEMODE."): ";
|
||||
$gamemode = (int) $this->getInput(self::DEFAULT_GAMEMODE);
|
||||
}while($gamemode < 0 or $gamemode > 3);
|
||||
$config->set("gamemode", $gamemode);
|
||||
echo "[?] ".$this->lang->max_players." (".self::DEFAULT_PLAYERS."): ";
|
||||
$config->set("max-players", (int) $this->getInput(self::DEFAULT_PLAYERS));
|
||||
echo "[*] ".$this->lang->spawn_protection_info."\n";
|
||||
echo "[?] ".$this->lang->spawn_protection." (Y/n): ";
|
||||
if(strtolower($this->getInput("y")) == "n"){
|
||||
$config->set("spawn-protection", -1);
|
||||
}else{
|
||||
$config->set("spawn-protection", 16);
|
||||
}
|
||||
$config->save();
|
||||
}
|
||||
|
||||
private function generateUserFiles(){
|
||||
echo "[*] ".$this->lang->op_info."\n";
|
||||
echo "[?] ".$this->lang->op_who.": ";
|
||||
$op = strtolower($this->getInput(""));
|
||||
if($op === ""){
|
||||
echo "[!] ".$this->lang->op_warning."\n";
|
||||
}else{
|
||||
$ops = new Config(DATA_PATH."ops.txt", CONFIG_LIST);
|
||||
$ops->set($op, true);
|
||||
$ops->save();
|
||||
}
|
||||
echo "[*] ".$this->lang->whitelist_info."\n";
|
||||
echo "[?] ".$this->lang->whitelist_enable." (y/N): ";
|
||||
$config = new Config(DATA_PATH . "server.properties", CONFIG_PROPERTIES);
|
||||
if(strtolower($this->getInput("n")) === "y"){
|
||||
echo "[!] ".$this->lang->whitelist_warning."\n";
|
||||
$config->set("white-list", true);
|
||||
}else{
|
||||
$config->set("white-list", false);
|
||||
}
|
||||
$config->save();
|
||||
}
|
||||
|
||||
private function networkFunctions(){
|
||||
$config = new Config(DATA_PATH . "server.properties", CONFIG_PROPERTIES);
|
||||
echo "[!] ".$this->lang->query_warning1."\n";
|
||||
echo "[!] ".$this->lang->query_warning2."\n";
|
||||
echo "[?] ".$this->lang->query_disable." (y/N): ";
|
||||
if(strtolower($this->getInput("n")) === "y"){
|
||||
$config->set("enable-query", false);
|
||||
}else{
|
||||
$config->set("enable-query", true);
|
||||
}
|
||||
|
||||
echo "[*] ".$this->lang->rcon_info."\n";
|
||||
echo "[?] ".$this->lang->rcon_enable." (y/N): ";
|
||||
if(strtolower($this->getInput("n")) === "y"){
|
||||
$config->set("enable-rcon", true);
|
||||
$password = substr(base64_encode(Utils::getRandomBytes(20, false)), 3, 10);
|
||||
$config->set("rcon.password", $password);
|
||||
echo "[*] ".$this->lang->rcon_password.": ".$password."\n";
|
||||
}else{
|
||||
$config->set("enable-rcon", false);
|
||||
}
|
||||
|
||||
echo "[*] ".$this->lang->usage_info."\n";
|
||||
echo "[?] ".$this->lang->usage_disable." (y/N): ";
|
||||
if(strtolower($this->getInput("n")) === "y"){
|
||||
$config->set("send-usage", false);
|
||||
}else{
|
||||
$config->set("send-usage", true);
|
||||
}
|
||||
$config->save();
|
||||
|
||||
|
||||
echo "[*] ".$this->lang->ip_get."\n";
|
||||
|
||||
$externalIP = Utils::getIP();
|
||||
$internalIP = gethostbyname(trim(`hostname`));
|
||||
|
||||
echo "[!] ".$this->lang->get("ip_warning", array("{{EXTERNAL_IP}}", "{{INTERNAL_IP}}"), array($externalIP, $internalIP))."\n";
|
||||
echo "[!] ".$this->lang->ip_confirm;
|
||||
$this->getInput();
|
||||
}
|
||||
|
||||
private function endWizard(){
|
||||
echo "[*] ".$this->lang->you_have_finished."\n";
|
||||
echo "[*] ".$this->lang->pocketmine_plugins."\n";
|
||||
echo "[*] ".$this->lang->pocketmine_will_start."\n\n\n";
|
||||
sleep(4);
|
||||
}
|
||||
|
||||
private function getInput($default = ""){
|
||||
$input = trim(fgets(STDIN));
|
||||
return $input === "" ? $default:$input;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class InstallerLang{
|
||||
public static $languages = array(
|
||||
"en" => "English",
|
||||
"es" => "Español",
|
||||
"zh" => "中文",
|
||||
"ru" => "Pyccĸий",
|
||||
"ja" => "日本語",
|
||||
"de" => "Deutsch",
|
||||
//"vi" => "Tiếng Việt",
|
||||
"ko" => "한국어",
|
||||
"fr" => "Français",
|
||||
"it" => "Italiano",
|
||||
//"lv" => "Latviešu",
|
||||
"nl" => "Nederlands",
|
||||
//"pt" => "Português",
|
||||
"sv" => "Svenska",
|
||||
"fi" => "Suomi",
|
||||
"tr" => "Türkçe",
|
||||
//"et" => "Eesti",
|
||||
);
|
||||
private $texts = array();
|
||||
private $lang;
|
||||
private $langfile;
|
||||
public function __construct($lang = ""){
|
||||
if(file_exists(FILE_PATH."src/lang/Installer/".$lang.".ini")){
|
||||
$this->lang = $lang;
|
||||
$this->langfile = FILE_PATH."src/lang/Installer/".$lang.".ini";
|
||||
}else{
|
||||
$l = glob(FILE_PATH."src/lang/Installer/".$lang."_*.ini");
|
||||
if(count($l) > 0){
|
||||
$files = array();
|
||||
foreach($l as $file){
|
||||
$files[$file] = filesize($file);
|
||||
}
|
||||
arsort($files);
|
||||
reset($files);
|
||||
$l = key($files);
|
||||
$l = substr($l, strrpos($l, "/") + 1, -4);
|
||||
$this->lang = isset(self::$languages[$l]) ? $l:$lang;
|
||||
$this->langfile = FILE_PATH."src/lang/Installer/".$l.".ini";
|
||||
}else{
|
||||
$this->lang = "en";
|
||||
$this->langfile = FILE_PATH."src/lang/Installer/en.ini";
|
||||
}
|
||||
}
|
||||
|
||||
$this->loadLang(FILE_PATH."src/lang/Installer/en.ini", "en");
|
||||
if($this->lang !== "en"){
|
||||
$this->loadLang($this->langfile, $this->lang);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getLang(){
|
||||
return ($this->lang);
|
||||
}
|
||||
|
||||
public function loadLang($langfile, $lang = "en"){
|
||||
$this->texts[$lang] = array();
|
||||
$texts = explode("\n", str_replace(array("\r", "\/\/"), array("", "//"), file_get_contents($langfile)));
|
||||
foreach($texts as $line){
|
||||
$line = trim($line);
|
||||
if($line === ""){
|
||||
continue;
|
||||
}
|
||||
$line = explode("=", $line);
|
||||
$this->texts[$lang][array_shift($line)] = str_replace(array("\\n", "\\N",), "\n", implode("=", $line));
|
||||
}
|
||||
}
|
||||
|
||||
public function get($name, $search = array(), $replace = array()){
|
||||
if(!isset($this->texts[$this->lang][$name])){
|
||||
if($this->lang !== "en" and isset($this->texts["en"][$name])){
|
||||
return $this->texts["en"][$name];
|
||||
}else{
|
||||
return $name;
|
||||
}
|
||||
}elseif(count($search) > 0){
|
||||
return str_replace($search, $replace, $this->texts[$this->lang][$name]);
|
||||
}else{
|
||||
return $this->texts[$this->lang][$name];
|
||||
}
|
||||
}
|
||||
|
||||
public function __get($name){
|
||||
return $this->get($name);
|
||||
}
|
||||
|
||||
}
|
||||
/***REM_END***/
|
||||
6
src/lang/Installer/af_ZA.ini
Normal file
6
src/lang/Installer/af_ZA.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
21
src/lang/Installer/ar_SA.ini
Normal file
21
src/lang/Installer/ar_SA.ini
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
language_has_been_selected=وقد تم اختيار اللغة الإنجليزية بشكل صحيح.
|
||||
skip_installer=هل تريد تخطي معالج الإعداد؟
|
||||
|
||||
welcome_to_pocketmine=مرحبا بكم في PocketMine-MP! \ nBefore بدء إعداد ملقم جديد لديك لقبول الترخيص. \ مرخص nPocketMine-MP تحت رخصة LGPL، \ n التي يمكنك أن تقرأ فتح ملف الترخيص على هذا folder.Do كنت ترغب في تخطي المعالج انشاء؟
|
||||
accept_license=هل تقبل رخصة؟
|
||||
you_have_to_accept_the_license=عليك أن تقبل رخصة LGPL إلى الاستمرار في استخدام PocketMine-MP
|
||||
|
||||
setting_up_server_now=أنت ذاهب لإعداد الخادم الخاص بك الآن.
|
||||
default_values_info=إذا كنت لا تريد تغيير القيمة الافتراضية، فقط اضغط على Enter.
|
||||
server_properties=يمكنك تحريرها في وقت لاحق على الملف server.properties.
|
||||
|
||||
name_your_server=إعطاء اسم على الخادم الخاص بك
|
||||
port_warning=لا تقم بتغيير قيمة المنفذ الافتراضي إذا كان هذا هو الخادم الخاص بك أولا.
|
||||
server_port=منفذ خادم
|
||||
invalid_port=منفذ خادم غير صالحة
|
||||
ram_warning=ذاكرة الوصول العشوائي هو الحد الأقصى لمقدار الذاكرة سوف تستخدم PocketMine-MP. ينصح قيمة 128-256 ميغا بايت
|
||||
server_ram=RAM الخادم في ميغا بايت
|
||||
gamemode_info=الاختيار بين العمل الإبداعي (1) أو البقاء على قيد الحياة (0)
|
||||
|
||||
|
||||
|
||||
6
src/lang/Installer/cs_CZ.ini
Normal file
6
src/lang/Installer/cs_CZ.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
45
src/lang/Installer/de_DE.ini
Normal file
45
src/lang/Installer/de_DE.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=Englisch haben Sie richtig ausgewählt.
|
||||
skip_installer=Möchten Sie den Setup-Assistenten überspringen?
|
||||
|
||||
welcome_to_pocketmine=Willkommen auf PocketMine-MP!\nBevor Sie die Einrichtung Ihres neuen Server starten, müssen Sie die Lizenz akzeptieren. \nPocketMine-MP ist unter der LGPL-Lizenz, \ndamit Sie die LIZENZ in diesem Ordner lesen oder öffnen können.
|
||||
accept_license=Akzeptieren Sie die Lizenz?
|
||||
you_have_to_accept_the_license=Sie müssen die LGPL Lizenz akzeptieren, um weiterhin PocketMine-MP zu nutzen
|
||||
|
||||
setting_up_server_now=Sie werden jetzt Ihren Server einrichten.
|
||||
default_values_info=Wenn Sie nicht den Standardwert ändern möchten, drücken Sie einfach Enter.
|
||||
server_properties=Sie können sie später in der server.properties Datei bearbeiten.
|
||||
|
||||
name_your_server=Geben Sie einen Namen für Ihren Server ein
|
||||
port_warning=Ändern Sie den Standard-Port-Wert nicht, wenn dies Ihr erster Server ist.
|
||||
server_port=Server-Port
|
||||
invalid_port=Ungültiger Server-Port
|
||||
ram_warning=Der RAM ist die maximale Speichermenge die PocketMine-MP verwenden kann. Ein Wert zwischen 128 bis 256 MB wird empfohlen
|
||||
server_ram=Server RAM in MB
|
||||
gamemode_info=Wählen Sie zwischen Kreativ (1) oder Überleben (0)
|
||||
default_gamemode=Standard Spielmodus
|
||||
max_players=Max. Online-Spieler
|
||||
spawn_protection_info=Der Spawn-Schutz verbietet Platzierung/Zerstörung der Blöcke in der Einstiegszone, was aber nicht für OPs gilt
|
||||
spawn_protection=Aktiviere Spawn-Schutz?
|
||||
|
||||
op_info=Ein OP ist der Admin Spieler des Servers. OPs können mehr Befehle ausführen als normale Spieler
|
||||
op_who=OP Spieler Name (z.B. dein Spiel-Name)
|
||||
op_warning=Sie werden in der Lage sein einen OP Benutzer später mit /op <player> hinzuzufügen
|
||||
whitelist_info=Nur die Spieler auf der white-list können zu ihrem Spiel verbinden.
|
||||
whitelist_enable=Möchten Sie die white-list aktivieren?
|
||||
whitelist_warning=Sie müssen die Spieler zur white-list hinzufügen
|
||||
|
||||
query_warning1=Query ist ein Protokoll das von verschiedenen Tools verwendet wird, um Informationen von Ihrem Server und eingeloggten Spieler zu nehmen.
|
||||
query_warning2=Wenn Sie es deaktivieren, werden Sie nicht in der Lage sein, Server-Listen zu verwenden.
|
||||
query_disable=Wollen Sie Query deaktivieren?
|
||||
rcon_info=RCON ist ein Protokoll für eine Remote-Verbindung mit der Server-Konsole, mit der Benutzung eines Passworts.
|
||||
rcon_enable=Wollen Sie RCON aktivieren?
|
||||
rcon_password=RCON Passwort (Sie können es später ändern)
|
||||
usage_info=Die anonymen Nutzungsdaten ermöglichen es uns, globale Statistiken für PocketMine-MP und seine Plugins zu berechnen. Sie können sie auf stats.pocketmine.net ansehen
|
||||
usage_disable=Wollen Sie die anonyme Nutzung deaktivieren?
|
||||
ip_get=Bekomme deine externe IP und interne IP
|
||||
ip_warning=Ihre externe IP ist {{EXTERNAL_IP}}. Evtl. musst Du einen port-forward auf deine interne IP {{INTERNAL_IP}} machen
|
||||
ip_confirm=Achten Sie darauf, wenn Sie den Port forwarden müssen und Sie es überspringen, dass keine externen Spieler beitreten können. [Drücke Enter]
|
||||
|
||||
you_have_finished=Sie haben den Setup-Assistenten korrekt beendet
|
||||
pocketmine_will_start=PocketMine-MP wird nun gestartet. Tippe /help um die Liste der verfügbaren Befehle anzuzeigen.
|
||||
pocketmine_plugins=Überprüfen Sie das Plugin Repository um neue Features, Minispiele, oder einen erweiterten Schutz für Ihren Server hinzuzufügen
|
||||
6
src/lang/Installer/el_GR.ini
Normal file
6
src/lang/Installer/el_GR.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
45
src/lang/Installer/en.ini
Normal file
45
src/lang/Installer/en.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=English has been correctly selected.
|
||||
skip_installer=Do you want to skip the set-up wizard?
|
||||
|
||||
welcome_to_pocketmine=Welcome to PocketMine-MP!\nBefore starting setting up your new server you have to accept the license.\nPocketMine-MP is licensed under the LGPL License,\nthat you can read opening the LICENSE file on this folder.
|
||||
accept_license=Do you accept the License?
|
||||
you_have_to_accept_the_license=You have to accept the LGPL license to continue using PocketMine-MP
|
||||
|
||||
setting_up_server_now=You are going to set up your server now.
|
||||
default_values_info=If you don't want to change the default value, just press Enter.
|
||||
server_properties=You can edit them later on the server.properties file.
|
||||
|
||||
name_your_server=Give a name to your server
|
||||
port_warning=Do not change the default port value if this is your first server.
|
||||
server_port=Server port
|
||||
invalid_port=Invalid server port
|
||||
ram_warning=The RAM is the maximum amount of memory PocketMine-MP will use. A value of 128-256 MB is recommended
|
||||
server_ram=Server RAM in MB
|
||||
gamemode_info=Choose between Creative (1) or Survival (0)
|
||||
default_gamemode=Default Game mode
|
||||
max_players=Max. online players
|
||||
spawn_protection_info=The spawn protection disallows placing/breaking blocks in the spawn zone except for OPs
|
||||
spawn_protection=Enable spawn protection?
|
||||
|
||||
op_info=An OP is the player admin of the server. OPs can run more commands than normal players
|
||||
op_who=OP player name (example, your game name)
|
||||
op_warning=You will be able to add an OP user later using /op <player>
|
||||
whitelist_info=The white-list only allows players in it to join.
|
||||
whitelist_enable=Do you want to enable the white-list?
|
||||
whitelist_warning=You will have to add the players to the white-list
|
||||
|
||||
query_warning1=Query is a protocol used by diferent tools to get information of your server and players logged in.
|
||||
query_warning2=If you disable it, you won't be able to use server lists.
|
||||
query_disable=Do you want to disable Query?
|
||||
rcon_info=RCON is a protocol to remote connect with the server console using a password.
|
||||
rcon_enable=Do you want to enable RCON?
|
||||
rcon_password=RCON password (you can change it later)
|
||||
usage_info=The anonymous usage data allows us to calculate global statistics for PocketMine-MP and its plugins. You can view them on stats.pocketmine.net
|
||||
usage_disable=Do you want to disable the anonymous usage?
|
||||
ip_get=Getting your external IP and internal IP
|
||||
ip_warning=Your external IP is {{EXTERNAL_IP}}. You may have to port-forward to your internal IP {{INTERNAL_IP}}
|
||||
ip_confirm=Be sure to check it, if you have to forward and you skip that, no external players will be able to join. [Press Enter]
|
||||
|
||||
you_have_finished=You have finished the set-up wizard correctly
|
||||
pocketmine_will_start=PocketMine-MP will now start. Type /help to view the list of available commands.
|
||||
pocketmine_plugins=Check the Plugin Repository to add new features, minigames, or advanced protection to your server
|
||||
45
src/lang/Installer/en_AU.ini
Normal file
45
src/lang/Installer/en_AU.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=English has been correctly selected.
|
||||
skip_installer=Do you want to skip the set-up wizard?
|
||||
|
||||
welcome_to_pocketmine=Welcome to PocketMine-MP!\nBefore starting setting up your new server you have to accept the license.\nPocketMine-MP is licensed under the LGPL License,\nthat you can read opening the LICENSE file on this folder.
|
||||
accept_license=Do you accept the License?
|
||||
you_have_to_accept_the_license=You have to accept the LGPL license to continue using PocketMine-MP
|
||||
|
||||
setting_up_server_now=You are going to set up your server now.
|
||||
default_values_info=If you don't want to change the default value, just press Enter.
|
||||
server_properties=You can edit them later on the server.properties file.
|
||||
|
||||
name_your_server=Give a name to your server
|
||||
port_warning=Do not change the default port value if this is your first server.
|
||||
server_port=Server port
|
||||
invalid_port=Invalid server port
|
||||
ram_warning=The RAM is the maximum amount of memory PocketMine-MP will use. A value of 128-256 MB is recommended
|
||||
server_ram=Server RAM in MB
|
||||
gamemode_info=Choose between Creative (1) or Survival (0)
|
||||
default_gamemode=Default Game mode
|
||||
max_players=Max. online players
|
||||
spawn_protection_info=The spawn protection disallows placing/breaking blocks in the spawn zone except for OPs
|
||||
spawn_protection=Enable spawn protection?
|
||||
|
||||
op_info=An OP is the player admin of the server. OPs can run more commands than normal players
|
||||
op_who=OP player name (example, your game name)
|
||||
op_warning=You will be able to add an OP user later using /op <player>
|
||||
whitelist_info=The white-list only allows players in it to join.
|
||||
whitelist_enable=Do you want to enable the white-list?
|
||||
whitelist_warning=You will have to add the players to the white-list
|
||||
|
||||
query_warning1=Query is a protocol used by diferent tools to get information of your server and players logged in.
|
||||
query_warning2=If you disable it, you won't be able to use server lists.
|
||||
query_disable=Do you want to disable Query?
|
||||
rcon_info=RCON is a protocol to remote connect with the server console using a password.
|
||||
rcon_enable=Do you want to enable RCON?
|
||||
rcon_password=RCON password (you can change it later)
|
||||
usage_info=The anonymous usage data allows us to calculate global statistics for PocketMine-MP and its plugins. You can view them on stats.pocketmine.net
|
||||
usage_disable=Do you want to disable the anonymous usage?
|
||||
ip_get=Getting your external IP and internal IP
|
||||
ip_warning=Your external IP is {{EXTERNAL_IP}}. You may have to port-forward to your internal IP {{INTERNAL_IP}}
|
||||
ip_confirm=Be sure to check it, if you have to forward and you skip that, no external players will be able to join. [Press Enter]
|
||||
|
||||
you_have_finished=You have finished the set-up wizard correctly
|
||||
pocketmine_will_start=PocketMine-MP will now start. Type /help to view the list of available commands.
|
||||
pocketmine_plugins=Check the Plugin Repository to add new features, minigames, or advanced protection to your server
|
||||
45
src/lang/Installer/en_CA.ini
Normal file
45
src/lang/Installer/en_CA.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=English has been correctly selected.
|
||||
skip_installer=Do you want to skip the set-up wizard?
|
||||
|
||||
welcome_to_pocketmine=Welcome to PocketMine-MP!\nBefore starting setting up your new server you have to accept the license.\nPocketMine-MP is licensed under the LGPL License,\nthat you can read opening the LICENSE file on this folder.
|
||||
accept_license=Do you accept the License?
|
||||
you_have_to_accept_the_license=You have to accept the LGPL license to continue using PocketMine-MP
|
||||
|
||||
setting_up_server_now=You are going to set up your server now.
|
||||
default_values_info=If you don't want to change the default value, just press Enter.
|
||||
server_properties=You can edit them later on the server.properties file.
|
||||
|
||||
name_your_server=Give a name to your server
|
||||
port_warning=Do not change the default port value if this is your first server.
|
||||
server_port=Server port
|
||||
invalid_port=Invalid server port
|
||||
ram_warning=The RAM is the maximum amount of memory PocketMine-MP will use. A value of 128-256 MB is recommended
|
||||
server_ram=Server RAM in MB
|
||||
gamemode_info=Choose between Creative (1) or Survival (0)
|
||||
default_gamemode=Default Game mode
|
||||
max_players=Max. online players
|
||||
spawn_protection_info=The spawn protection disallows placing/breaking blocks in the spawn zone except for OPs
|
||||
spawn_protection=Enable spawn protection?
|
||||
|
||||
op_info=An OP is the player admin of the server. OPs can run more commands than normal players
|
||||
op_who=OP player name (example, your game name)
|
||||
op_warning=You will be able to add an OP user later using /op <player>
|
||||
whitelist_info=The white-list only allows players in it to join.
|
||||
whitelist_enable=Do you want to enable the white-list?
|
||||
whitelist_warning=You will have to add the players to the white-list
|
||||
|
||||
query_warning1=Query is a protocol used by diferent tools to get information of your server and players logged in.
|
||||
query_warning2=If you disable it, you won't be able to use server lists.
|
||||
query_disable=Do you want to disable Query?
|
||||
rcon_info=RCON is a protocol to remote connect with the server console using a password.
|
||||
rcon_enable=Do you want to enable RCON?
|
||||
rcon_password=RCON password (you can change it later)
|
||||
usage_info=The anonymous usage data allows us to calculate global statistics for PocketMine-MP and its plugins. You can view them on stats.pocketmine.net
|
||||
usage_disable=Do you want to disable the anonymous usage?
|
||||
ip_get=Getting your external IP and internal IP
|
||||
ip_warning=Your external IP is {{EXTERNAL_IP}}. You may have to port-forward to your internal IP {{INTERNAL_IP}}
|
||||
ip_confirm=Be sure to check it, if you have to forward and you skip that, no external players will be able to join. [Press Enter]
|
||||
|
||||
you_have_finished=You have finished the set-up wizard correctly
|
||||
pocketmine_will_start=PocketMine-MP will now start. Type /help to view the list of available commands.
|
||||
pocketmine_plugins=Check the Plugin Repository to add new features, minigames, or advanced protection to your server
|
||||
45
src/lang/Installer/en_GB.ini
Normal file
45
src/lang/Installer/en_GB.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=English has been correctly selected.
|
||||
skip_installer=Do you want to skip the set-up wizard?
|
||||
|
||||
welcome_to_pocketmine=Welcome to PocketMine-MP!\nBefore starting setting up your new server you have to accept the license.\nPocketMine-MP is licensed under the LGPL License,\nthat you can read opening the LICENSE file on this folder.
|
||||
accept_license=Do you accept the License?
|
||||
you_have_to_accept_the_license=You have to accept the LGPL license to continue using PocketMine-MP
|
||||
|
||||
setting_up_server_now=You are going to set up your server now.
|
||||
default_values_info=If you don't want to change the default value, just press Enter.
|
||||
server_properties=You can edit them later on the server.properties file.
|
||||
|
||||
name_your_server=Give a name to your server
|
||||
port_warning=Do not change the default port value if this is your first server.
|
||||
server_port=Server port
|
||||
invalid_port=Invalid server port
|
||||
ram_warning=The RAM is the maximum amount of memory PocketMine-MP will use. A value of 128-256 MB is recommended
|
||||
server_ram=Server RAM in MB
|
||||
gamemode_info=Choose between Creative (1) or Survival (0)
|
||||
default_gamemode=Default Game mode
|
||||
max_players=Max. online players
|
||||
spawn_protection_info=The spawn protection disallows placing/breaking blocks in the spawn zone except for OPs
|
||||
spawn_protection=Enable spawn protection?
|
||||
|
||||
op_info=An OP is the player admin of the server. OPs can run more commands than normal players
|
||||
op_who=OP player name (example, your game name)
|
||||
op_warning=You will be able to add an OP user later using /op <player>
|
||||
whitelist_info=The white-list only allows players in it to join.
|
||||
whitelist_enable=Do you want to enable the white-list?
|
||||
whitelist_warning=You will have to add the players to the white-list
|
||||
|
||||
query_warning1=Query is a protocol used by diferent tools to get information of your server and players logged in.
|
||||
query_warning2=If you disable it, you won't be able to use server lists.
|
||||
query_disable=Do you want to disable Query?
|
||||
rcon_info=RCON is a protocol to remote connect with the server console using a password.
|
||||
rcon_enable=Do you want to enable RCON?
|
||||
rcon_password=RCON password (you can change it later)
|
||||
usage_info=The anonymous usage data allows us to calculate global statistics for PocketMine-MP and its plugins. You can view them on stats.pocketmine.net
|
||||
usage_disable=Do you want to disable the anonymous usage?
|
||||
ip_get=Getting your external IP and internal IP
|
||||
ip_warning=Your external IP is {{EXTERNAL_IP}}. You may have to port-forward to your internal IP {{INTERNAL_IP}}
|
||||
ip_confirm=Be sure to check it, if you have to forward and you skip that, no external players will be able to join. [Press Enter]
|
||||
|
||||
you_have_finished=You have finished the set-up wizard correctly
|
||||
pocketmine_will_start=PocketMine-MP will now start. Type /help to view the list of available commands.
|
||||
pocketmine_plugins=Check the Plugin Repository to add new features, minigames, or advanced protection to your server
|
||||
6
src/lang/Installer/en_PT.ini
Normal file
6
src/lang/Installer/en_PT.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
45
src/lang/Installer/en_US.ini
Normal file
45
src/lang/Installer/en_US.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=English has been correctly selected.
|
||||
skip_installer=Do you want to skip the set-up wizard?
|
||||
|
||||
welcome_to_pocketmine=Welcome to PocketMine-MP!\nBefore starting setting up your new server you have to accept the license.\nPocketMine-MP is licensed under the LGPL License,\nthat you can read opening the LICENSE file on this folder.
|
||||
accept_license=Do you accept the License?
|
||||
you_have_to_accept_the_license=You have to accept the LGPL license to continue using PocketMine-MP
|
||||
|
||||
setting_up_server_now=You are going to set up your server now.
|
||||
default_values_info=If you don't want to change the default value, just press Enter.
|
||||
server_properties=You can edit them later on the server.properties file.
|
||||
|
||||
name_your_server=Give a name to your server
|
||||
port_warning=Do not change the default port value if this is your first server.
|
||||
server_port=Server port
|
||||
invalid_port=Invalid server port
|
||||
ram_warning=The RAM is the maximum amount of memory PocketMine-MP will use. A value of 128-256 MB is recommended
|
||||
server_ram=Server RAM in MB
|
||||
gamemode_info=Choose between Creative (1) or Survival (0)
|
||||
default_gamemode=Default Game mode
|
||||
max_players=Max. online players
|
||||
spawn_protection_info=The spawn protection disallows placing/breaking blocks in the spawn zone except for OPs
|
||||
spawn_protection=Enable spawn protection?
|
||||
|
||||
op_info=An OP is the player admin of the server. OPs can run more commands than normal players
|
||||
op_who=OP player name (example, your game name)
|
||||
op_warning=You will be able to add an OP user later using /op <player>
|
||||
whitelist_info=The white-list only allows players in it to join.
|
||||
whitelist_enable=Do you want to enable the white-list?
|
||||
whitelist_warning=You will have to add the players to the white-list
|
||||
|
||||
query_warning1=Query is a protocol used by diferent tools to get information of your server and players logged in.
|
||||
query_warning2=If you disable it, you won't be able to use server lists.
|
||||
query_disable=Do you want to disable Query?
|
||||
rcon_info=RCON is a protocol to remote connect with the server console using a password.
|
||||
rcon_enable=Do you want to enable RCON?
|
||||
rcon_password=RCON password (you can change it later)
|
||||
usage_info=The anonymous usage data allows us to calculate global statistics for PocketMine-MP and its plugins. You can view them on stats.pocketmine.net
|
||||
usage_disable=Do you want to disable the anonymous usage?
|
||||
ip_get=Getting your external IP and internal IP
|
||||
ip_warning=Your external IP is {{EXTERNAL_IP}}. You may have to port-forward to your internal IP {{INTERNAL_IP}}
|
||||
ip_confirm=Be sure to check it, if you have to forward and you skip that, no external players will be able to join. [Press Enter]
|
||||
|
||||
you_have_finished=You have finished the set-up wizard correctly
|
||||
pocketmine_will_start=PocketMine-MP will now start. Type /help to view the list of available commands.
|
||||
pocketmine_plugins=Check the Plugin Repository to add new features, minigames, or advanced protection to your server
|
||||
45
src/lang/Installer/es_AR.ini
Normal file
45
src/lang/Installer/es_AR.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=Español sido seleccionado correctamente.
|
||||
skip_installer=Quieres saltarte el asistente de configuración?
|
||||
|
||||
welcome_to_pocketmine=Bienvenido a PocketMine-MP!\nAntes de comenzar a configurar tu nuevo servidor, tienes que aceptar la licencia.\nPocketMine-MP está licenciado con la licencia LGPL,\nque puedes leer abriendo el archivo LICENSE en esta carpeta.
|
||||
accept_license=¿Aceptas la Licencia?
|
||||
you_have_to_accept_the_license=Tienes que aceptar la licencia LGPL antes de continuar usando PocketMine-MP
|
||||
|
||||
setting_up_server_now=La configuración del servidor va a comenzar.
|
||||
default_values_info=Si no quieres cambiar el valor por defecto, pulsa Enter.
|
||||
server_properties=Puedes editar todo despues en el fichero server.properties.
|
||||
|
||||
name_your_server=Nombre del servidor
|
||||
port_warning=No cambies el puerto por defecto si este es tu primer servidor.
|
||||
server_port=Puerto del servidor
|
||||
invalid_port=Puerto inválido
|
||||
ram_warning=La RAM esla máxima memoria que PocketMine-MP usará. Es recomendado usar un valor de 128-256 MB
|
||||
server_ram=RAM del servidor en MB
|
||||
gamemode_info=Elige entre Creativo (1) o Supervivencia (0)
|
||||
default_gamemode=Modo de juego por defecto
|
||||
max_players=Límite de jugadores
|
||||
spawn_protection_info=La protección del inicio bloquea poner/romper bloques en la zona de inicio, excepto los OPs
|
||||
spawn_protection=¿Activar protección de inicio?
|
||||
|
||||
op_info=Un OP es el jugador administrador del servidor. Los OPs pueden usar más comandos que los jugadores normales
|
||||
op_who=Jugador OP (por ejemplo, tu nombre de jugador)
|
||||
op_warning=Podrás añadir mas OPs después usando /op <jugador>
|
||||
whitelist_info=La lista blanca permite entrar únicamente a los jugadores en ella.
|
||||
whitelist_enable=¿Quieres activar la lista blanca?
|
||||
whitelist_warning=Tendrás que añadir los jugadores a la lista blanca
|
||||
|
||||
query_warning1=Query es un protocolo usado por diferentes herramientas para conseguir informacion de tu servidor y los jugadores conectados.
|
||||
query_warning2=Si lo desactivas, no podrás usar listas de servidores.
|
||||
query_disable=¿Quieres desactivar Query?
|
||||
rcon_info=RCON es un protocolo que permite conectarte a la consola del servidor usando una contraseña.
|
||||
rcon_enable=¿Queres activar RCON?
|
||||
rcon_password=Contraseña RCON (puedes cambiarla después)
|
||||
usage_info=Los datos de uso anónimos nos permiten calcular estadísticas globales para PocketMine-MP y sus plugins. Puedes verlas en stats.pocketmine.net
|
||||
usage_disable=¿Quieres desactivar las datos de uso anónimos?
|
||||
ip_get=Obteniendo tu IP externa e IP interna
|
||||
ip_warning=Tu IP externa es {{EXTERNAL_IP}}. Quizás debas redireccionar el puerto a tu IP interna {{INTERNAL_IP}}
|
||||
ip_confirm=Asegúrate de comprobarlo, ya que si debes hacerlo y lo saltas, ningún jugador externo podra entrar. [Pulsa Enter]
|
||||
|
||||
you_have_finished=Has completado el asistente de configuración correctamente
|
||||
pocketmine_will_start=PocketMine-MP se iniciará ahora. Escribe /help para ver la lista de los comandos disponibles.
|
||||
pocketmine_plugins=Ves al Repositorio de Plugins para añadir nuevas funcionalidades, minijuegos o protección avanzada a tu servidor
|
||||
45
src/lang/Installer/es_ES.ini
Normal file
45
src/lang/Installer/es_ES.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=Español sido seleccionado correctamente.
|
||||
skip_installer=Quieres saltarte el asistente de configuración?
|
||||
|
||||
welcome_to_pocketmine=Bienvenido a PocketMine-MP!\nAntes de comenzar a configurar tu nuevo servidor, tienes que aceptar la licencia.\nPocketMine-MP está licenciado con la licencia LGPL,\nque puedes leer abriendo el archivo LICENSE en esta carpeta.
|
||||
accept_license=¿Aceptas la Licencia?
|
||||
you_have_to_accept_the_license=Tienes que aceptar la licencia LGPL antes de continuar usando PocketMine-MP
|
||||
|
||||
setting_up_server_now=La configuración del servidor va a comenzar.
|
||||
default_values_info=Si no quieres cambiar el valor por defecto, pulsa Enter.
|
||||
server_properties=Puedes editar todo despues en el fichero server.properties.
|
||||
|
||||
name_your_server=Nombre del servidor
|
||||
port_warning=No cambies el puerto por defecto si este es tu primer servidor.
|
||||
server_port=Puerto del servidor
|
||||
invalid_port=Puerto inválido
|
||||
ram_warning=La RAM esla máxima memoria que PocketMine-MP usará. Es recomendado usar un valor de 128-256 MB
|
||||
server_ram=RAM del servidor en MB
|
||||
gamemode_info=Elige entre Creativo (1) o Supervivencia (0)
|
||||
default_gamemode=Modo de juego por defecto
|
||||
max_players=Límite de jugadores
|
||||
spawn_protection_info=La protección del inicio bloquea poner/romper bloques en la zona de inicio, excepto los OPs
|
||||
spawn_protection=¿Activar protección de inicio?
|
||||
|
||||
op_info=Un OP es el jugador administrador del servidor. Los OPs pueden usar más comandos que los jugadores normales
|
||||
op_who=Jugador OP (por ejemplo, tu nombre de jugador)
|
||||
op_warning=Podrás añadir mas OPs después usando /op <jugador>
|
||||
whitelist_info=La lista blanca permite entrar únicamente a los jugadores en ella.
|
||||
whitelist_enable=¿Quieres activar la lista blanca?
|
||||
whitelist_warning=Tendrás que añadir los jugadores a la lista blanca
|
||||
|
||||
query_warning1=Query es un protocolo usado por diferentes herramientas para conseguir informacion de tu servidor y los jugadores conectados.
|
||||
query_warning2=Si lo desactivas, no podrás usar listas de servidores.
|
||||
query_disable=¿Quieres desactivar Query?
|
||||
rcon_info=RCON es un protocolo que permite conectarte a la consola del servidor usando una contraseña.
|
||||
rcon_enable=¿Queres activar RCON?
|
||||
rcon_password=Contraseña RCON (puedes cambiarla después)
|
||||
usage_info=Los datos de uso anónimos nos permiten calcular estadísticas globales para PocketMine-MP y sus plugins. Puedes verlas en stats.pocketmine.net
|
||||
usage_disable=¿Quieres desactivar las datos de uso anónimos?
|
||||
ip_get=Obteniendo tu IP externa e IP interna
|
||||
ip_warning=Tu IP externa es {{EXTERNAL_IP}}. Quizás debas redireccionar el puerto a tu IP interna {{INTERNAL_IP}}
|
||||
ip_confirm=Asegúrate de comprobarlo, ya que si debes hacerlo y lo saltas, ningún jugador externo podra entrar. [Pulsa Enter]
|
||||
|
||||
you_have_finished=Has completado el asistente de configuración correctamente
|
||||
pocketmine_will_start=PocketMine-MP se iniciará ahora. Escribe /help para ver la lista de los comandos disponibles.
|
||||
pocketmine_plugins=Ves al Repositorio de Plugins para añadir nuevas funcionalidades, minijuegos o protección avanzada a tu servidor
|
||||
45
src/lang/Installer/es_MX.ini
Normal file
45
src/lang/Installer/es_MX.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=Español seleccionado.
|
||||
skip_installer=Deseas omitir el asistente de configuración?
|
||||
|
||||
welcome_to_pocketmine=¡Bienvenido a PocketMine-MP!\nAntes de empezar a configurar tu nuevo servidor necesitas aceptar la licensia.\nLa licensia de PocketMine-MP esta bajo la licensia LGPL,\n que puedes leer abriendo el archivo "License" en esta carpeta.
|
||||
accept_license=Aceptas la licensia?
|
||||
you_have_to_accept_the_license=Debes aceptar la licensia de LPGL para continuar utilizando PocketMine-MP
|
||||
|
||||
setting_up_server_now=Empezemos con la configuración.
|
||||
default_values_info=Si no quieres cambiar los valores predeterminados pulsa Enter.
|
||||
server_properties=Puedes editarlos despues editando el archivo "server.properties".
|
||||
|
||||
name_your_server=Escribe el nombre de tu servidor
|
||||
port_warning=No cambies el puerto predeterminado si este es tu primer servidor.
|
||||
server_port=Puerto del servidor
|
||||
invalid_port=Puerto invalido
|
||||
ram_warning=La RAM es la máxima memoria que PocketMine-MP usará. Se recomienda utilizar un mínimo de 128 MB
|
||||
server_ram=RAM del servidor en MB
|
||||
gamemode_info=Escoge entre Creativo (1) o Survival (0)
|
||||
default_gamemode=Modo de juego predeterminado
|
||||
max_players=Límite de jugadores
|
||||
spawn_protection_info=La protección del inicio impide poner/romper bloques en la zona de aparición, a excepción de los OPs
|
||||
spawn_protection=Activar la protección del spawn?
|
||||
|
||||
op_info=Un OP es el administrador del servidor. Los OPs pueden ejecutar más comandos que los usuarios normales
|
||||
op_who=OP nombre del jugador (Por ejemplo: Tu nombre de Minecraft)
|
||||
op_warning=Podrás añadir más usuarios a la lista de OPs después, utilizando el comando /op <player>
|
||||
whitelist_info=La lista blanca (white-list) permite hacer una lista de invitados, solo los usuarios en la lista podrán entrar a tu servidor.
|
||||
whitelist_enable=¿Deseas activar la lista blanca?
|
||||
whitelist_warning=Tendrás que añadir usuarios a la lista blanca
|
||||
|
||||
query_warning1=Query es un protocolo usado por diferentes herramientas para conseguir informacion de tu servidor y los jugadores conectados.
|
||||
query_warning2=Si lo desactivas, no podrás registrar tu servidor en una lista de servidores.
|
||||
query_disable=¿Quieres desactivar Query?
|
||||
rcon_info=RCON es un protocolo que te permite conectarte a la consola de tu servidor usando una contraseña.
|
||||
rcon_enable=¿Queres activar RCON?
|
||||
rcon_password=Contraseña para RCON (puedes cambiarla después)
|
||||
usage_info=Los datos de uso anónimos nos permiten calcular estadísticas globales para PocketMine-MP y sus plugins. Puedes verlas en stats.pocketmine.net
|
||||
usage_disable=¿Quieres desactivar las datos de uso anónimos?
|
||||
ip_get=Obteniendo tu IP externa e IP interna
|
||||
ip_warning=Tu IP externa es {{EXTERNAL_IP}}. Quizás debas redireccionar el puerto a tu IP interna: {{INTERNAL_IP}}
|
||||
ip_confirm=Asegúrate de que este bien, ya que si debes hacerlo y lo saltas, ningún jugador podrá entrar si esta fuera de tu red WIFI. [Pulsa Enter]
|
||||
|
||||
you_have_finished=Has completado el asistente de configuración correctamente
|
||||
pocketmine_will_start=PocketMine-MP se iniciará ahora. Escribe /help para ver la lista de los comandos disponibles.
|
||||
pocketmine_plugins=Ve al Repositorio de Plugins para añadir nuevas funciones, minijuegos o protección avanzada a tu servidor
|
||||
6
src/lang/Installer/et_EE.ini
Normal file
6
src/lang/Installer/et_EE.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
7
src/lang/Installer/fi_FI.ini
Normal file
7
src/lang/Installer/fi_FI.ini
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
|
||||
|
||||
default_gamemode=Normaali Peli Tila
|
||||
|
||||
|
||||
|
||||
45
src/lang/Installer/fr_FR.ini
Normal file
45
src/lang/Installer/fr_FR.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=Français a été correctement sélectionné.
|
||||
skip_installer=Voulez-vous passer l'assistant d'installation?
|
||||
|
||||
welcome_to_pocketmine=Bienvenue sur PocketMine-MP!\nAvant de commencer à paramétrer votre nouveau serveur, vous devez accepter la license d'utilisation.\nPocketMine-MP est sous licence LGPL,\nvous pouvez la lire en ouvrant le fichier LICENSE dans ce dossier.
|
||||
accept_license=Acceptez-vous la Licence?
|
||||
you_have_to_accept_the_license=Vous devez accepter la licence LGPL pour continuer à utiliser PocketMine-MP
|
||||
|
||||
setting_up_server_now=Vous êtes maintenant prêt à paramétrer votre serveur.
|
||||
default_values_info=Si vous ne voulez pas changer la valeur par défaut, pressez juste Enter.
|
||||
server_properties=Vous pouvez éditer cela plus tard dans le fichier server.properties.
|
||||
|
||||
name_your_server=Donnez un nom à votre serveur
|
||||
port_warning=Ne changez pas la valeur par défaut du port si c'est votre premier serveur.
|
||||
server_port=Port du serveur
|
||||
invalid_port=Port du serveur invalide
|
||||
ram_warning=La RAM est au maximum de sa capacité par rapport à la mémoire utilisée par PocketMine-MP. Une valeur de 128-256 MB est recommandée
|
||||
server_ram=RAM du serveur en MB
|
||||
gamemode_info=Choisir entre Créatif (1) ou Survie (1)
|
||||
default_gamemode=Mode de jeu par défaut
|
||||
max_players=Joueurs max. en ligne
|
||||
spawn_protection_info=La protection de spawn désactive le placement/cassement de blocs dans la zone de spawn excepté pour les OPs
|
||||
spawn_protection=Activer la protection de spawn?
|
||||
|
||||
op_info=Un OP est un administrateur du serveur. Les OPs peuvent exécuter plus de commandes que les joueurs normaux
|
||||
op_who=Nom de joueur OP (exemple, votre nom de jeu)
|
||||
op_warning=Vous serez en mesure d'ajouter un OP plus tard en utilisant /op <player>
|
||||
whitelist_info=La white-list autorise seulement les joueurs présents sur celle-ci.
|
||||
whitelist_enable=Voulez-vous activer la white-list?
|
||||
whitelist_warning=Vous devrez ajouter les joueurs à la white-list
|
||||
|
||||
query_warning1=Query est un protocole utilisé par différents outils pour avoir des informations sur votre serveur et les joueurs connectés.
|
||||
query_warning2=Si vous le désactivez, vous ne pourrez pas utiliser les listes du serveur.
|
||||
query_disable=Voulez-vous désactiver Query?
|
||||
rcon_info=RCON est un protocole pour se connecter à distance à la console du serveur par un mot de passe.
|
||||
rcon_enable=Voulez-vous activer RCON?
|
||||
rcon_password=Mot de passe RCON (vous pouvez le changer plus tard)
|
||||
usage_info=Les données d'utilisation anonyme vous permettent de calculer les statistiques globales de PocketMine-MP et ses plugins. Vous pouvez les voir sur stats.pocketmine.net
|
||||
usage_disable=Voulez-vous désactiver l'utilisation anonyme?
|
||||
ip_get=Obtention de votre IP externe et IP interne
|
||||
ip_warning=Votre IP externe est {{EXTERNAL_IP}}. Vous pourriez avoir à transmettre au port votre IP interne {{INTERNAL_IP}}
|
||||
ip_confirm=Vérifiez-le bien, si vous avancez et sautez cette étape, les joueurs extérieurs ne pourront pas rejoindre votre serveur. [Tapez Enter]
|
||||
|
||||
you_have_finished=Vous avez correctement terminé l'assistant d'installation
|
||||
pocketmine_will_start=PocketMine-MP démarre. Tapez /help pour voir la liste des commandes disponibles.
|
||||
pocketmine_plugins=Vérification du répertoire de plugin pour ajouter des nouvelles caractéristiques, mini-jeux, ou une protection avancée de votre serveur
|
||||
6
src/lang/Installer/ga_IE.ini
Normal file
6
src/lang/Installer/ga_IE.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
6
src/lang/Installer/he_IL.ini
Normal file
6
src/lang/Installer/he_IL.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
6
src/lang/Installer/id_ID.ini
Normal file
6
src/lang/Installer/id_ID.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
45
src/lang/Installer/it_IT.ini
Normal file
45
src/lang/Installer/it_IT.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=Italiano selezionato correttamente.
|
||||
skip_installer=Vuoi evitare il programma di installazione?
|
||||
|
||||
welcome_to_pocketmine=Benvenuto in PocketMine-MP!\nPrima di iniziare a impostare il tuo nuovo server devi accettare la licenza.\nPocketMine-MP è distribuito sotto licenza LGPL,\nche potrai leggere aprendo il file LICNESE in questa cartella.
|
||||
accept_license=Accetti i termini della licenza?
|
||||
you_have_to_accept_the_license=Devi accettare i termini della licenza LGPL per continuare ad usare PocketMine-MP
|
||||
|
||||
setting_up_server_now=Stai per iniziare ad impostare il tuo server.
|
||||
default_values_info=Se non vuoi cambiare i valori proposti, premi Invio.
|
||||
server_properties=Potrai modificarli in seguito nel file server.properties.
|
||||
|
||||
name_your_server=Dai un nome al tuo server
|
||||
port_warning=Non cambiare la porta predefinita se questo è il tuo primo server.
|
||||
server_port=Porta del server
|
||||
invalid_port=Porta del server non valida
|
||||
ram_warning=La RAM è la massima quantità di memoria che PocketMine-MP potrà usare. Un valore di 128-256 MB è raccomandata
|
||||
server_ram=RAM del server in MB
|
||||
gamemode_info=Scegli tra Creative (1) o Survival (0)
|
||||
default_gamemode=Modalità di gioco predefinita
|
||||
max_players=Players massimi
|
||||
spawn_protection_info=La protezione dello spawn non permette di piazzare/rompere blocchi nella zona di spawn, ad eccezione degli Operatori
|
||||
spawn_protection=Abilitare la protezione dello spawn?
|
||||
|
||||
op_info=Un Operatore (OP) è un player amministratore del server. Gli operatori possono usare più comandi dei players normali
|
||||
op_who=Nome del player OP (ad esempio, il tuo nome in gioco)
|
||||
op_warning=Sarà possibile aggiungere un player OP più tardi con /op <player>
|
||||
whitelist_info=La white-list permette solo ad i players in lista di entrare.
|
||||
whitelist_enable=Vuoi abilitare la white-list?
|
||||
whitelist_warning=Dovrai aggiungere i players in white-list
|
||||
|
||||
query_warning1=Query è un protocollo usato da differenti programmi per ottenere informazioni dal tuo server e dai player che ci entrano.
|
||||
query_warning2=Se lo disabiliti, non sarai in grado di usare le liste server.
|
||||
query_disable=Vuoi disabilitare Query?
|
||||
rcon_info=RCON è un protocollo per connessioni remote con la console del server grazie all'utilizzo di una password.
|
||||
rcon_enable=Vuoi abilitare RCON?
|
||||
rcon_password=Password RCON (potrai cambiarla più tardi)
|
||||
usage_info=L'invio anonimo dei dati di utilizzo ci aiuta a calcolare statistiche generali per PocketMine-MP ed i suoi plugins. Puoi vederle su stats.pocketmine.net
|
||||
usage_disable=Vuoi disabilitare l'invio anonimo dei dati di utilizzo?
|
||||
ip_get=Ottengo il tuo indirizzo IP interno ed esterno
|
||||
ip_warning=Il tuo indirizzo IP è {{EXTERNAL_IP}}. Potresti dover redirigere le porte al tuo IP interno: {{INTERNAL_IP}}
|
||||
ip_confirm=Sii sicuro di farlo, se devi redirigere le porte e non lo fai, nessun player esterno sarà in grado di entrare. [Premi Invio]
|
||||
|
||||
you_have_finished=Hai completato l'installazione con successo
|
||||
pocketmine_will_start=Ora PocketMine-MP si avvierà. Digita /help per visualizzare la lista dei comandi disponibili.
|
||||
pocketmine_plugins=Controlla il Repository dei Plugins per aggiungere nuove funzionalità, minigiochi, o protezioni avanzate al tuo server
|
||||
45
src/lang/Installer/ja_JP.ini
Normal file
45
src/lang/Installer/ja_JP.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=日本語に設定されました
|
||||
skip_installer=セットアップウィザードをスキップしますか?
|
||||
|
||||
welcome_to_pocketmine=PocketMine-MPをインストールして頂きありがとうございます!サーバのセットアップを開始するにはライセンスに同意する必要があります。PocketMine-MPはLGPLライセンスに基づいて認可されており、これについてはこのフォルダ内のLICENSEファイルから確認することができます。
|
||||
accept_license=ライセンスに同意しますか?
|
||||
you_have_to_accept_the_license=PocketMine-MPを使用するにはLGPLライセンスに同意する必要があります
|
||||
|
||||
setting_up_server_now=サーバのセットアップを開始します
|
||||
default_values_info=設定を変更しない場合は、Enterキーを押してください。
|
||||
server_properties=それらの設定は後からでもserver.propertiesファイルから変更できます
|
||||
|
||||
name_your_server=あなたのサーバに名前を付けてください
|
||||
port_warning=これが初めてのサーバの場合は、ポート番号をデフォルトから変更しないでください
|
||||
server_port=サーバポート
|
||||
invalid_port=不適切なサーバポートです
|
||||
ram_warning=RAMはPocketMine-MPが使用し得るメモリの最大値を示しています。128-256MBの範囲内で指定することを推奨します。
|
||||
server_ram=RAMの単位はMBです
|
||||
gamemode_info=クリエイティブモード(1)、またはサバイバルモード(0)を選択してください
|
||||
default_gamemode=デフォルトのゲームモード
|
||||
max_players=最大プレイヤー数
|
||||
spawn_protection_info=スポーンプロテクションは、OPでないプレイヤーによるスポーン地点付近でのブロックの設置/破壊を制限します
|
||||
spawn_protection=スポーンプロテクションを有効にしますか?
|
||||
|
||||
op_info=OPとはそのサーバの管理権限を指します。OPを持ったプレイヤーは他のプレイヤーよりも多くのコマンドを使用できます。
|
||||
op_who=OPプレイヤー名(例: あなたのゲーム内での名前)
|
||||
op_warning=後から/op <プレイヤー名>コマンドを実行してOPプレイヤーを追加することもできます
|
||||
whitelist_info=ホワイトリストはこのサーバに入ることのできるプレイヤーを制限します。
|
||||
whitelist_enable=ホワイトリストを有効にしますか?
|
||||
whitelist_warning=プレイヤーをホワイトリストに追加してください
|
||||
|
||||
query_warning1=クエリは他のツールによりあなたのサーバやプレイヤーの情報を取得するためのプロトコルです。
|
||||
query_warning2=それを無効にした場合、サーバリストを使用できなくなる可能性があります。
|
||||
query_disable=クエリを無効にしますか?
|
||||
rcon_info=RCONはパスワードを用いてサーバコンソールからリモート接続するためのプロトコルです。
|
||||
rcon_enable=RCONを有効にしますか?
|
||||
rcon_password=RCONパスワード(後から変更できます)
|
||||
usage_info=世界中で使われているPocketMine-MPやそのプラグインの統計を算出するために匿名の使用データが送信されます。統計はこちらから確認できます。stats.pocketmine.net
|
||||
usage_disable=匿名の使用データの送信を拒否しますか?
|
||||
ip_get=グローバルIPとプライベートIPの取得
|
||||
ip_warning=あなたのグローバルIPは{{EXTERNAL_IP}}です。プライベートIP{{INTERNAL_IP}}をポート解放してください。
|
||||
ip_confirm=必ずポート解放ができているか確認してください。ポートが解放できていなかった場合、他のプレイヤーがサーバに入れなくなる恐れがあります。[Enterキーを押してください]
|
||||
|
||||
you_have_finished=セットアップは正しく終了しました
|
||||
pocketmine_will_start=PocketMine_MPを起動します。/helpと入力すれば使用可能なコマンド一覧を表示できます。
|
||||
pocketmine_plugins=拡張機能や管理システム、ミニゲームなどを追加できるプラグインリポジトリも確認してみてください
|
||||
45
src/lang/Installer/ko_KR.ini
Normal file
45
src/lang/Installer/ko_KR.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=한국어가 언어로 선택되었습니다.
|
||||
skip_installer=설치 마법사를 건너뛰겠습니까?
|
||||
|
||||
welcome_to_pocketmine=PocketMine-MP에 오신 것을 환영합니다!\n서버 설치를 시작하기 전, 약관에 동의해야 합니다. \nPocketMine-MP는 GNU 약소 일반 공중 사용 허가서(LGPL) 하에 배포되고 있습니다. \n이 폴더에서 약관을 읽을 수 있습니다.
|
||||
accept_license=약관에 동의하십니까?
|
||||
you_have_to_accept_the_license=GNU 약소 일반 공중 사용 허가서(LGPL)에 동의하셔야 PocketMine-MP를 사용할 수 있습니다.
|
||||
|
||||
setting_up_server_now=서버 설정을 시작합니다.
|
||||
default_values_info=기본값을 수정하고 싶지 않으면, 엔터를 누르십시기 바랍니다.
|
||||
server_properties=이 설정들은 server.properties 파일에서 세부적으로 변경이 가능합니다.
|
||||
|
||||
name_your_server=당신의 서버 이름을 입력하시기 바랍니다.
|
||||
port_warning=만약 당신이 서버를 처음 설정한다면 포트 값을 변경하지 마세요.
|
||||
server_port=서버 포트
|
||||
invalid_port=서버 포트가 잘못 입력되었습니다.
|
||||
ram_warning=RAM 값은 PocketMine-MP에 할당할 메모리의 크기입니다. 128~256MB를 권장합니다.
|
||||
server_ram=서버 RAM (MB)
|
||||
gamemode_info=크리에이티브 (1) 또는 서바이벌 (0) 게임모드 중 하나를 고르세요.
|
||||
default_gamemode=기본 게임 모드
|
||||
max_players=최대 동시 접속 인원 수
|
||||
spawn_protection_info=스폰 보호는 OP를 제외한 유저들이 스폰 지역 근처에서 블럭을 놓거나 부수는것을 방지합니다.
|
||||
spawn_protection=스폰 지역 보호를 사용하겠습니까?
|
||||
|
||||
op_info=OP는 서버 관리자를 뜻합니다. OP는 일반 플레이어보다 훨씬 많은 명령어들을 사용할 수 있습니다
|
||||
op_who=OP 권한을 줄 플레이어 이름(예: 당신의 닉네임)
|
||||
op_warning=또는 이후에 /op <플레이어 이름> 을 입력해 그 유저에게 OP 권한을 줄 수도 있습니다
|
||||
whitelist_info=화이트리스트를 사용하면 허용된 플레이어들만 서버에 접속할 수 있습니다.
|
||||
whitelist_enable=화이트리스트를 사용하겠습니까?
|
||||
whitelist_warning=당신은 접속을 허용할 플레이어들의 이름을 적어야 합니다
|
||||
|
||||
query_warning1=쿼리 (Query)는 당신의 서버와 현재 접속한 플레이어들의 정보를 알 수 있게 해주는 여러가지 기능이 담긴 프로토콜입니다.
|
||||
query_warning2=쿼리를 사용하지 않으면, 당신은 서버 리스트를 사용할 수 없게 됩니다.
|
||||
query_disable=쿼리를 사용하지 않겠습니까?
|
||||
rcon_info=RCON은 비밀 번호를 사용하여 서버 명령창에 원격으로 접소갈 수 있는 프로토콜입니다.
|
||||
rcon_enable=RCON 을 사용하시겠습니까?
|
||||
rcon_password=RCON 비밀번호 설정 (나중에 server.properties 에서 변경이 가능합니다.)
|
||||
usage_info=익명 사용 통계 전송을 허용하면 PocketMine-MP가 세계의 서버 상황과 플러그인들을 통계화하는 데 사용할 수 있습니다. 당신은 stats.pocketmine.net에서 이를 확인할 수 있습니다
|
||||
usage_disable=익명 사용 통계 전송을 사용하지 않으시겠습니까?
|
||||
ip_get=내/외부 IP 주소 얻기
|
||||
ip_warning=당신의 외부 IP는 {{EXTERNAL_IP}}입니다. 당신의 내부 IP {{INTERNAL_IP}}로 포트포워딩이 필요할 수 있습니다
|
||||
ip_confirm=신중하게 확인하세요. 만약 포트 포워딩이 필요하지만 하지 않을 경우 외부에서 플레이어들이 접속할 수 없게 됩니다. [계속 하시려면 엔터를 누르세요]
|
||||
|
||||
you_have_finished=PocketMine-MP의 설치가 모두 완료되었습니다.
|
||||
pocketmine_will_start=PocketMine-MP 서버를 구동합니다. /help로 사용 가능한 모든 명령어의 목록을 보시기 바랍니다.
|
||||
pocketmine_plugins=플러그인 저장소에서 새로운 기능을 추가하세요. 새로운 기능, 미니게임을 추가하거나 고급 기능으로 당신의 서버를 보호할 수 있습니다
|
||||
6
src/lang/Installer/lv_LV.ini
Normal file
6
src/lang/Installer/lv_LV.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
6
src/lang/Installer/ms_MY.ini
Normal file
6
src/lang/Installer/ms_MY.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
6
src/lang/Installer/mt_MT.ini
Normal file
6
src/lang/Installer/mt_MT.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
45
src/lang/Installer/nl_NL.ini
Normal file
45
src/lang/Installer/nl_NL.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=Nederlands is nu geselecteerd.
|
||||
skip_installer=Wil je de set-up help overslaan?
|
||||
|
||||
welcome_to_pocketmine=Welkom op de PocketMine-MP!\nVoordat je je nieuwe server klaarmaakt, moet je onze gebruikersovereenkomst accepteren.\nPocketMine-MP is gelicenseerd onder LGPL License,\nwat je kunt lezen door de LICENSE file in deze map te openen.
|
||||
accept_license=Accepteer je de gebruikersvoorwaarden?
|
||||
you_have_to_accept_the_license=Je moet de LGPL gebruikersvoorwaarden accepteren voordat je verder gaat met het gebruiken van de services van PocketMine-MP
|
||||
|
||||
setting_up_server_now=Je gaat nu een server klaarmaken voor gebruik.
|
||||
default_values_info=Druk op Enter als je de gebruikelijke waarde niet wilt veranderen.
|
||||
server_properties=Je kunt ze later veranderen in het server.properties bestand.
|
||||
|
||||
name_your_server=Geef een naam aan je server
|
||||
port_warning=Verander de gebruikelijke poort niet als dit je eerste server is.
|
||||
server_port=Server poort
|
||||
invalid_port=Ongeldige server poort
|
||||
ram_warning=De RAM is het maximale aantal memory wat PocketMine-MP zal gebruiken. Een aantal tussen de 128 en de 256 MB is aanbevolen
|
||||
server_ram=Server RAM in MB
|
||||
gamemode_info=Kies tussen Creative (1) of Survival (0)
|
||||
default_gamemode=Gebruikelijke spelmodus
|
||||
max_players=Maximale online spelers
|
||||
spawn_protection_info=De spawnbeveiliging verbiedt het plaatsen/slopen van blokken in het spawn gebied behalve voor OP's
|
||||
spawn_protection=Wil je spawnbeveiliging aanzetten?
|
||||
|
||||
op_info=Een OP is de beheerder van de server. OP's kunnen meer commando's gebruiken dan normale spelers
|
||||
op_who=OP speler naam (voorbeeld: je username)
|
||||
op_warning=Je kunt later meerdere OP's toevoegen met het commando /op <player>
|
||||
whitelist_info=De whitelist laat alleen de spelers die in de lijst staan op de server.
|
||||
whitelist_enable=Wil je de whitelist aanzetten?
|
||||
whitelist_warning=Je moet wel spelers aan de whitelist toevoegen.
|
||||
|
||||
query_warning1=Query is een protocol dat gebruikt wordt door verschillende programma's om informatie te verkrijgen van je server en welke spelers ingelogd zijn.
|
||||
query_warning2=Als je het uitzet, zul je geen mogelijkheid hebben om server lijsten te gebruiken.
|
||||
query_disable=Wil je Query uitschakelen?
|
||||
rcon_info=RCON is een protocol om je server op afstand te beheren via de server console door middel van een wachtwoord.
|
||||
rcon_enable=Wil je RCON aanzetten?
|
||||
rcon_password=RCON wachtwoord (deze kun je later veranderen)
|
||||
usage_info=De anonieme gebruikersdata laat ons toe om de globale statistieken voor PocketMine-ML te zien en zijn plugins. Je kunt de statistieken zien op stats.pocketmine.net
|
||||
usage_disable=Wil je anonieme data uitschakelen?
|
||||
ip_get=Je externe IP en interne IP verkrijgen
|
||||
ip_warning=Je externe IP is {{EXTERNAL_IP}}. Het is mogelijk dat je moet port-forwarden naar je interne IP:{{INTERNAL_IP}}
|
||||
ip_confirm=Wees niet bang om het te controleren, als je moet port-forwarden en je slaat dit over, kunnen externe spelers niet op de server.
|
||||
|
||||
you_have_finished=Je hebt de set-up help volledig beëindigd.
|
||||
pocketmine_will_start=PocketMine-MP zal nu opstarten. Type /help om de lijst van beschikbare commando's te weergeven.
|
||||
pocketmine_plugins=Check de Plugin Opslag om nieuwe features, minigames of geavanceerde spawnbeveiliging toe te voegen aan je server
|
||||
20
src/lang/Installer/no_NO.ini
Normal file
20
src/lang/Installer/no_NO.ini
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
language_has_been_selected=Norsk har blitt valgt.
|
||||
skip_installer=Vil du hoppe over utpakking trollmannen?
|
||||
|
||||
welcome_to_pocketmine=Velkommen til PocketMine-MP!\nFør vi starter med å sette opp din nye server må du akseptere vår lisens.\nPocketMine-MP er lisensiert under LGPL lisensen,\nat du kan lese LISENS filen i denne mappen.
|
||||
accept_license=Aksepterer du lisensen?
|
||||
you_have_to_accept_the_license=Du må akseptere LGPL lisensen for å fortsette med å bruke PocketMine-MP
|
||||
|
||||
setting_up_server_now=Nå skal du sette opp din server.
|
||||
default_values_info=Hvis du ikke vil gjøre forskjell med den ordinære verdien, så trenger du bare å trykke Enter.
|
||||
server_properties=Du kan redigere dem senere i server.properties filen.
|
||||
|
||||
name_your_server=Gi et navn til din server
|
||||
port_warning=Ikke bytt på den vanlige port verdien vis dette er din første server.
|
||||
server_port=Server port
|
||||
invalid_port=Ugyldig server port
|
||||
ram_warning=RAMMEN er den maksimale beløpet PocketMine-MP vil bruke. A verdien av 128-256 MB er anbefalt
|
||||
server_ram=Server RAMMEN i MB
|
||||
|
||||
|
||||
|
||||
6
src/lang/Installer/pl_PL.ini
Normal file
6
src/lang/Installer/pl_PL.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
6
src/lang/Installer/pt_PT.ini
Normal file
6
src/lang/Installer/pt_PT.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
45
src/lang/Installer/ru_RU.ini
Normal file
45
src/lang/Installer/ru_RU.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=Английский был выбран правильно.
|
||||
skip_installer=Вы хотите пропустить мастер настройки?
|
||||
|
||||
welcome_to_pocketmine=Добро пожаловать в PocketMine-MP!\nПеред началом установки нового сервера, вы должны согласиться с лицензией. \nPocketMine-MP лицензировано на условиях LGPL лицензии, \nс которой вы можете ознакомиться, открыв файл LICENSE в этой папке.
|
||||
accept_license=Принимаете ли вы лицензию?
|
||||
you_have_to_accept_the_license=Вы должны принять LGPL лицензию, чтобы продолжить использование PocketMine-MP
|
||||
|
||||
setting_up_server_now=Теперь вы можете настроить сервер.
|
||||
default_values_info=Если вы не хотите изменять стандартное значение, просто нажмите Enter.
|
||||
server_properties=Вы можете редактировать их позже в файле server.properties.
|
||||
|
||||
name_your_server=Дайте имя вашему серверу
|
||||
port_warning=Не изменяйте значение порта по умолчанию, если это ваш первый сервер.
|
||||
server_port=Порт сервера
|
||||
invalid_port=Неверный порт сервера
|
||||
ram_warning=RAM - максимальный объем памяти, котооый будет использовать PocketMine-MP, рекомендуемое значение 128-256 МБ
|
||||
server_ram=Оперативная память сервера в МБ
|
||||
gamemode_info=Выберите между Креативом-(1), или Выживанием (0)
|
||||
default_gamemode=Режим игры по умолчанию
|
||||
max_players=Максимум онлайн игроков
|
||||
spawn_protection_info=Защита спавна запрещает размещение/разрушение блоков на спавне, за исключением операторов
|
||||
spawn_protection=Включить защиту спавна?
|
||||
|
||||
op_info=Оператор - Администратор сервера, который может использовать больше команд, чем обычный игрок
|
||||
op_who=Имя оператора (К примеру ваш ник в игре)
|
||||
op_warning=Вы можете добавить оператора позже используя команду /op <player>
|
||||
whitelist_info=White-list позволяет присоединиться только игрокам в этом списке.
|
||||
whitelist_enable=Вы хотите включить white-list?
|
||||
whitelist_warning=Вам придётся добавить игроков в white-list
|
||||
|
||||
query_warning1=Query это протокол, используемый разными инструментами, чтобы получить информацию о вашем сервере и о зашедших игроках.
|
||||
query_warning2=Если вы отключите его, вы не сможете использовать списки серверов.
|
||||
query_disable=Вы хотите отключить Query?
|
||||
rcon_info=RCON - это протокол для удаленного управления сервером через консоль, с использованием пароля.
|
||||
rcon_enable=Вы хотите включить RCON?
|
||||
rcon_password=RCON пароль (вы сможете изменить его позже)
|
||||
usage_info=Сбор анонимных данных о использовании поможет нам проанализировать глобальную статистику для PocketMine-MP и плагинов. Статистика доступна по адресу stats.pocketmine.net
|
||||
usage_disable=Вы хотите отключить сбор анонимных данных о использовании?
|
||||
ip_get=Получение вашего внешнего и внутреннего IP адреса
|
||||
ip_warning=Ваш внешний IP адрес: {{EXTERNAL_IP}}. Возможно вам необходимо открыть порты к вашему внутреннему IP адресу: {{INTERNAL_IP}}
|
||||
ip_confirm=Убедитесь в том, что вы открыли порты, в противном случае игроки вне вашей локальной сети не смогут подключится. [Нажмите Enter]
|
||||
|
||||
you_have_finished=Вы закончили работу с мастером установки
|
||||
pocketmine_will_start=PocketMine-MP сейчас запустится. Введите /help для просмотра доступных вам команд.
|
||||
pocketmine_plugins=Посетите репозиторий плагинов для получения новых функций, мини-игр, или повышения защиты вашего сервера
|
||||
45
src/lang/Installer/sv_SE.ini
Normal file
45
src/lang/Installer/sv_SE.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected=Svenska har bilvit valt.
|
||||
skip_installer=Vill du hoppa över Installations programmet?
|
||||
|
||||
welcome_to_pocketmine=Välkommen till PocketMine-MP! Före du börja ställa in din server måste du godkänna licensen. PocketMIne-MP är licenserat under LGPL Licensen som du kan läsa genom att öppna LICENSE filen i den här mappen.
|
||||
accept_license=Accepterar du Licensen?
|
||||
you_have_to_accept_the_license=Du måste godkänna LGPL licensen för att fortsätta använda PocketMine-MP
|
||||
|
||||
setting_up_server_now=Du håller på att börja ställa in din server nu.
|
||||
default_values_info=Om du inte vill ändra standard värdet, tryck bara ENTER.
|
||||
server_properties=Du kan redigera dem senare i server.properies filen.
|
||||
|
||||
name_your_server=Ge ett namn till din server
|
||||
port_warning=ändra INTE standard porten om detta är din första server.
|
||||
server_port=Server port
|
||||
invalid_port=Ogiltig Server port
|
||||
ram_warning=RAM är max mängden minne PocketMine-MP kommer använda. Ett väre av 128-256 MB är rekommenderat
|
||||
server_ram=Server RAM i MB
|
||||
gamemode_info=Välj mellan Kreativt läge (1) eller Överlevnad (0)
|
||||
default_gamemode=Standard spelläge
|
||||
max_players=Max spelare online
|
||||
spawn_protection_info=Spawn skydd stoppar spelare från att bygga / krossa block i Spawn-zonen förutom för OPs
|
||||
spawn_protection=Aktivera Spawn-skydd?
|
||||
|
||||
op_info=En OP är en spelar Administratör på servern. OPs kan köra fler kommandon än vanliga spelare
|
||||
op_who=OP spelar namn (Ditt IGN här)
|
||||
op_warning=Du kommer kunna lägga till fler OPs senare me /op <spelare>
|
||||
whitelist_info=whitelisten är en lista på spelare som får komma in på servern.
|
||||
whitelist_enable=Vill du aktivera whitelisten?
|
||||
whitelist_warning=Du måste i så fall lägga till spelare på whitelisten
|
||||
|
||||
query_warning1=Query är ett protokoll som används av olika verktyg för att samla in information om din server och spelare loggade in.
|
||||
query_warning2=Om du stänger av den så kommer du inte kunna använda serverlistor.
|
||||
query_disable=Vill du stänga av Query?
|
||||
rcon_info=RCON är ett protocol för att trådlöst ansluta till server konsolen med ett lösenord.
|
||||
rcon_enable=Vill du aktivera RCON?
|
||||
rcon_password=RCON lösenord (kan bytas senare)
|
||||
usage_info=Anonym data användning tillåter oss att räkna ut global statistik för PocketMine-MP och dess plugin. Du kan se dessa på stats.pocketmine.net
|
||||
usage_disable=Vill du stänga av anonym data använding?
|
||||
ip_get=Hämtar din externa IP och interna IP
|
||||
ip_warning=Din externa Ip är {{EXTERNAL_IP}}} Du kan behöva göra en "port-foward" till din Interna IP {{INTERNAL_IP}}
|
||||
ip_confirm=Var säker på att du kollar den. Om du måste göra en "port-foward" men skippar det så kommer inga externa spelare att kunna logga in på din server. [Tryck på ENTER]
|
||||
|
||||
you_have_finished=Du är nu klar. Allt har genomförts korrekt
|
||||
pocketmine_will_start=Din Server kommer nu att starta. skriv /help eller /? för en list på tillgängliga kommandon.
|
||||
pocketmine_plugins=Kolla in Plugin Hemsidan för att lägga till nya saker till din server, minispel, eller avancerat skydd
|
||||
6
src/lang/Installer/th_TH.ini
Normal file
6
src/lang/Installer/th_TH.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
6
src/lang/Installer/tlh_AA.ini
Normal file
6
src/lang/Installer/tlh_AA.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
12
src/lang/Installer/tr_TR.ini
Normal file
12
src/lang/Installer/tr_TR.ini
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
language_has_been_selected=İngilizce seçildi.
|
||||
skip_installer=Kurulum yazılımını atlamak istiyormusunuz?
|
||||
|
||||
accept_license=Lisansı kabul ediyormusunuz?
|
||||
you_have_to_accept_the_license=PocketMine-MP'yi kullanabilmeniz için LGPL lisansını kabul etmeniz gereklidir
|
||||
|
||||
setting_up_server_now=Sunucunuz şimdi kurulacak, Devam edilsin mi?
|
||||
|
||||
invalid_port=Yanlış sunucu port'u
|
||||
|
||||
|
||||
|
||||
6
src/lang/Installer/uk_UA.ini
Normal file
6
src/lang/Installer/uk_UA.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
31
src/lang/Installer/vi_VN.ini
Normal file
31
src/lang/Installer/vi_VN.ini
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
language_has_been_selected=Tiếng Anh đã được chọn.
|
||||
skip_installer=Bạn có muốn bỏ qua hướng dẫn set-up?
|
||||
|
||||
welcome_to_pocketmine=Chào mừng tới PocketMine-MP!\nTrước khi bắt đầu, bạn phải chấp nhận hợp đồng. \nPocketMine-MP được hợp đồng bởi LGPL License,\nbạn có thể đọc file LICENSE trong thư mục này.
|
||||
accept_license=Bạn có chấp nhận hợp đồng ?
|
||||
you_have_to_accept_the_license=Bạn phải chấp nhận LGPL license để sử dụng PocketMine-MP
|
||||
|
||||
setting_up_server_now=Bạn sẽ bắt đầu set up server của bạn ngay.
|
||||
default_values_info=Nếu bạn không muốn đổi giá trị mặc định, nhấn Enter.
|
||||
server_properties=Bạn có thể chỉnh sửa lại vào file server.properties .
|
||||
|
||||
name_your_server=Đặt tên server
|
||||
port_warning=Không được đổi giá trị port mặc định nếu đây là server đầu tiên của bạn.
|
||||
server_port=Server port
|
||||
invalid_port=Server port không đúng
|
||||
ram_warning=RAM là tất cả bộ nhớ mà PocketMine-MP sẽ sử dụng. 128/256 MB là cần thiết
|
||||
server_ram=Server RAM theo MB
|
||||
gamemode_info=Chọn Creative (1) hoặc Survival (0)
|
||||
default_gamemode=Chế độ mặc định
|
||||
max_players=Giới hạn lượng người chơi
|
||||
spawn_protection_info=Spawn protection không cho phép đặt/đập trong khu vực hồi sinh trừ OPs
|
||||
spawn_protection=Mở Spawn protection?
|
||||
|
||||
op_info=OP là chủ/quản lí server. OPs có nhiều quyền hạn hơn người thường
|
||||
op_who=Tên OP (ví dụ, tên bạn)
|
||||
op_warning=Bạn có thể thêm OP bằng lệnh /op <player>
|
||||
whitelist_info=White-list chỉ cho người có phép của quản lí tham gia.
|
||||
whitelist_enable=Bạn có muốn bật white-list?
|
||||
whitelist_warning=Bạn sẽ phải thêm người chơi vào white-list
|
||||
|
||||
|
||||
46
src/lang/Installer/zh_CN.ini
Normal file
46
src/lang/Installer/zh_CN.ini
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
language_has_been_selected=您现在选择了简体中文.
|
||||
skip_installer=您想跳过安装向导吗?
|
||||
|
||||
welcome_to_pocketmine=欢迎来到PocketMine-MP!\n在开始使用您的新服务器之前您需要接受以下协议\nPocketMine-MP使用了LGPL协议,\n你可以在这个文件夹中找到LICENCE文件.
|
||||
accept_license=您接受协议内容吗?
|
||||
you_have_to_accept_the_license=您接受了LGPL协议来继续使用PocketMine-MP
|
||||
|
||||
setting_up_server_now=你现在要开始设置您的服务器了
|
||||
default_values_info=如果您希望留住默认设置请直接按下回车键.
|
||||
server_properties=您以后可以在server.properties中修改设置.
|
||||
|
||||
name_your_server=命名您的服务器:
|
||||
port_warning=尽量不要改变端口如果这是您第一次设置服务器.
|
||||
server_port=服务器端口:
|
||||
invalid_port=不正确的服务器端口.
|
||||
ram_warning=RAM是PocketMine-MP可用的最大内存. 推荐范围: 128-256 MB
|
||||
server_ram=分配给服务器的内存(MB):
|
||||
gamemode_info=选择模式: (1)生存模式 或 (2)创造模式
|
||||
default_gamemode=默认游戏模式
|
||||
max_players=最大在线人数
|
||||
spawn_protection_info=出生点保护可以在出生点范围内保护所有方块不被摆放/破坏.
|
||||
spawn_protection=启用出生点保护?
|
||||
|
||||
op_info=OP是一个服务器的管理员, 可以执行比普通玩家更多的命令.
|
||||
op_who=OP的用户名是什么?
|
||||
op_warning=你可以执行\"/op <用户名>\"来添加OP.
|
||||
whitelist_info=白名单可以只允许在其列表内的玩家加入.
|
||||
whitelist_enable=您想启用白名单吗?
|
||||
whitelist_warning=你可以用"/whitelist add <用户名>"把别人加入白名单.
|
||||
|
||||
query_warning1=请求是一个用于不同的程序的协议用来获取您服务器数据和登录的玩家.
|
||||
query_warning2=如果您禁止了它, 您将不能使用服务器列表.
|
||||
query_disable=您希望禁用Query请求吗?
|
||||
rcon_info=RCON是一个用来远程连接到服务器控制台的协议(需要密码).
|
||||
rcon_enable=您希望启用RCON吗?
|
||||
rcon_password=RCON密码 (您也以后更改它) :
|
||||
usage_info=匿名数据让我们可以获得全球的PocketMine-MP和它的插件的统计信息. 您可以在 stats.pocketmine.net 查看统计信息.
|
||||
|
||||
usage_disable=您希望禁用匿名数据吗?
|
||||
ip_get=获得你的外部IP和内部IP
|
||||
ip_warning=您的外部IP是 {{EXTERNAL_IP}} . 您可能需要端口转发到您的内网IP {{INTERNAL_IP}} .
|
||||
ip_confirm=请确认您检查了它, 如果您直接进入下一步并跳过这一步, 没有外部的玩家可以加入. [按\"回车\"键]
|
||||
|
||||
you_have_finished=您已经成功完成了服务器设置向导.
|
||||
pocketmine_will_start=PocketMine-MP现在开始运行. 输入 \"/help\" 来看所有可用的命令.
|
||||
pocketmine_plugins=请查看插件源来添加新的功能, 迷你游戏或者对服务器的高级保护.
|
||||
45
src/lang/Installer/zu_ZA.ini
Normal file
45
src/lang/Installer/zu_ZA.ini
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
language_has_been_selected={crwdns106:0}{crwdne106:0}
|
||||
skip_installer={crwdns107:0}{crwdne107:0}
|
||||
|
||||
welcome_to_pocketmine={crwdns108:0}{crwdne108:0}
|
||||
accept_license={crwdns109:0}{crwdne109:0}
|
||||
you_have_to_accept_the_license={crwdns110:0}{crwdne110:0}
|
||||
|
||||
setting_up_server_now={crwdns111:0}{crwdne111:0}
|
||||
default_values_info={crwdns112:0}{crwdne112:0}
|
||||
server_properties={crwdns113:0}{crwdne113:0}
|
||||
|
||||
name_your_server={crwdns114:0}{crwdne114:0}
|
||||
port_warning={crwdns115:0}{crwdne115:0}
|
||||
server_port={crwdns116:0}{crwdne116:0}
|
||||
invalid_port={crwdns117:0}{crwdne117:0}
|
||||
ram_warning={crwdns118:0}{crwdne118:0}
|
||||
server_ram={crwdns119:0}{crwdne119:0}
|
||||
gamemode_info={crwdns120:0}{crwdne120:0}
|
||||
default_gamemode={crwdns121:0}{crwdne121:0}
|
||||
max_players={crwdns122:0}{crwdne122:0}
|
||||
spawn_protection_info={crwdns123:0}{crwdne123:0}
|
||||
spawn_protection={crwdns124:0}{crwdne124:0}
|
||||
|
||||
op_info={crwdns125:0}{crwdne125:0}
|
||||
op_who={crwdns126:0}{crwdne126:0}
|
||||
op_warning={crwdns127:0}{crwdne127:0}
|
||||
whitelist_info={crwdns128:0}{crwdne128:0}
|
||||
whitelist_enable={crwdns129:0}{crwdne129:0}
|
||||
whitelist_warning={crwdns130:0}{crwdne130:0}
|
||||
|
||||
query_warning1={crwdns131:0}{crwdne131:0}
|
||||
query_warning2={crwdns132:0}{crwdne132:0}
|
||||
query_disable={crwdns133:0}{crwdne133:0}
|
||||
rcon_info={crwdns134:0}{crwdne134:0}
|
||||
rcon_enable={crwdns135:0}{crwdne135:0}
|
||||
rcon_password={crwdns136:0}{crwdne136:0}
|
||||
usage_info={crwdns137:0}{crwdne137:0}
|
||||
usage_disable={crwdns138:0}{crwdne138:0}
|
||||
ip_get={crwdns139:0}{crwdne139:0}
|
||||
ip_warning={crwdns140:0}{{EXTERNAL_IP}}{crwdnd140:0}{{INTERNAL_IP}}{crwdne140:0}
|
||||
ip_confirm={crwdns141:0}{crwdne141:0}
|
||||
|
||||
you_have_finished={crwdns142:0}{crwdne142:0}
|
||||
pocketmine_will_start={crwdns143:0}{crwdne143:0}
|
||||
pocketmine_plugins={crwdns144:0}{crwdne144:0}
|
||||
|
|
@ -125,13 +125,13 @@ class DoorBlock extends TransparentBlock{
|
|||
$this->level->setBlock($down, BlockAPI::get($this->id, $meta), true, false, true);
|
||||
$players = ServerAPI::request()->api->player->getAll($this->level);
|
||||
unset($players[$player->CID]);
|
||||
ServerAPI::request()->api->player->broadcastPacket($players, MC_LEVEL_EVENT, array(
|
||||
"x" => $this->x,
|
||||
"y" => $this->y,
|
||||
"z" => $this->z,
|
||||
"evid" => 1003,
|
||||
"data" => 0
|
||||
));
|
||||
$pk = new LevelEventPacket;
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
$pk->evid = 1003;
|
||||
$pk->data = 0;
|
||||
ServerAPI::request()->api->player->broadcastPacket($players, $pk);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -140,13 +140,13 @@ class DoorBlock extends TransparentBlock{
|
|||
$this->level->setBlock($this, $this, true, false, true);
|
||||
$players = ServerAPI::request()->api->player->getAll($this->level);
|
||||
unset($players[$player->CID]);
|
||||
ServerAPI::request()->api->player->broadcastPacket($players, MC_LEVEL_EVENT, array(
|
||||
"x" => $this->x,
|
||||
"y" => $this->y,
|
||||
"z" => $this->z,
|
||||
"evid" => 1003,
|
||||
"data" => 0
|
||||
));
|
||||
$pk = new LevelEventPacket;
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
$pk->evid = 1003;
|
||||
$pk->data = 0;
|
||||
ServerAPI::request()->api->player->broadcastPacket($players, $pk);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class LavaBlock extends LiquidBlock{
|
|||
$b = $this->getSide($side);
|
||||
if($b instanceof LavaBlock){
|
||||
|
||||
}else if($b->isFlowable === true){
|
||||
}elseif($b->isFlowable === true){
|
||||
$this->level->setBlock($b, new LavaBlock( min($level + 2,7) ), false, false, true);
|
||||
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 40, BLOCK_UPDATE_NORMAL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ class BedBlock extends TransparentBlock{
|
|||
|
||||
public function onActivate(Item $item, Player $player){
|
||||
if(ServerAPI::request()->api->time->getPhase($player->level) !== "night"){
|
||||
$player->dataPacket(MC_CLIENT_MESSAGE, array(
|
||||
"message" => "You can only sleep at night"
|
||||
));
|
||||
$pk = new ChatPacket;
|
||||
$pk->message = "You can only sleep at night";
|
||||
$player->dataPacket($pk);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -51,17 +51,17 @@ class BedBlock extends TransparentBlock{
|
|||
}elseif($blockWest->getID() === $this->id and ($blockWest->meta & 0x08) === 0x08){
|
||||
$b = $blockWest;
|
||||
}else{
|
||||
$player->dataPacket(MC_CLIENT_MESSAGE, array(
|
||||
"message" => "The bed is incomplete"
|
||||
));
|
||||
$pk = new ChatPacket;
|
||||
$pk->message = "This bed is incomplete";
|
||||
$player->dataPacket($pk);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if($player->sleepOn($b) === false){
|
||||
$player->dataPacket(MC_CLIENT_MESSAGE, array(
|
||||
"message" => "This bed is occupied"
|
||||
));
|
||||
$pk = new ChatPacket;
|
||||
$pk->message = "This bed is occupied";
|
||||
$player->dataPacket($pk);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ class GrassBlock extends SolidBlock{
|
|||
|
||||
public function onActivate(Item $item, Player $player){
|
||||
if($item->getID() === DYE and $item->getMetadata() === 0x0F){
|
||||
TallGrassObject::growGrass($this->level, $this, new Random(), 8, 2);
|
||||
if(($player->gamemode & 0x01) === 0){
|
||||
$player->removeItem(DYE,0x0F,1);
|
||||
}
|
||||
TallGrassObject::growGrass($this->level, $this, new Random(), 8, 2);
|
||||
return true;
|
||||
}elseif($item->isHoe()){
|
||||
if(($player->gamemode & 0x01) === 0){
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ class Vector2{
|
|||
if(($x instanceof Vector2) === true){
|
||||
return $this->add($x->x, $x->y);
|
||||
}else{
|
||||
$this->x += $x;
|
||||
$this->y += $y;
|
||||
return new Vector2($this->x + $x, $this->y + $y);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,241 +20,80 @@
|
|||
*/
|
||||
|
||||
class MinecraftInterface{
|
||||
public $client;
|
||||
public $bandwidth;
|
||||
private $socket;
|
||||
private $data;
|
||||
private $chunked;
|
||||
private $toChunk;
|
||||
private $needCheck;
|
||||
function __construct($object, $server, $port = 25565, $listen = false, $client = false, $serverip = "0.0.0.0"){
|
||||
$this->socket = new UDPSocket($server, $port, (bool) $listen, $serverip);
|
||||
private $packets;
|
||||
function __construct($server, $port = 25565, $serverip = "0.0.0.0"){
|
||||
$this->socket = new UDPSocket($server, $port, true, $serverip);
|
||||
if($this->socket->connected === false){
|
||||
console("[ERROR] Couldn't bind to $serverip:".$port, true, true, 0);
|
||||
console("[SEVERE] Couldn't bind to $serverip:".$port, true, true, 0);
|
||||
exit(1);
|
||||
}
|
||||
$this->bandwidth = array(0, 0, microtime(true));
|
||||
$this->client = (bool) $client;
|
||||
$this->start = microtime(true);
|
||||
$this->chunked = array();
|
||||
$this->toChunk = array();
|
||||
$this->needCheck = array();
|
||||
$object->schedule(1, array($this, "checkChunked"), array(), true);
|
||||
$this->packets = array();
|
||||
}
|
||||
|
||||
public function close(){
|
||||
return $this->socket->close(false);
|
||||
}
|
||||
|
||||
protected function getStruct($pid){
|
||||
if(isset(Protocol::$raknet[$pid])){
|
||||
return Protocol::$raknet[$pid];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function readPacket(){
|
||||
$pk = $this->popPacket();
|
||||
if($this->socket->connected === false){
|
||||
return $pk;
|
||||
return false;
|
||||
}
|
||||
$buf = "";
|
||||
$source = false;
|
||||
$port = 1;
|
||||
$len = $this->socket->read($buf, $source, $port);
|
||||
if($len === false or $len === 0){
|
||||
return $pk;
|
||||
return false;
|
||||
}
|
||||
$this->bandwidth[0] += $len;
|
||||
$this->parsePacket($buf, $source, $port);
|
||||
return ($pk !== false ? $pk : $this->popPacket());
|
||||
return $this->parsePacket($buf, $source, $port);
|
||||
}
|
||||
|
||||
private function parsePacket($buf, $source, $port){
|
||||
$pid = ord($buf{0});
|
||||
$struct = $this->getStruct($pid);
|
||||
if($struct === false){
|
||||
if(ServerAPI::request()->api->dhandle("server.unknownpacket", array(
|
||||
"pid" => $pid,
|
||||
"data" => array(),
|
||||
"raw" => $buf,
|
||||
"ip" => $source,
|
||||
"port" => $port
|
||||
)) !== true){
|
||||
console("[ERROR] Unknown Packet ID 0x".Utils::strToHex(chr($pid)), true, true, 2);
|
||||
private function parsePacket($buffer, $source, $port){
|
||||
$pid = ord($buffer{0});
|
||||
|
||||
if(RakNetInfo::isValid($pid)){
|
||||
$parser = new RakNetParser($buffer);
|
||||
if($parser->packet !== false){
|
||||
$parser->packet->ip = $source;
|
||||
$parser->packet->port = $port;
|
||||
if(EventHandler::callEvent(new PacketReceiveEvent($parser->packet)) === BaseEvent::DENY){
|
||||
return false;
|
||||
}
|
||||
return $parser->packet;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$packet = new Packet($pid, $struct, $buf);
|
||||
@$packet->parse();
|
||||
if($pid === 0x99){
|
||||
$CID = PocketMinecraftServer::clientID($source, $port);
|
||||
if(!isset($this->chunked[$CID]) and $packet->data[0] !== 0){ //Drop packet
|
||||
}elseif($pid === 0xfe and $buffer{1} === "\xfd" and ServerAPI::request()->api->query instanceof QueryHandler){
|
||||
$packet = new QueryPacket;
|
||||
$packet->ip = $source;
|
||||
$packet->port = $port;
|
||||
$packet->buffer = $buffer;
|
||||
if(EventHandler::callEvent(new PacketReceiveEvent($packet)) === BaseEvent::DENY){
|
||||
return false;
|
||||
}
|
||||
switch($packet->data[0]){
|
||||
case 0:
|
||||
$this->initChunked($CID, $source, $port);
|
||||
return false;
|
||||
case 1:
|
||||
$this->stopChunked($CID);
|
||||
return false;
|
||||
case 3:
|
||||
$this->ackChunked($CID, $data[1]["id"], $data[1]["index"]);
|
||||
return false;
|
||||
case 4:
|
||||
$this->receiveChunked($CID, $data[1]["id"], $data[1]["index"], $data[1]["count"], $data[1]["data"]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
$this->data[] = array($pid, $packet->data, $buf, $source, $port);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkChunked($CID){
|
||||
$time = microtime(true);
|
||||
foreach($this->needCheck as $CID => $packets){
|
||||
if($packets[-1] < $time){
|
||||
$d = $this->chunked[$CID];
|
||||
unset($packets[-1]);
|
||||
foreach($packets as $packet){
|
||||
$this->writePacket(0x99, $packet, true, $d[1], $d[2], true);
|
||||
}
|
||||
$this->needCheck[$CID][-1] = $time + 5;
|
||||
}
|
||||
}
|
||||
foreach($this->toChunk as $CID => $packets){
|
||||
$d = $this->chunked[$CID];
|
||||
$raw = "";
|
||||
$MTU = 512;
|
||||
foreach($packets as $packet){
|
||||
$raw .= $packet;
|
||||
if(($len = strlen($packet)) > $MTU){
|
||||
$MTU = $len;
|
||||
}
|
||||
}
|
||||
if($MTU > $d[0][2]){
|
||||
$this->chunked[$CID][0][2] = $MTU;
|
||||
}else{
|
||||
$MTU = $d[0][2];
|
||||
}
|
||||
$raw = str_split(gzdeflate($raw, DEFLATEPACKET_LEVEL), $MTU - 9); // - 1 - 2 - 2 - 2 - 2
|
||||
$count = count($raw);
|
||||
$messageID = $this->chunked[$CID][0][0]++;
|
||||
$this->chunked[$CID][0][0] &= 0xFFFF;
|
||||
if(!isset($this->needCheck[$CID])){
|
||||
$this->needCheck[$CID] = array();
|
||||
}
|
||||
$this->needCheck[$CID][$messageID] = array(-1 => $time + 1);
|
||||
foreach($raw as $index => $r){
|
||||
$p = "\x99\x02".Utils::writeShort($messageID).Utils::writeShort($index).Utils::writeShort($count).Utils::writeShort(strlen($r)).$r;
|
||||
$this->needCheck[$CID][$messageID][$index] = $p;
|
||||
$this->writePacket(0x99, $p, true, $d[1], $d[2], true);
|
||||
}
|
||||
unset($this->toChunk[$CID]);
|
||||
}
|
||||
}
|
||||
|
||||
public function isChunked($CID){
|
||||
return isset($this->chunked[$CID]);
|
||||
}
|
||||
|
||||
private function initChunked($CID, $source, $port){
|
||||
console("[DEBUG] Starting DEFLATEPacket for $source:$port", true, true, 2);
|
||||
$this->chunked[$CID] = array(
|
||||
0 => array(0, 0, 0), //index, sent/received; MTU
|
||||
1 => $source,
|
||||
2 => $port,
|
||||
3 => array(), //Received packets
|
||||
);
|
||||
$this->writePacket(0x99, array(
|
||||
0 => 0, //start
|
||||
), false, $source, $port, true);
|
||||
}
|
||||
|
||||
public function stopChunked($CID){
|
||||
if(!isset($this->chunked[$CID])){
|
||||
ServerAPI::request()->api->query->handle($packet);
|
||||
}else{
|
||||
$packet = new Packet();
|
||||
$packet->ip = $source;
|
||||
$packet->port = $port;
|
||||
$packet->buffer = $buffer;
|
||||
EventHandler::callEvent(new PacketReceiveEvent($packet));
|
||||
return false;
|
||||
}
|
||||
$this->writePacket(0x99, array(
|
||||
0 => 1, //stop
|
||||
), false, $this->chunked[$CID][1], $this->chunked[$CID][2], true);
|
||||
console("[DEBUG] Stopping DEFLATEPacket for ".$this->chunked[$CID][1].":".$this->chunked[$CID][2], true, true, 2);
|
||||
$this->chunked[$CID][3] = null;
|
||||
$this->chunked[$CID][4] = null;
|
||||
unset($this->chunked[$CID]);
|
||||
unset($this->toChunk[$CID]);
|
||||
unset($this->needCheck[$CID]);
|
||||
}
|
||||
|
||||
private function ackChunked($CID, $ID, $index){
|
||||
unset($this->needCheck[$CID][$ID][$index]);
|
||||
if(count($this->needCheck[$CID][$ID]) <= 1){
|
||||
unset($this->needCheck[$CID][$ID]);
|
||||
}
|
||||
}
|
||||
|
||||
private function receiveChunked($CID, $ID, $index, $count, $data){
|
||||
if(!isset($this->chunked[$CID][3][$ID])){
|
||||
$this->chunked[$CID][3][$ID] = array();
|
||||
}
|
||||
$this->chunked[$CID][3][$ID][$index] = $data;
|
||||
|
||||
if(count($this->chunked[$CID][3][$ID]) === $count){
|
||||
ksort($this->chunked[$CID][3][$ID]);
|
||||
$data = gzinflate(implode($this->chunked[$CID][3][$ID]), 524280);
|
||||
unset($this->chunked[$CID][3][$ID]);
|
||||
if($data === false or strlen($data) === 0){
|
||||
console("[ERROR] Invalid DEFLATEPacket for ".$this->chunked[$CID][1].":".$this->chunked[$CID][2], true, true, 2);
|
||||
}
|
||||
$offset = 0;
|
||||
while(($plen = Utils::readShort(substr($data, $offset, 2), false)) !== 0xFFFF or $offset >= $len){
|
||||
$offset += 2;
|
||||
$packet = substr($data, $offset, $plen);
|
||||
$this->parsePacket($packet, $this->chunked[$CID][1], $this->chunked[$CID][2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function popPacket(){
|
||||
if(count($this->data) > 0){
|
||||
$p = each($this->data);
|
||||
unset($this->data[$p[0]]);
|
||||
$p = $p[1];
|
||||
return array("pid" => $p[0], "data" => $p[1], "raw" => $p[2], "ip" => $p[3], "port" => $p[4]);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function writePacket($pid, $data = array(), $raw = false, $dest = false, $port = false, $force = false){
|
||||
$CID = PocketMinecraftServer::clientID($dest, $port);
|
||||
if($raw === false){
|
||||
$packet = new Packet($pid, $this->getStruct($pid));
|
||||
$packet->data = $data;
|
||||
@$packet->create();
|
||||
if($force === false and $this->isChunked($CID)){
|
||||
if(!isset($this->toChunk[$CID])){
|
||||
$this->toChunk[$CID] = array();
|
||||
}
|
||||
$this->toChunk[$CID][] = $packet->raw;
|
||||
$write = strlen($packet->raw);
|
||||
}else{
|
||||
$write = $this->socket->write($packet->raw, $dest, $port);
|
||||
$this->bandwidth[1] += $write;
|
||||
}
|
||||
}else{
|
||||
if($force === false and $this->isChunked($CID)){
|
||||
if(!isset($this->toChunk[$CID])){
|
||||
$this->toChunk[$CID] = array();
|
||||
}
|
||||
$this->toChunk[$CID][] = $data;
|
||||
$write = strlen($data);
|
||||
}else{
|
||||
$write = $this->socket->write($data, $dest, $port);
|
||||
$this->bandwidth[1] += $write;
|
||||
}
|
||||
public function writePacket(Packet $packet){
|
||||
if(EventHandler::callEvent(new PacketSendEvent($packet)) === BaseEvent::DENY){
|
||||
return 0;
|
||||
}elseif($packet instanceof RakNetPacket){
|
||||
$codec = new RakNetCodec($packet);
|
||||
}
|
||||
$write = $this->socket->write($packet->buffer, $packet->ip, $packet->port);
|
||||
$this->bandwidth[1] += $write;
|
||||
return $write;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,325 +19,9 @@
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
class Packet{
|
||||
private $struct;
|
||||
protected $pid, $packet;
|
||||
public $data, $raw;
|
||||
|
||||
function __construct($pid, $struct, $data = ""){
|
||||
$this->pid = $pid;
|
||||
$this->offset = 1;
|
||||
$this->raw = $data;
|
||||
$this->data = array();
|
||||
if($data === ""){
|
||||
$this->addRaw(chr($pid));
|
||||
}
|
||||
$this->struct = $struct;
|
||||
}
|
||||
|
||||
public function create($raw = false){
|
||||
foreach($this->struct as $field => $type){
|
||||
if(!isset($this->data[$field])){
|
||||
$this->data[$field] = "";
|
||||
}
|
||||
if($raw === true){
|
||||
$this->addRaw($this->data[$field]);
|
||||
continue;
|
||||
}
|
||||
switch($type){
|
||||
case "special1":
|
||||
switch($this->pid){
|
||||
case 0x99:
|
||||
if($this->data[0] >= 2){
|
||||
$this->addRaw(Utils::writeShort($this->data[1]["id"]));
|
||||
$this->addRaw(Utils::writeShort($this->data[1]["index"]));
|
||||
if($this->data[0] === 2){
|
||||
$this->addRaw(Utils::writeShort($this->data[1]["count"]));
|
||||
$this->addRaw(Utils::writeShort(strlen($this->data[1]["data"])).$this->data[1]["data"]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0xc0:
|
||||
case 0xa0:
|
||||
$payload = "";
|
||||
$records = 0;
|
||||
$pointer = 0;
|
||||
sort($this->data[$field], SORT_NUMERIC);
|
||||
$max = count($this->data[$field]);
|
||||
while($pointer < $max){
|
||||
$type = true;
|
||||
$curr = $start = $this->data[$field][$pointer];
|
||||
for($i = $start + 1; $i < $max; ++$i){
|
||||
$n = $this->data[$field][$i];
|
||||
if(($n - $curr) === 1){
|
||||
$curr = $end = $n;
|
||||
$type = false;
|
||||
$pointer = $i + 1;
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
++$pointer;
|
||||
if($type === false){
|
||||
$payload .= Utils::writeBool(false);
|
||||
$payload .= strrev(Utils::writeTriad($start));
|
||||
$payload .= strrev(Utils::writeTriad($end));
|
||||
}else{
|
||||
$payload .= Utils::writeBool(true);
|
||||
$payload .= strrev(Utils::writeTriad($start));
|
||||
}
|
||||
++$records;
|
||||
}
|
||||
$this->addRaw(Utils::writeShort($records) . $payload);
|
||||
break;
|
||||
case 0x05:
|
||||
$this->addRaw($this->data[$field]);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case "customData":
|
||||
$this->addRaw(chr($this->data[1]));
|
||||
if($this->data[2]["id"] === false){
|
||||
$this->addRaw($this->data[2]["raw"]);
|
||||
}else{
|
||||
switch($this->data[1]){
|
||||
case 0x40:
|
||||
$reply = new CustomPacketHandler($this->data[2]["id"], "", $this->data[2], true);
|
||||
$this->addRaw(Utils::writeShort((strlen($reply->raw) + 1) << 3));
|
||||
$this->addRaw(strrev(Utils::writeTriad($this->data[2]["count"])));
|
||||
$this->addRaw(chr($this->data[2]["id"]));
|
||||
$this->addRaw($reply->raw);
|
||||
break;
|
||||
case 0x00:
|
||||
$raw = new CustomPacketHandler($this->data[2]["id"], "", $this->data[2], true);
|
||||
$raw = $raw->raw;
|
||||
$this->addRaw(Utils::writeShort((strlen($raw) + 1) << 3));
|
||||
$this->addRaw(chr($this->data[2]["id"]));
|
||||
$this->addRaw($raw);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case "magic":
|
||||
$this->addRaw(RAKNET_MAGIC);
|
||||
break;
|
||||
case "float":
|
||||
$this->addRaw(Utils::writeFloat($this->data[$field]));
|
||||
break;
|
||||
case "triad":
|
||||
$this->addRaw(Utils::writeTriad($this->data[$field]));
|
||||
break;
|
||||
case "itriad":
|
||||
$this->addRaw(strrev(Utils::writeTriad($this->data[$field])));
|
||||
break;
|
||||
case "int":
|
||||
$this->addRaw(Utils::writeInt($this->data[$field]));
|
||||
break;
|
||||
case "double":
|
||||
$this->addRaw(Utils::writeDouble($this->data[$field]));
|
||||
break;
|
||||
case "long":
|
||||
$this->addRaw(Utils::writeLong($this->data[$field]));
|
||||
break;
|
||||
case "bool":
|
||||
case "boolean":
|
||||
$this->addRaw(Utils::writeBool($this->data[$field]));
|
||||
break;
|
||||
case "ubyte":
|
||||
case "byte":
|
||||
$this->addRaw(Utils::writeByte($this->data[$field]));
|
||||
break;
|
||||
case "short":
|
||||
$this->addRaw(Utils::writeShort($this->data[$field]));
|
||||
break;
|
||||
case "string":
|
||||
$this->addRaw(Utils::writeShort(strlen($this->data[$field])));
|
||||
$this->addRaw($this->data[$field]);
|
||||
break;
|
||||
default:
|
||||
$this->addRaw(Utils::writeByte($this->data[$field]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function get($len = true){
|
||||
if($len === true){
|
||||
$data = substr($this->raw, $this->offset);
|
||||
$this->offset = strlen($this->raw);
|
||||
return $data;
|
||||
}
|
||||
$data = substr($this->raw, $this->offset, $len);
|
||||
$this->offset += $len;
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function feof(){
|
||||
return !isset($this->raw{$this->offset});
|
||||
}
|
||||
|
||||
protected function addRaw($str){
|
||||
$this->raw .= $str;
|
||||
return $str;
|
||||
}
|
||||
|
||||
public function parse(){
|
||||
foreach($this->struct as $field => $type){
|
||||
switch($type){
|
||||
case "special1":
|
||||
switch($this->pid){
|
||||
case 0x07:
|
||||
$this->data[] = $this->get(5);
|
||||
break;
|
||||
case 0x99:
|
||||
if($this->data[0] >= 2){ //
|
||||
$messageID = Utils::readShort($this->get(2), false);
|
||||
$messageIndex = Utils::readShort($this->get(2), false);
|
||||
$this->data[1] = array("id" => $messageID, "index" => $messageIndex);
|
||||
if($this->data[0] === 2){
|
||||
$this->data[1]["count"] = Utils::readShort($this->get(2), false);
|
||||
$dataLength = Utils::readShort($this->get(2), false);
|
||||
$this->data[1]["data"] = $this->get($dataLength);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0xc0:
|
||||
case 0xa0:
|
||||
$cnt = Utils::readShort($this->get(2), false);
|
||||
$this->data[$field] = array();
|
||||
for($i = 0; $i < $cnt and !$this->feof(); ++$i){
|
||||
if(Utils::readBool($this->get(1)) === false){
|
||||
$start = Utils::readTriad(strrev($this->get(3)));
|
||||
$end = min(Utils::readTriad(strrev($this->get(3))), $start + 4096);
|
||||
for($c = $start; $c <= $end; ++$c){
|
||||
$this->data[$field][] = $c;
|
||||
}
|
||||
}else{
|
||||
$this->data[$field][] = Utils::readTriad(strrev($this->get(3)));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0x05:
|
||||
$this->data[] = $this->get(true);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case "customData":
|
||||
$raw = $this->get(true);
|
||||
$len = strlen($raw);
|
||||
$offset = 0;
|
||||
$this->data["packets"] = array();
|
||||
while($len > $offset){
|
||||
$pid = ord($raw{$offset});
|
||||
++$offset;
|
||||
$reliability = ($pid & 0b11100000) >> 5;
|
||||
$hasSplit = ($pid & 0b00010000) >> 4;
|
||||
$length = Utils::readShort(substr($raw, $offset, 2), false);
|
||||
$offset += 2;
|
||||
if($reliability === 2
|
||||
or $reliability === 3
|
||||
or $reliability === 4
|
||||
or $reliability === 6
|
||||
or $reliability === 7){
|
||||
$messageIndex = Utils::readTriad(strrev(substr($raw, $offset, 3)));
|
||||
$offset += 3;
|
||||
}else{
|
||||
$messageIndex = 0;
|
||||
}
|
||||
|
||||
if($reliability === 1
|
||||
or $reliability === 3
|
||||
or $reliability === 4
|
||||
or $reliability === 7){
|
||||
$orderIndex = Utils::readTriad(strrev(substr($raw, $offset, 3)));
|
||||
$offset += 3;
|
||||
$orderChannel = ord($raw{$offset}); //5 bits, 32 values
|
||||
++$offset;
|
||||
}else{
|
||||
$orderIndex = 0;
|
||||
$orderChannel = 0;
|
||||
}
|
||||
|
||||
if($hasSplit === 1){
|
||||
$splitCount = Utils::readInt(substr($raw, $offset, 4));
|
||||
$offset += 4;
|
||||
$splitID = Utils::readShort(substr($raw, $offset, 2));
|
||||
$offset += 2;
|
||||
$splitIndex = Utils::readInt(substr($raw, $offset, 4));
|
||||
$offset += 4;
|
||||
//error! no split packets allowed!
|
||||
break;
|
||||
}else{
|
||||
$splitCount = 0;
|
||||
$splitID = 0;
|
||||
$splitIndex = 0;
|
||||
}
|
||||
|
||||
if($length == 0
|
||||
or $orderChannel >= 32
|
||||
or ($hasSplit === 1 and $splitIndex >= $splitCount)){
|
||||
continue;
|
||||
}
|
||||
$ln = ceil($length / 8);
|
||||
$id = ord($raw{$offset});
|
||||
++$offset;
|
||||
$pak = substr($raw, $offset, $ln - 1);
|
||||
$offset += $ln - 1;
|
||||
$pk = new CustomPacketHandler($id, $pak);
|
||||
$pk->data["length"] = $ln;
|
||||
$pk->data["id"] = $id;
|
||||
$pk->data["counter"] = $messageIndex;
|
||||
$pk->data["packetName"] = $pk->name;
|
||||
$this->data["packets"][] = array($pid, $pk->data, $pak);
|
||||
}
|
||||
break;
|
||||
case "magic":
|
||||
$this->data[] = $this->get(16);
|
||||
break;
|
||||
case "triad":
|
||||
$this->data[] = Utils::readTriad($this->get(3));
|
||||
break;
|
||||
case "itriad":
|
||||
$this->data[] = Utils::readTriad(strrev($this->get(3)));
|
||||
break;
|
||||
case "int":
|
||||
$this->data[] = Utils::readInt($this->get(4));
|
||||
break;
|
||||
case "string":
|
||||
$this->data[] = $this->get(Utils::readShort($this->get(2)));
|
||||
break;
|
||||
case "long":
|
||||
$this->data[] = Utils::readLong($this->get(8));
|
||||
break;
|
||||
case "byte":
|
||||
$this->data[] = Utils::readByte($this->get(1));
|
||||
break;
|
||||
case "ubyte":
|
||||
$this->data[] = ord($this->get(1));
|
||||
break;
|
||||
case "float":
|
||||
$this->data[] = Utils::readFloat($this->get(4));
|
||||
break;
|
||||
case "double":
|
||||
$this->data[] = Utils::readDouble($this->get(8));
|
||||
break;
|
||||
case "ushort":
|
||||
$this->data[] = Utils::readShort($this->get(2), false);
|
||||
break;
|
||||
case "short":
|
||||
$this->data[] = Utils::readShort($this->get(2));
|
||||
break;
|
||||
case "bool":
|
||||
case "boolean":
|
||||
$this->data[] = Utils::readBool($this->get(1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class Packet extends stdClass{
|
||||
public $ip;
|
||||
public $port;
|
||||
public $buffer;
|
||||
|
||||
}
|
||||
|
|
@ -55,6 +55,8 @@ class RCON{
|
|||
for($n = 0; $n < $this->threads; ++$n){
|
||||
$this->workers[$n]->close();
|
||||
$this->workers[$n]->join();
|
||||
usleep(50000);
|
||||
$this->workers[$n]->kill();
|
||||
}
|
||||
@socket_close($this->socket);
|
||||
$this->threads = 0;
|
||||
|
|
|
|||
|
|
@ -64,11 +64,11 @@ class UDPSocket{
|
|||
return @socket_recvfrom($this->sock, $buf, 65535, 0, $source, $port);
|
||||
}
|
||||
|
||||
public function write($data, $dest = false, $port = false){
|
||||
public function write($data, $dest, $port){
|
||||
if($this->connected === false){
|
||||
return false;
|
||||
}
|
||||
return @socket_sendto($this->sock, $data, strlen($data), 0, ($dest === false ? $this->server:$dest), ($port === false ? $this->port:$port));
|
||||
return @socket_sendto($this->sock, $data, strlen($data), 0, $dest, $port);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
160
src/network/protocol/ProtocolInfo.php
Normal file
160
src/network/protocol/ProtocolInfo.php
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class ProtocolInfo{
|
||||
|
||||
const CURRENT_PROTOCOL = 14;
|
||||
|
||||
|
||||
|
||||
const PING_PACKET = 0x00;
|
||||
|
||||
const PONG_PACKET = 0x03;
|
||||
|
||||
const CLIENT_CONNECT_PACKET = 0x09;
|
||||
const SERVER_HANDSHAKE_PACKET = 0x10;
|
||||
|
||||
const CLIENT_HANDSHAKE_PACKET = 0x13;
|
||||
//const SERVER_FULL_PACKET = 0x14;
|
||||
const DISCONNECT_PACKET = 0x15;
|
||||
|
||||
//const BANNED_PACKET = 0x17;
|
||||
|
||||
|
||||
const LOGIN_PACKET = 0x82;
|
||||
const LOGIN_STATUS_PACKET = 0x83;
|
||||
const READY_PACKET = 0x84;
|
||||
const MESSAGE_PACKET = 0x85;
|
||||
const SET_TIME_PACKET = 0x86;
|
||||
const START_GAME_PACKET = 0x87;
|
||||
const ADD_MOB_PACKET = 0x88;
|
||||
const ADD_PLAYER_PACKET = 0x89;
|
||||
const REMOVE_PLAYER_PACKET = 0x8a;
|
||||
|
||||
const ADD_ENTITY_PACKET = 0x8c;
|
||||
const REMOVE_ENTITY_PACKET = 0x8d;
|
||||
const ADD_ITEM_ENTITY_PACKET = 0x8e;
|
||||
const TAKE_ITEM_ENTITY_PACKET = 0x8f;
|
||||
const MOVE_ENTITY_PACKET = 0x90;
|
||||
|
||||
const MOVE_ENTITY_PACKET_POSROT = 0x93;
|
||||
const ROTATE_HEAD_PACKET = 0x94;
|
||||
const MOVE_PLAYER_PACKET = 0x95;
|
||||
//const PLACE_BLOCK_PACKET = 0x96;
|
||||
const REMOVE_BLOCK_PACKET = 0x97;
|
||||
const UPDATE_BLOCK_PACKET = 0x98;
|
||||
const ADD_PAINTING_PACKET = 0x99;
|
||||
const EXPLODE_PACKET = 0x9a;
|
||||
const LEVEL_EVENT_PACKET = 0x9b;
|
||||
const TILE_EVENT_PACKET = 0x9c;
|
||||
const ENTITY_EVENT_PACKET = 0x9d;
|
||||
const REQUEST_CHUNK_PACKET = 0x9e;
|
||||
const CHUNK_DATA_PACKET = 0x9f;
|
||||
const PLAYER_EQUIPMENT_PACKET = 0xa0;
|
||||
const PLAYER_ARMOR_EQUIPMENT_PACKET = 0xa1;
|
||||
const INTERACT_PACKET = 0xa2;
|
||||
const USE_ITEM_PACKET = 0xa3;
|
||||
const PLAYER_ACTION_PACKET = 0xa4;
|
||||
|
||||
const HURT_ARMOR_PACKET = 0xa6;
|
||||
const SET_ENTITY_DATA_PACKET = 0xa7;
|
||||
const SET_ENTITY_MOTION_PACKET = 0xa8;
|
||||
//const SET_ENTITY_LINK_PACKET = 0xa9;
|
||||
const SET_HEALTH_PACKET = 0xaa;
|
||||
const SET_SPAWN_POSITION_PACKET = 0xab;
|
||||
const ANIMATE_PACKET = 0xac;
|
||||
const RESPAWN_PACKET = 0xad;
|
||||
const SEND_INVENTORY_PACKET = 0xae;
|
||||
const DROP_ITEM_PACKET = 0xaf;
|
||||
const CONTAINER_OPEN_PACKET = 0xb0;
|
||||
const CONTAINER_CLOSE_PACKET = 0xb1;
|
||||
const CONTAINER_SET_SLOT_PACKET = 0xb2;
|
||||
const CONTAINER_SET_DATA_PACKET = 0xb3;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xb4;
|
||||
//const CONTAINER_ACK_PACKET = 0xb5;
|
||||
const CHAT_PACKET = 0xb6;
|
||||
const ADVENTURE_SETTINGS_PACKET = 0xb7;
|
||||
const ENTITY_DATA_PACKET = 0xb8;
|
||||
//const PLAYER_INPUT_PACKET = 0xb9;
|
||||
|
||||
public static $packets = array(
|
||||
-1 => "UnknownPacket",
|
||||
ProtocolInfo::PING_PACKET => "PingPacket",
|
||||
ProtocolInfo::PONG_PACKET => "PongPacket",
|
||||
ProtocolInfo::CLIENT_CONNECT_PACKET => "ClientConnectPacket",
|
||||
ProtocolInfo::SERVER_HANDSHAKE_PACKET => "ServerHandshakePacket",
|
||||
ProtocolInfo::DISCONNECT_PACKET => "DisconnectPacket",
|
||||
ProtocolInfo::LOGIN_PACKET => "LoginPacket",
|
||||
ProtocolInfo::LOGIN_STATUS_PACKET => "LoginStatusPacket",
|
||||
ProtocolInfo::READY_PACKET => "ReadyPacket",
|
||||
ProtocolInfo::MESSAGE_PACKET => "MessagePacket",
|
||||
ProtocolInfo::SET_TIME_PACKET => "SetTimePacket",
|
||||
ProtocolInfo::START_GAME_PACKET => "StartGamePacket",
|
||||
ProtocolInfo::ADD_MOB_PACKET => "AddMobPacket",
|
||||
ProtocolInfo::ADD_PLAYER_PACKET => "AddPlayerPacket",
|
||||
ProtocolInfo::REMOVE_PLAYER_PACKET => "RemovePlayerPacket",
|
||||
ProtocolInfo::ADD_ENTITY_PACKET => "AddEntityPacket",
|
||||
ProtocolInfo::REMOVE_ENTITY_PACKET => "RemoveEntityPacket",
|
||||
ProtocolInfo::ADD_ITEM_ENTITY_PACKET => "AddItemEntityPacket",
|
||||
ProtocolInfo::TAKE_ITEM_ENTITY_PACKET => "TakeItemEntityPacket",
|
||||
ProtocolInfo::MOVE_ENTITY_PACKET => "MoveEntityPacket",
|
||||
ProtocolInfo::MOVE_ENTITY_PACKET_POSROT => "MoveEntityPacket_PosRot",
|
||||
ProtocolInfo::ROTATE_HEAD_PACKET => "RotateHeadPacket",
|
||||
ProtocolInfo::MOVE_PLAYER_PACKET => "MovePlayerPacket",
|
||||
ProtocolInfo::REMOVE_BLOCK_PACKET => "RemoveBlockPacket",
|
||||
ProtocolInfo::UPDATE_BLOCK_PACKET => "UpdateBlockPacket",
|
||||
ProtocolInfo::ADD_PAINTING_PACKET => "AddPaintingPacket",
|
||||
ProtocolInfo::EXPLODE_PACKET => "ExplodePacket",
|
||||
ProtocolInfo::LEVEL_EVENT_PACKET => "LevelEventPacket",
|
||||
ProtocolInfo::TILE_EVENT_PACKET => "TileEventPacket",
|
||||
ProtocolInfo::ENTITY_EVENT_PACKET => "EntityEventPacket",
|
||||
ProtocolInfo::REQUEST_CHUNK_PACKET => "RequestChunkPacket",
|
||||
ProtocolInfo::CHUNK_DATA_PACKET => "ChunkDataPacket",
|
||||
ProtocolInfo::PLAYER_EQUIPMENT_PACKET => "PlayerEquipmentPacket",
|
||||
ProtocolInfo::PLAYER_ARMOR_EQUIPMENT_PACKET => "PlayerArmorEquipmentPacket",
|
||||
ProtocolInfo::INTERACT_PACKET => "InteractPacket",
|
||||
ProtocolInfo::USE_ITEM_PACKET => "UseItemPacket",
|
||||
ProtocolInfo::PLAYER_ACTION_PACKET => "PlayerActionPacket",
|
||||
ProtocolInfo::HURT_ARMOR_PACKET => "HurtArmorPacket",
|
||||
ProtocolInfo::SET_ENTITY_DATA_PACKET => "SetEntityDataPacket",
|
||||
ProtocolInfo::SET_ENTITY_MOTION_PACKET => "SetEntityMotionPacket",
|
||||
ProtocolInfo::SET_HEALTH_PACKET => "SetHealthPacket",
|
||||
ProtocolInfo::SET_SPAWN_POSITION_PACKET => "SetSpawnPositionPacket",
|
||||
ProtocolInfo::ANIMATE_PACKET => "AnimatePacket",
|
||||
ProtocolInfo::RESPAWN_PACKET => "RespawnPacket",
|
||||
ProtocolInfo::SEND_INVENTORY_PACKET => "SendInventoryPacket",
|
||||
ProtocolInfo::DROP_ITEM_PACKET => "DropItemPacket",
|
||||
ProtocolInfo::CONTAINER_OPEN_PACKET => "ContainerOpenPacket",
|
||||
ProtocolInfo::CONTAINER_CLOSE_PACKET => "ContainerClosePacket",
|
||||
ProtocolInfo::CONTAINER_SET_SLOT_PACKET => "ContainerSetSlotPacket",
|
||||
ProtocolInfo::CONTAINER_SET_DATA_PACKET => "ContainerSetDataPacket",
|
||||
ProtocolInfo::CONTAINER_SET_CONTENT_PACKET => "ContainerSetContentPacket",
|
||||
ProtocolInfo::CHAT_PACKET => "ChatPacket",
|
||||
ProtocolInfo::ADVENTURE_SETTINGS_PACKET => "AdventureSettingsPacket",
|
||||
ProtocolInfo::ENTITY_DATA_PACKET => "EntityDataPacket",
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/***REM_START***/
|
||||
require_once(FILE_PATH . "src/network/raknet/RakNetDataPacket.php");
|
||||
/***REM_END***/
|
||||
56
src/network/protocol/packet/AddEntityPacket.php
Normal file
56
src/network/protocol/packet/AddEntityPacket.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class AddEntityPacket extends RakNetDataPacket{
|
||||
public $eid;
|
||||
public $type;
|
||||
public $x;
|
||||
public $y;
|
||||
public $z;
|
||||
public $did;
|
||||
public $speedX;
|
||||
public $speedY;
|
||||
public $speedZ;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::ADD_ENTITY_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->eid);
|
||||
$this->putByte($this->type);
|
||||
$this->putFloat($this->x);
|
||||
$this->putFloat($this->y);
|
||||
$this->putFloat($this->z);
|
||||
$this->putInt($this->did);
|
||||
if($this->did > 0){
|
||||
$this->putShort($this->speedX);
|
||||
$this->putShort($this->speedY);
|
||||
$this->putShort($this->speedZ);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
52
src/network/protocol/packet/AddItemEntityPacket.php
Normal file
52
src/network/protocol/packet/AddItemEntityPacket.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class AddItemEntityPacket extends RakNetDataPacket{
|
||||
public $eid;
|
||||
public $item;
|
||||
public $x;
|
||||
public $y;
|
||||
public $z;
|
||||
public $yaw;
|
||||
public $pitch;
|
||||
public $roll;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::ADD_ITEM_ENTITY_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->eid);
|
||||
$this->putSlot($this->item);
|
||||
$this->putFloat($this->x);
|
||||
$this->putFloat($this->y);
|
||||
$this->putFloat($this->z);
|
||||
$this->putByte($this->yaw);
|
||||
$this->putByte($this->pitch);
|
||||
$this->putByte($this->roll);
|
||||
}
|
||||
|
||||
}
|
||||
52
src/network/protocol/packet/AddMobPacket.php
Normal file
52
src/network/protocol/packet/AddMobPacket.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class AddMobPacket extends RakNetDataPacket{
|
||||
public $eid;
|
||||
public $type;
|
||||
public $x;
|
||||
public $y;
|
||||
public $z;
|
||||
public $pitch;
|
||||
public $yaw;
|
||||
public $metadata;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::ADD_MOB_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->eid);
|
||||
$this->putInt($this->type);
|
||||
$this->putFloat($this->x);
|
||||
$this->putFloat($this->y);
|
||||
$this->putFloat($this->z);
|
||||
$this->putByte($this->yaw);
|
||||
$this->putByte($this->pitch);
|
||||
$this->put(Utils::writeMetadata($this->metadata));
|
||||
}
|
||||
|
||||
}
|
||||
48
src/network/protocol/packet/AddPaintingPacket.php
Normal file
48
src/network/protocol/packet/AddPaintingPacket.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class AddPaintingPacket extends RakNetDataPacket{
|
||||
public $eid;
|
||||
public $x;
|
||||
public $y;
|
||||
public $z;
|
||||
public $direction;
|
||||
public $title;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::ADD_PAINTING_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->eid);
|
||||
$this->putInt($this->x);
|
||||
$this->putInt($this->y);
|
||||
$this->putInt($this->z);
|
||||
$this->putInt($this->direction);
|
||||
$this->putString($this->title);
|
||||
}
|
||||
|
||||
}
|
||||
58
src/network/protocol/packet/AddPlayerPacket.php
Normal file
58
src/network/protocol/packet/AddPlayerPacket.php
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class AddPlayerPacket extends RakNetDataPacket{
|
||||
public $clientID;
|
||||
public $username;
|
||||
public $eid;
|
||||
public $x;
|
||||
public $y;
|
||||
public $z;
|
||||
public $pitch;
|
||||
public $yaw;
|
||||
public $unknown1;
|
||||
public $unknown2;
|
||||
public $metadata;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::ADD_PLAYER_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putLong($this->clientID);
|
||||
$this->putString($this->username);
|
||||
$this->putInt($this->eid);
|
||||
$this->putFloat($this->x);
|
||||
$this->putFloat($this->y);
|
||||
$this->putFloat($this->z);
|
||||
$this->putByte($this->yaw);
|
||||
$this->putByte($this->pitch);
|
||||
$this->putShort($this->unknown1);
|
||||
$this->putShort($this->unknown2);
|
||||
$this->put(Utils::writeMetadata($this->metadata));
|
||||
}
|
||||
|
||||
}
|
||||
38
src/network/protocol/packet/AdventureSettingsPacket.php
Normal file
38
src/network/protocol/packet/AdventureSettingsPacket.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class AdventureSettingsPacket extends RakNetDataPacket{
|
||||
public $flags;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::ADVENTURE_SETTINGS_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->flags);
|
||||
}
|
||||
|
||||
}
|
||||
41
src/network/protocol/packet/AnimatePacket.php
Normal file
41
src/network/protocol/packet/AnimatePacket.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class AnimatePacket extends RakNetDataPacket{
|
||||
public $action;
|
||||
public $eid;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::ANIMATE_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->action = $this->getByte();
|
||||
$this->eid = $this->getInt();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putByte($this->action);
|
||||
$this->putInt($this->eid);
|
||||
}
|
||||
|
||||
}
|
||||
38
src/network/protocol/packet/ChatPacket.php
Normal file
38
src/network/protocol/packet/ChatPacket.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class ChatPacket extends RakNetDataPacket{
|
||||
public $message;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::CHAT_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putString($this->message);
|
||||
}
|
||||
|
||||
}
|
||||
42
src/network/protocol/packet/ChunkDataPacket.php
Normal file
42
src/network/protocol/packet/ChunkDataPacket.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class ChunkDataPacket extends RakNetDataPacket{
|
||||
public $chunkX;
|
||||
public $chunkZ;
|
||||
public $data;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::CHUNK_DATA_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->chunkX);
|
||||
$this->putInt($this->chunkZ);
|
||||
$this->put($this->data);
|
||||
}
|
||||
|
||||
}
|
||||
41
src/network/protocol/packet/ClientConnectPacket.php
Normal file
41
src/network/protocol/packet/ClientConnectPacket.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class ClientConnectPacket extends RakNetDataPacket{
|
||||
public $clientID;
|
||||
public $session;
|
||||
public $unknown1;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::CLIENT_CONNECT_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->clientID = $this->getLong();
|
||||
$this->session = $this->getLong();
|
||||
$this->unknown1 = $this->get(1);
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
51
src/network/protocol/packet/ClientHandshakePacket.php
Normal file
51
src/network/protocol/packet/ClientHandshakePacket.php
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class ClientHandshakePacket extends RakNetDataPacket{
|
||||
public $cookie;
|
||||
public $security;
|
||||
public $port;
|
||||
public $dataArray0;
|
||||
public $dataArray;
|
||||
public $timestamp;
|
||||
public $session2;
|
||||
public $session;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::CLIENT_HANDSHAKE_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->cookie = $this->get(4);
|
||||
$this->security = $this->get(1);
|
||||
$this->port = $this->getShort(true);
|
||||
$this->dataArray0 = $this->get($this->getByte());
|
||||
$this->dataArray = $this->getDataArray(9);
|
||||
$this->timestamp = $this->get(2);
|
||||
$this->session2 = $this->getLong();
|
||||
$this->session = $this->getLong();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
38
src/network/protocol/packet/ContainerClosePacket.php
Normal file
38
src/network/protocol/packet/ContainerClosePacket.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class ContainerClosePacket extends RakNetDataPacket{
|
||||
public $windowid;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::CONTAINER_CLOSE_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->windowid = $this->getByte();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putByte($this->windowid);
|
||||
}
|
||||
|
||||
}
|
||||
48
src/network/protocol/packet/ContainerOpenPacket.php
Normal file
48
src/network/protocol/packet/ContainerOpenPacket.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class ContainerOpenPacket extends RakNetDataPacket{
|
||||
public $windowid;
|
||||
public $type;
|
||||
public $slots;
|
||||
public $x;
|
||||
public $y;
|
||||
public $z;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::CONTAINER_OPEN_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putByte($this->windowid);
|
||||
$this->putByte($this->type);
|
||||
$this->putByte($this->slots);
|
||||
$this->putInt($this->x);
|
||||
$this->putInt($this->y);
|
||||
$this->putInt($this->z);
|
||||
}
|
||||
|
||||
}
|
||||
60
src/network/protocol/packet/ContainerSetContentPacket.php
Normal file
60
src/network/protocol/packet/ContainerSetContentPacket.php
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class ContainerSetContentPacket extends RakNetDataPacket{
|
||||
public $windowid;
|
||||
public $slots = array();
|
||||
public $hotbar = array();
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::CONTAINER_SET_CONTENT_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->windowid = $this->getByte();
|
||||
$count = $this->getShort();
|
||||
for($s = 0; $s < $count and !$this->feof(); ++$s){
|
||||
$this->slots[$s] = $this->getSlot();
|
||||
}
|
||||
if($this->windowid === 0){
|
||||
$count = $this->getShort();
|
||||
for($s = 0; $s < $count and !$this->feof(); ++$s){
|
||||
$this->hotbar[$s] = $this->getInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putByte($this->windowid);
|
||||
$this->putShort(count($this->slots));
|
||||
foreach($this->slots as $slot){
|
||||
$this->putSlot($slot);
|
||||
}
|
||||
if($this->windowid === 0 and count($this->hotbar) > 0){
|
||||
$this->putShort(count($this->hotbar));
|
||||
foreach($this->hotbar as $slot){
|
||||
$this->putInt($slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
42
src/network/protocol/packet/ContainerSetDataPacket.php
Normal file
42
src/network/protocol/packet/ContainerSetDataPacket.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class ContainerSetDataPacket extends RakNetDataPacket{
|
||||
public $windowid;
|
||||
public $property;
|
||||
public $value;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::CONTAINER_SET_DATA_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putByte($this->windowid);
|
||||
$this->putShort($this->property);
|
||||
$this->putShort($this->value);
|
||||
}
|
||||
|
||||
}
|
||||
44
src/network/protocol/packet/ContainerSetSlotPacket.php
Normal file
44
src/network/protocol/packet/ContainerSetSlotPacket.php
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class ContainerSetSlotPacket extends RakNetDataPacket{
|
||||
public $windowid;
|
||||
public $slot;
|
||||
public $item;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::CONTAINER_SET_SLOT_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->windowid = $this->getByte();
|
||||
$this->slot = $this->getShort();
|
||||
$this->item = $this->getSlot();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putByte($this->windowid);
|
||||
$this->putShort($this->slot);
|
||||
$this->putSlot($this->item);
|
||||
}
|
||||
|
||||
}
|
||||
35
src/network/protocol/packet/DisconnectPacket.php
Normal file
35
src/network/protocol/packet/DisconnectPacket.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class DisconnectPacket extends RakNetDataPacket{
|
||||
public function pid(){
|
||||
return ProtocolInfo::DISCONNECT_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
}
|
||||
|
||||
}
|
||||
41
src/network/protocol/packet/DropItemPacket.php
Normal file
41
src/network/protocol/packet/DropItemPacket.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class DropItemPacket extends RakNetDataPacket{
|
||||
public $eid;
|
||||
public $unknown;
|
||||
public $item;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::DROP_ITEM_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->eid = $this->getInt();
|
||||
$this->unknown = $this->getByte();
|
||||
$this->item = $this->getSlot();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
47
src/network/protocol/packet/EntityDataPacket.php
Normal file
47
src/network/protocol/packet/EntityDataPacket.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class EntityDataPacket extends RakNetDataPacket{
|
||||
public $x;
|
||||
public $y;
|
||||
public $z;
|
||||
public $namedtag;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::ENTITY_DATA_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->x = $this->getShort();
|
||||
$this->y = $this->getByte();
|
||||
$this->z = $this->getShort();
|
||||
$this->namedtag = $this->get(true);
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putShort($this->x);
|
||||
$this->putByte($this->y);
|
||||
$this->putShort($this->z);
|
||||
$this->put($this->namedtag);
|
||||
}
|
||||
|
||||
}
|
||||
41
src/network/protocol/packet/EntityEventPacket.php
Normal file
41
src/network/protocol/packet/EntityEventPacket.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class EntityEventPacket extends RakNetDataPacket{
|
||||
public $eid;
|
||||
public $event;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::ENTITY_EVENT_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->eid = $this->getInt();
|
||||
$this->event = $this->getByte();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->eid);
|
||||
$this->putByte($this->event);
|
||||
}
|
||||
|
||||
}
|
||||
53
src/network/protocol/packet/ExplodePacket.php
Normal file
53
src/network/protocol/packet/ExplodePacket.php
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class ExplodePacket extends RakNetDataPacket{
|
||||
public $x;
|
||||
public $y;
|
||||
public $z;
|
||||
public $radius;
|
||||
public $records;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::EXPLODE_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putFloat($this->x);
|
||||
$this->putFloat($this->y);
|
||||
$this->putFloat($this->z);
|
||||
$this->putFloat($this->radius);
|
||||
$this->putInt(@count($this->records));
|
||||
if(@count($this->records) > 0){
|
||||
foreach($this->records as $record){
|
||||
$this->putByte($record->x);
|
||||
$this->putByte($record->y);
|
||||
$this->putByte($record->z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
38
src/network/protocol/packet/HurtArmorPacket.php
Normal file
38
src/network/protocol/packet/HurtArmorPacket.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class HurtArmorPacket extends RakNetDataPacket{
|
||||
public $health;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::HURT_ARMOR_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putByte($this->health);
|
||||
}
|
||||
|
||||
}
|
||||
44
src/network/protocol/packet/InteractPacket.php
Normal file
44
src/network/protocol/packet/InteractPacket.php
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class InteractPacket extends RakNetDataPacket{
|
||||
public $action;
|
||||
public $eid;
|
||||
public $target;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::INTERACT_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->action = $this->getByte();
|
||||
$this->eid = $this->getInt();
|
||||
$this->target = $this->getInt();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putByte($this->action);
|
||||
$this->putInt($this->eid);
|
||||
$this->putInt($this->target);
|
||||
}
|
||||
|
||||
}
|
||||
46
src/network/protocol/packet/LevelEventPacket.php
Normal file
46
src/network/protocol/packet/LevelEventPacket.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class LevelEventPacket extends RakNetDataPacket{
|
||||
public $evid;
|
||||
public $x;
|
||||
public $y;
|
||||
public $z;
|
||||
public $data;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::LEVEL_EVENT_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putShort($this->evid);
|
||||
$this->putShort($this->x);
|
||||
$this->putShort($this->y);
|
||||
$this->putShort($this->z);
|
||||
$this->putInt($this->data);
|
||||
}
|
||||
|
||||
}
|
||||
45
src/network/protocol/packet/LoginPacket.php
Normal file
45
src/network/protocol/packet/LoginPacket.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class LoginPacket extends RakNetDataPacket{
|
||||
public $username;
|
||||
public $protocol1;
|
||||
public $protocol2;
|
||||
public $clientId;
|
||||
public $loginData;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::LOGIN_PACKET;
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->username = $this->getString();
|
||||
$this->protocol1 = $this->getInt();
|
||||
$this->protocol2 = $this->getInt();
|
||||
$this->clientId = $this->getInt();
|
||||
$this->loginData = $this->getString();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue