mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 15:19:56 +00:00
Merge branch 'release/3.1'
This commit is contained in:
commit
b23c947060
@ -105,9 +105,15 @@ class LoginPacket extends DataPacket{
|
|||||||
$buffer = new BinaryStream($this->getString());
|
$buffer = new BinaryStream($this->getString());
|
||||||
|
|
||||||
$this->chainData = json_decode($buffer->get($buffer->getLInt()), true);
|
$this->chainData = json_decode($buffer->get($buffer->getLInt()), true);
|
||||||
|
|
||||||
|
$hasExtraData = false;
|
||||||
foreach($this->chainData["chain"] as $chain){
|
foreach($this->chainData["chain"] as $chain){
|
||||||
$webtoken = Utils::decodeJWT($chain);
|
$webtoken = Utils::decodeJWT($chain);
|
||||||
if(isset($webtoken["extraData"])){
|
if(isset($webtoken["extraData"])){
|
||||||
|
if($hasExtraData){
|
||||||
|
throw new \RuntimeException("Found 'extraData' multiple times in key chain");
|
||||||
|
}
|
||||||
|
$hasExtraData = true;
|
||||||
if(isset($webtoken["extraData"]["displayName"])){
|
if(isset($webtoken["extraData"]["displayName"])){
|
||||||
$this->username = $webtoken["extraData"]["displayName"];
|
$this->username = $webtoken["extraData"]["displayName"];
|
||||||
}
|
}
|
||||||
|
@ -267,6 +267,7 @@ abstract class PluginBase implements Plugin{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function reloadConfig(){
|
public function reloadConfig(){
|
||||||
|
@mkdir($this->dataFolder);
|
||||||
$this->config = new Config($this->configFile);
|
$this->config = new Config($this->configFile);
|
||||||
if(($configStream = $this->getResource("config.yml")) !== null){
|
if(($configStream = $this->getResource("config.yml")) !== null){
|
||||||
$this->config->setDefaults(yaml_parse(Config::fixYAMLIndexes(stream_get_contents($configStream))));
|
$this->config->setDefaults(yaml_parse(Config::fixYAMLIndexes(stream_get_contents($configStream))));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user