diff --git a/src/game/login/login.js b/src/game/login/login.js index 791c649..d47601c 100644 --- a/src/game/login/login.js +++ b/src/game/login/login.js @@ -119,8 +119,8 @@ class Login { // show retry message console.log('login failed, jsonData : ' + JSON.stringify(jsonData)); - if(jsonData["ERROR"] !== null) { - self.infoText.text = jsonData["ERROR"]; + if(jsonData["error"] !== null) { + self.infoText.text = jsonData["error"]; } } diff --git a/src/web/server/player/login.php b/src/web/server/player/login.php index 8b63a7a..0410f64 100644 --- a/src/web/server/player/login.php +++ b/src/web/server/player/login.php @@ -10,9 +10,9 @@ $enterCode = $_POST["enter_code"]; $maestroInfo = get_maestro_id($maestroName); -if($maestroInfo === null) { - send_error_message($replyJSON, "입력한 마에스트로 계정이 없습니다"); - $db_conn->close(); +if($maestroInfo === NULL) { + set_error_message("입력한 마에스트로 계정이 없습니다"); + send_result_fail(); exit; } @@ -20,9 +20,9 @@ $maestroID = $maestroInfo["maestroID"]; $maestroAccountType = $maestroInfo["accountType"]; $playerInfo = get_login_data($maestroID, $name, $enterCode); -if($playerInfo === null) { - send_error_message($replyJSON, "입력한 이름/입장번호와 일치하는 계정이 없습니다"); - $db_conn->close(); +if($playerInfo === NULL) { + set_error_message("입력한 이름/입장번호와 일치하는 계정이 없습니다"); + send_result_fail(); exit; } @@ -51,12 +51,12 @@ function get_maestro_id($maestroName) { $stmt->bind_param('s', $maestroName); $stmt->execute(); $stmt->bind_result($maestroID, $accountType); - // while($stmt->fetch()) { - // ; - // } - $stmt->fetch(); + $returnValue = $stmt->fetch(); $stmt->close(); + if($returnValue === NULL || $returnValue === FALSE) + return NULL; + $result["maestroID"] = $maestroID; $result["accountType"] = $accountType; return $result; @@ -74,10 +74,12 @@ function get_login_data($maestroID, $name, $enterCode) { $stmt->bind_param('iss', $maestroID, $name, $enterCode); $stmt->execute(); $stmt->bind_result($playerID, $accountType); - // while($stmt->fetch()) - $stmt->fetch(); + $returnValue = $stmt->fetch(); $stmt->close(); + if($returnValue === NULL || $returnValue === FALSE) + return NULL; + $result["playerID"] = $playerID; $result["accountType"] = $accountType; return $result;