运行我的PHP脚本时发生意外的elseif

运行我的PHP脚本时发生意外的elseif

我真的不知道该怎么办。非常感谢您的帮助!谢谢您。

function handleVerChk($arrData, Client $objClient){
    $objClient->sendData('<msg t="sys"><body action="apiOK" r="0"></body></msg>');
}

function handleLogin($arrData, Client $objClient){
    $strUser = $arrData['body']['login']['nick'];
    $strPass = $arrData['body']['login']['pword'];
    Silk\Logger::Log('Client is attempting to login with username \'' . $strUser . '\'');
    $blnExist = $this->objDatabase->playerExists($strUser);
    if($blnExist === false){
        $objClient->sendError(100);
        return $this->removeClient($objClient->resSocket);{
        elseif($arrUser["Banned"] == 1)
$objClient->sendError(603);
return $this->removeClient($objClient->resSocket);
        }
    }

最佳答案

把你的函数改成这个你有一些错误

function handleLogin($arrData, Client $objClient){
    $strUser = $arrData['body']['login']['nick'];
    $strPass = $arrData['body']['login']['pword'];
    Silk\Logger::Log('Client is attempting to login with username \'' . $strUser . '\'');
    $blnExist = $this->objDatabase->playerExists($strUser);
    if($blnExist === false){
        $objClient->sendError(100);
        return $this->removeClient($objClient->resSocket);
    } elseif($arrUser["Banned"] == 1){
       $objClient->sendError(603);
       return $this->removeClient($objClient->resSocket);
    }
}

关于php - 运行我的PHP脚本时发生意外的elseif,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51608331/

10-11 12:18