Merge branch 'release/3.0' into release/3.1

This commit is contained in:
Dylan K. Taylor 2018-07-06 13:12:13 +01:00
commit 5a3135659b
2 changed files with 7 additions and 0 deletions

View File

@ -105,9 +105,15 @@ class LoginPacket extends DataPacket{
$buffer = new BinaryStream($this->getString());
$this->chainData = json_decode($buffer->get($buffer->getLInt()), true);
$hasExtraData = false;
foreach($this->chainData["chain"] as $chain){
$webtoken = Utils::decodeJWT($chain);
if(isset($webtoken["extraData"])){
if($hasExtraData){
throw new \RuntimeException("Found 'extraData' multiple times in key chain");
}
$hasExtraData = true;
if(isset($webtoken["extraData"]["displayName"])){
$this->username = $webtoken["extraData"]["displayName"];
}

View File

@ -256,6 +256,7 @@ abstract class PluginBase implements Plugin{
}
public function reloadConfig(){
@mkdir($this->dataFolder);
$this->config = new Config($this->configFile);
if(($configStream = $this->getResource("config.yml")) !== null){
$this->config->setDefaults(yaml_parse(Config::fixYAMLIndexes(stream_get_contents($configStream))));