Fix: client login.php

This commit is contained in:
2018-08-23 12:32:55 +09:00
parent 6fcb459550
commit 74525d79fb
2 changed files with 16 additions and 14 deletions
+14 -12
View File
@@ -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;