Fix: restructing sessionManager (incompleted)

This commit is contained in:
2018-09-14 11:58:50 +09:00
parent 1a2d9e6800
commit 72e7c1a28f
6 changed files with 157 additions and 45 deletions
+15 -15
View File
@@ -31,11 +31,11 @@ class Start {
// contents
this.loadHowToPlay(sessionStorageManager.playingAppID);
this.loadHowToPlay(sessionStorageManager.getPlayingAppID());
this.makeStartButton();
this.makeRankingButton();
if(sessionStorageManager.maestroAccountType >= 100) { // experience account
if(sessionStorageManager.getMaestroAccountType() >= 100) { // experience account
this.printSampleChart();
this.announceBox = new AnnounceBox(50, 648);
this.announceBox.drawBox("체험 계정에서는 기록이 저장되지 않습니다.");
@@ -47,27 +47,27 @@ class Start {
// bottom ui
var screenBottomUI = new ScreenBottomUI();
screenBottomUI.printLeftText("오늘의 최고 기록 : ");
screenBottomUI.printCenterText(sessionStorageManager.playingAppKoreanName);
screenBottomUI.printRightText(sessionStorageManager.playerName);
screenBottomUI.printCenterText(sessionStorageManager.getPlayingAppKoreanName());
screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
this.dbConnectManager.requestTodayBestRecord(
sessionStorageManager.maestroID,
sessionStorageManager.playerID,
sessionStorageManager.playingAppID,
sessionStorageManager.getMaestroID(),
sessionStorageManager.getPlayerID(),
sessionStorageManager.getPlayingAppID(),
(function(replyJSON) {
sessionStorageManager.bestRecord = Number(replyJSON["BestRecord"]);
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.bestRecord);
sessionStorageManager.getBestRecord() = Number(replyJSON["BestRecord"]);
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.getBestRecord());
}).bind(this),
(function(replyJSON) { // no data
sessionStorageManager.bestRecord = 0;
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.bestRecord);
sessionStorageManager.getBestRecord() = 0;
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.getBestRecord());
}).bind(this)
);
}
loadHowToPlay(appID) {
this.dbConnectManager.requestHowToPlay(
sessionStorageManager.playingAppID, // space_invaders app ID
sessionStorageManager.getPlayingAppID(), // space_invaders app ID
(function(jsonData) {
var howToPlayText = jsonData["HowToPlay"].replace(/\\n/g, "\n");
this.howToPlay.printHowToPlay(howToPlayText);
@@ -83,7 +83,7 @@ class Start {
var today = new Date();
var date = DateUtil.getYYYYMMDD(today);
this.dbConnectManager.requestPlayerHistory(
sessionStorageManager.maestroID,
sessionStorageManager.getMaestroID(),
date,
(function(historyRecordManager) {
if(historyRecordManager.count == 0) {
@@ -158,7 +158,7 @@ class Start {
location.href = '../../web/client/ranking.html';
})
);
if(sessionStorageManager.maestroAccountType == 100)
if(sessionStorageManager.getMaestroAccountType() == 100)
rankingButton.inputEnabled = false;
}
@@ -169,7 +169,7 @@ class Start {
else if(isTypingTestStage())
location.href = "../../web/client/typing_test.html";
else
location.href = "../../web/client/" + sessionStorageManager.playingAppName + ".html";
location.href = "../../web/client/" + sessionStorageManager.getPlayingAppName() + ".html";
}
}