Add: maestro test account, player for experience mode

This commit is contained in:
2018-07-08 22:46:39 +09:00
parent 785575a1e1
commit b34e62c4ea
6 changed files with 337 additions and 8 deletions
+62 -3
View File
@@ -23,8 +23,67 @@
<script type="text/javascript">
function runMaestroAccountApp() {
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/maestro/maestro_test_player.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("maestro_id=" + maestroID);
xhr.onload = function() {
if(xhr.readyState === 4 && xhr.status === 200) {
// console.log(xhr.responseText);
// console.log(xhr.responseText.length);
if(xhr.responseText.length === 0 || xhr.responseText === null) {
console.log("no data from server");
return;
}
let replyJSON = JSON.parse(xhr.responseText);
// console.log(replyJSON);
if(replyJSON === null) {
console.log("no data from server");
return;
}
if(replyJSON["ERROR"] !== undefined || replyJSON["RESULT"] === undefined) {
console.log(replyJSON["ERROR"]);
return;
}
if(replyJSON["RESULT"] === "fail") {
console.log(replyJSON["RESULT"]);
return;
}
let playerID = replyJSON["PlayerID"];
let playerName = replyJSON["PlayerName"];
console.log("playerID : " + playerID);
console.log("playerName : " + playerName);
sessionStorage.setItem("playerID", playerID);
sessionStorage.setItem("playerName", playerName);
}
}
}
function deleteMaestroAllRecords() {
alert("마에스트로 전용 계정의 모든 플레이 기록이 지워집니다.\n예) 게임 기록, 타자 타수, 순위 등");
// alert("마에스트로 전용 계정의 모든 플레이 기록이 지워집니다.\n예) 게임 기록, 타자 타수, 순위 등");
if(confirm("마에스트로 전용 계정의 모든 플레이 기록이 지워집니다.\n예) 게임 기록, 타자 타수, 순위 등")) {
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/maestro/delete_test_player_record.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("maestro_id=" + maestroID);
xhr.onload = function() {
if(xhr.readyState === 4 && xhr.status === 200) {
let replyJSON = JSON.parse(xhr.responseText);
// console.log(replyJSON);
}
}
alert("마에스트로 전용 계정의 모든 플레이 기록이 지워졌습니다.");
} else {
}
}
</script>
@@ -43,12 +102,12 @@ function deleteMaestroAllRecords() {
<ul class="header_menu">
<li>
<span class="col">
<a href="./../client/menu_app.html" target="_blank" id="delete_test_player_history" class="btn btn-rouge">마에스트로 앱<br/>실행</a>
<a href="./../client/menu_app.html" target="_blank" class="btn btn-rouge" onClick="runMaestroAccountApp()">마에스트로 앱<br/>실행</a>
</span>
</li>
<li>
<span class="col">
<a id="enter_test_player" class="btn btn-sea" onClick="deleteMaestroAllRecords()">마에스트로 앱<br/>모든 기록 삭제</a>
<a id="enter_test_player" class="btn btn-sea" id="delete_test_player_history" onClick="deleteMaestroAllRecords()">마에스트로 앱<br/>모든 기록 삭제</a>
</span>
</li>
<li>