Merge branch 'master' into mcpe-1.2.5

This commit is contained in:
Dylan K. Taylor
2017-11-06 14:35:10 +00:00
21 changed files with 134 additions and 43 deletions

View File

@ -237,6 +237,12 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
return null;
}
public function updatePing(string $identifier, int $pingMS){
if(isset($this->players[$identifier])){
$this->players[$identifier]->updatePing($pingMS);
}
}
private function getPacket($buffer){
$pid = ord($buffer{0});
if(($data = PacketPool::getPacketById($pid)) === null){

View File

@ -33,6 +33,7 @@ class EntityEventPacket extends DataPacket{
const HURT_ANIMATION = 2;
const DEATH_ANIMATION = 3;
const ARM_SWING = 4;
const TAME_FAIL = 6;
const TAME_SUCCESS = 7;
@ -44,12 +45,41 @@ class EntityEventPacket extends DataPacket{
const FISH_HOOK_HOOK = 13;
const FISH_HOOK_TEASE = 14;
const SQUID_INK_CLOUD = 15;
const AMBIENT_SOUND = 16;
const ZOMBIE_VILLAGER_CURE = 16;
const RESPAWN = 18;
const IRON_GOLEM_OFFER_FLOWER = 19;
const IRON_GOLEM_WITHDRAW_FLOWER = 20;
const LOVE_PARTICLES = 21; //breeding
const WITCH_SPELL_PARTICLES = 24;
const FIREWORK_PARTICLES = 25;
const SILVERFISH_SPAWN_ANIMATION = 27;
const WITCH_DRINK_POTION = 29;
const WITCH_THROW_POTION = 30;
const MINECART_TNT_PRIME_FUSE = 31;
const PLAYER_ADD_XP_LEVELS = 34;
const ELDER_GUARDIAN_CURSE = 35;
const AGENT_ARM_SWING = 36;
const ENDER_DRAGON_DEATH = 37;
const DUST_PARTICLES = 38; //not sure what this is
const EATING_ITEM = 57;
const BABY_ANIMAL_FEED = 60; //green particles, like bonemeal on crops
const DEATH_SMOKE_CLOUD = 61;
const COMPLETE_TRADE = 62;
const REMOVE_LEASH = 63; //data 1 = cut leash
const CONSUME_TOTEM = 65;
const PLAYER_CHECK_TREASURE_HUNTER_ACHIEVEMENT = 66; //mojang...
const ENTITY_SPAWN = 67; //used for MinecraftEventing stuff, not needed
const DRAGON_PUKE = 68; //they call this puke particles
const ITEM_ENTITY_MERGE = 69;
//TODO: add more events
/** @var int */

View File

@ -50,6 +50,8 @@ class LoginPacket extends DataPacket{
public $identityPublicKey;
/** @var string */
public $serverAddress;
/** @var string */
public $locale;
/** @var array (the "chain" index contains one or more JWTs) */
public $chainData = [];
@ -119,6 +121,8 @@ class LoginPacket extends DataPacket{
$this->clientId = $this->clientData["ClientRandomId"] ?? null;
$this->serverAddress = $this->clientData["ServerAddress"] ?? null;
$this->locale = $this->clientData["LanguageCode"] ?? null;
}
protected function encodePayload(){