yucky fix for crash on invalid keychain

This commit is contained in:
Dylan K. Taylor 2019-07-19 14:01:21 +01:00
parent a4c7744188
commit 5a5ce84ebc

View File

@ -527,14 +527,18 @@ class NetworkSession{
}, $reason); }, $reason);
} }
public function setAuthenticationStatus(bool $authenticated, bool $authRequired, ?string $error, PublicKeyInterface $clientPubKey) : void{ public function setAuthenticationStatus(bool $authenticated, bool $authRequired, ?string $error, ?PublicKeyInterface $clientPubKey) : void{
if(!$this->connected){ if(!$this->connected){
return; return;
} }
if($error === null){
if($authenticated and $this->info->getXuid() === ""){ if($authenticated and $this->info->getXuid() === ""){
$error = "Expected XUID but none found"; $error = "Expected XUID but none found";
}elseif(!$authenticated and $this->info->getXuid() !== ""){ }elseif(!$authenticated and $this->info->getXuid() !== ""){
$error = "Unexpected XUID for non-XBOX-authenticated player"; $error = "Unexpected XUID for non-XBOX-authenticated player";
}elseif($clientPubKey === null){
$error = "Missing client public key"; //failsafe
}
} }
if($error !== null){ if($error !== null){