mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-07 02:21:46 +00:00
Merge branch '3.5'
This commit is contained in:
commit
ae7d6cc4a2
@ -150,7 +150,7 @@ class ExperienceOrb extends Entity{
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$entity = $this->server->getLevelManager()->findEntity($this->targetPlayerRuntimeId);
|
$entity = $this->level->getEntity($this->targetPlayerRuntimeId);
|
||||||
if($entity instanceof Human){
|
if($entity instanceof Human){
|
||||||
return $entity;
|
return $entity;
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ class ExperienceOrb extends Entity{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function setTargetPlayer(?Human $player) : void{
|
public function setTargetPlayer(?Human $player) : void{
|
||||||
$this->targetPlayerRuntimeId = $player ? $player->getId() : null;
|
$this->targetPlayerRuntimeId = $player !== null ? $player->getId() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function entityBaseTick(int $tickDiff = 1) : bool{
|
public function entityBaseTick(int $tickDiff = 1) : bool{
|
||||||
|
@ -62,6 +62,8 @@ class ProcessLoginTask extends AsyncTask{
|
|||||||
|
|
||||||
public const MOJANG_ROOT_PUBLIC_KEY = "MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE8ELkixyLcwlZryUQcu1TvPOmI2B7vX83ndnWRUaXm74wFfa5f/lwQNTfrLVHa2PmenpGI6JhIMUJaWZrjmMj90NoKNFSNBuKdm8rYiXsfaz3K36x/1U26HpG0ZxK/V1V";
|
public const MOJANG_ROOT_PUBLIC_KEY = "MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE8ELkixyLcwlZryUQcu1TvPOmI2B7vX83ndnWRUaXm74wFfa5f/lwQNTfrLVHa2PmenpGI6JhIMUJaWZrjmMj90NoKNFSNBuKdm8rYiXsfaz3K36x/1U26HpG0ZxK/V1V";
|
||||||
|
|
||||||
|
private const CLOCK_DRIFT_MAX = 60;
|
||||||
|
|
||||||
/** @var PrivateKeyInterface|null */
|
/** @var PrivateKeyInterface|null */
|
||||||
private static $SERVER_PRIVATE_KEY = null;
|
private static $SERVER_PRIVATE_KEY = null;
|
||||||
|
|
||||||
@ -197,11 +199,11 @@ class ProcessLoginTask extends AsyncTask{
|
|||||||
$claims = json_decode(self::b64UrlDecode($payloadB64), true);
|
$claims = json_decode(self::b64UrlDecode($payloadB64), true);
|
||||||
|
|
||||||
$time = time();
|
$time = time();
|
||||||
if(isset($claims["nbf"]) and $claims["nbf"] > $time){
|
if(isset($claims["nbf"]) and $claims["nbf"] > $time + self::CLOCK_DRIFT_MAX){
|
||||||
throw new VerifyLoginException("%pocketmine.disconnect.invalidSession.tooEarly");
|
throw new VerifyLoginException("%pocketmine.disconnect.invalidSession.tooEarly");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($claims["exp"]) and $claims["exp"] < $time){
|
if(isset($claims["exp"]) and $claims["exp"] < $time - self::CLOCK_DRIFT_MAX){
|
||||||
throw new VerifyLoginException("%pocketmine.disconnect.invalidSession.tooLate");
|
throw new VerifyLoginException("%pocketmine.disconnect.invalidSession.tooLate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user