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

时间:2018-07-31 08:01:54

标签: php linux server

我真的不知道该怎么办。帮助将不胜感激!谢谢。

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);
        }
    }

1 个答案:

答案 0 :(得分:0)

将功能更改为此会出现一些错误

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);
    }
}