Fix: Experience player maestro ID Account Type = 100

This commit is contained in:
2018-08-11 07:41:19 +09:00
parent ae42c35807
commit a3bbeed499
3 changed files with 49 additions and 17 deletions
@@ -5,39 +5,71 @@ include "./../lib/send_reply_json.php";
include "./../setup/connect_db.php";
$maestro_experience_id = get_maestro_experience_id("test");
if($maestro_experience_id === null) {
set_error_message("등록된 마에스트로 관리자 계정이 없습니다. (".$maestro_experience_id.")");
$maestroAccountType = 100;
$experienceMaestroInfo = get_experience_maestro_info();
if($experienceMaestroInfo === null) {
set_error_message("등록된 마에스트로 관리자 계정이 없습니다.");
send_result_fail();
exit;
}
set_data("maestroID", $maestro_experience_id);
set_data("playerID", -1);
set_data("playerName", "TestPlayer");
$maestroTestPlayerInfo = get_maestro_test_player_info($experienceMaestroInfo["MaestroID"]);
set_data("maestroID", $experienceMaestroInfo["MaestroID"]);
set_data("maestroAccountType", $maestroAccountType);
set_data("playerID", $maestroTestPlayerInfo["PlayerID"]);
set_data("playerName", $maestroTestPlayerInfo["Name"]);
set_data("playerAccountType", $maestroTestPlayerInfo["AccountType"]);
send_result_success();
exit;
function get_maestro_experience_id($maestro_name) {
function get_experience_maestro_info() {
global $db_conn;
$query = "
SELECT MaestroID
SELECT MaestroID, MaestroTestID
FROM moty_maestro
WHERE Name = ?
WHERE AccountType = 100
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("s", $maestro_name);
// $stmt->bind_param("s", $maestro_name);
$stmt->execute();
$stmt->bind_result($maestro_experience_id);
$stmt->bind_result($maestroID, $maestroTestID);
// while($stmt->fetch()) {
// ;
// }
$stmt->fetch();
$stmt->close();
return $maestro_experience_id;
$result["MaestroID"] = $maestroID;
$result["MaestroTestID"] = $maestroTestID;
return $result;
}
function get_maestro_test_player_info($maestro_id) {
global $db_conn;
$query = "
SELECT PlayerID, Name, AccountType
FROM moty_player
WHERE MaestroID = ?
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("i", $maestro_id);
$stmt->execute();
$stmt->bind_result($playerID, $name, $accountType);
// while($stmt->fetch()) {
// ;
// }
$stmt->fetch();
$stmt->close();
$result["PlayerID"] = $playerID;
$result["Name"] = $name;
$result["AccountType"] = $accountType;
return $result;
}
?>