Add: menu_app_list.php
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
class AppInfo {
|
||||
|
||||
constructor(name, nameKorean, howToPlay) {
|
||||
this.name = name;
|
||||
constructor(appID, appName, koreanName, howToPlay) {
|
||||
this.appID = appID;
|
||||
this.appName = appName;
|
||||
|
||||
this.nameKorean = nameKorean;
|
||||
this.koreanName = koreanName;
|
||||
this.isActivated = false;
|
||||
this.howToPlay = howToPlay;
|
||||
}
|
||||
@@ -51,26 +52,26 @@ class AppInfoManager {
|
||||
));
|
||||
}
|
||||
|
||||
setHowToPlay(name, text) {
|
||||
this.appInfoMap[name].howToPlay = text;
|
||||
setHowToPlay(appName, text) {
|
||||
this.appInfoMap[appName].howToPlay = text;
|
||||
}
|
||||
|
||||
registerAppInfo(appInfo) {
|
||||
return this.appInfoMap[appInfo.name] = appInfo;
|
||||
return this.appInfoMap[appInfo.appName] = appInfo;
|
||||
}
|
||||
|
||||
getAppNameKorean(name) {
|
||||
if(name === null)
|
||||
getAppkoreanName(appName) {
|
||||
if(appName === null)
|
||||
return "";
|
||||
|
||||
return this.appInfoMap[name].nameKorean;
|
||||
return this.appInfoMap[appName].koreanName;
|
||||
}
|
||||
|
||||
getHowToPlayText(name) {
|
||||
if(name === null)
|
||||
getHowToPlayText(appName) {
|
||||
if(appName === null)
|
||||
return "";
|
||||
|
||||
return this.appInfoMap[name].howToPlay;
|
||||
return this.appInfoMap[appName].howToPlay;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -64,6 +64,24 @@ class DBConnectManager {
|
||||
xhr.send("maestro_name=" + maestroName + "&name=" + userName + "&enter_code=" + enterCode);
|
||||
}
|
||||
|
||||
/*
|
||||
requestAppList(maestroID, onSucceededListener, onFailedListener) {
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", this.phpPath + "server/app/app_data.php", true);
|
||||
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||
xhr.onreadystatechange = function() {
|
||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||
let replyJSON = JSON.parse(xhr.responseText);
|
||||
|
||||
if(replyJSON != null)
|
||||
onSucceededListener(replyJSON);
|
||||
else
|
||||
onFailedListener(replyJSON);
|
||||
}
|
||||
};
|
||||
xhr.send("maestro_id=" + maestroID);
|
||||
}
|
||||
|
||||
requestActiveAppList(maestroID, onSucceededListener, onFailedListener) {
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", this.phpPath + "server/app/active_app.php", true);
|
||||
@@ -72,7 +90,25 @@ class DBConnectManager {
|
||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||
let replyJSON = JSON.parse(xhr.responseText);
|
||||
|
||||
if(replyJSON != null && replyJSON.length > 0)
|
||||
if(replyJSON != null)
|
||||
onSucceededListener(replyJSON);
|
||||
else
|
||||
onFailedListener(replyJSON);
|
||||
}
|
||||
};
|
||||
xhr.send("maestro_id=" + maestroID);
|
||||
}
|
||||
*/
|
||||
|
||||
requestMenuAppList(maestroID, onSucceededListener, onFailedListener) {
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", this.phpPath + "server/app/menu_app_list.php", true);
|
||||
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||
xhr.onreadystatechange = function() {
|
||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||
let replyJSON = JSON.parse(xhr.responseText);
|
||||
|
||||
if(replyJSON != null)
|
||||
onSucceededListener(replyJSON);
|
||||
else
|
||||
onFailedListener(replyJSON);
|
||||
@@ -89,7 +125,7 @@ class DBConnectManager {
|
||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||
let replyJSON = JSON.parse(xhr.responseText);
|
||||
|
||||
if(replyJSON != null && replyJSON.length > 0)
|
||||
if(replyJSON != null)
|
||||
onSucceededListener(replyJSON);
|
||||
else
|
||||
onFailedListener(replyJSON);
|
||||
@@ -121,9 +157,8 @@ class DBConnectManager {
|
||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||
let replyJSON = JSON.parse(xhr.responseText);
|
||||
|
||||
if(replyJSON != null) {
|
||||
if(replyJSON != null)
|
||||
listener(self.parseJSONtoHistoryRecord(replyJSON));
|
||||
}
|
||||
else
|
||||
onFailedListener(replyJSON);
|
||||
}
|
||||
|
||||
+28
-11
@@ -24,28 +24,33 @@ class MenuApp {
|
||||
let screenBottom = new ScreenBottom();
|
||||
screenBottom.makeBottomLine();
|
||||
// screenBottom.printBottomLeftText("게임 진행 정보");
|
||||
let playingAppName = appInfoManager.getAppNameKorean(sessionStorageManager.playingAppName);
|
||||
screenBottom.printBottomCenterText(playingAppName);
|
||||
// let playingAppName = appInfoManager.getAppNameKorean(sessionStorageManager.playingAppName);
|
||||
// screenBottom.printBottomCenterText(playingAppName);
|
||||
screenBottom.printBottomCenterText("메뉴");
|
||||
screenBottom.printBottomRightText(sessionStorageManager.playerName);
|
||||
|
||||
|
||||
this.makeActiveAppButtons();
|
||||
this.loadAppData();
|
||||
}
|
||||
|
||||
|
||||
makeActiveAppButtons() {
|
||||
loadAppData() {
|
||||
let dbConnectManager = new DBConnectManager();
|
||||
dbConnectManager.requestActiveAppList(
|
||||
dbConnectManager.requestMenuAppList(
|
||||
sessionStorageManager.maestroID,
|
||||
self.loginSucceeded,
|
||||
self.loginFailed
|
||||
self.loadSucceeded,
|
||||
self.loadFailed
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
loginSucceeded(replyJSON) {
|
||||
loadSucceeded(replyJSON) {
|
||||
// console.log(replyJSON);
|
||||
|
||||
self.makeMouseAppButtons(replyJSON.MouseAppList);
|
||||
self.makeTypingButtons(replyJSON.TypingPracticeAppCount, replyJSON.TypingAppList);
|
||||
|
||||
/*
|
||||
|
||||
let mouseAppCount = self.getAppCount(replyJSON, AppButton.TYPE_MOUSE);
|
||||
let typingPracticeAppCount = self.getAppCount(replyJSON, AppButton.TYPE_TYPING);
|
||||
|
||||
@@ -74,6 +79,18 @@ class MenuApp {
|
||||
}
|
||||
);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
makeMouseAppButtons(mouseAppJSON) {
|
||||
console.log(mouseAppJSON);
|
||||
|
||||
}
|
||||
|
||||
makeTypingButtons(typingPracticeAppCount, typingAppJSON) {
|
||||
console.log(typingPracticeAppCount);
|
||||
console.log(typingAppJSON);
|
||||
|
||||
}
|
||||
|
||||
isMouseApp(app) {
|
||||
@@ -96,8 +113,8 @@ class MenuApp {
|
||||
return appCount;
|
||||
}
|
||||
|
||||
loginFailed(replyJSON) {
|
||||
console.log('login failed, jsonData : ' + JSON.stringify(replyJSON));
|
||||
loadFailed(replyJSON) {
|
||||
// console.log('login failed, jsonData : ' + JSON.stringify(replyJSON));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user