Fix: update best record for every hour

This commit is contained in:
2018-06-06 00:06:40 +09:00
parent 3f43f80c3d
commit b4f0531db0
5 changed files with 17 additions and 6 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ let sessionStorageManager = new SessionStorageManager();
console.log("playingAppName : " + sessionStorageManager.playingAppName);
console.log("playingAppKoreanName : " + sessionStorageManager.playingAppKoreanName);
console.log("record : " + sessionStorageManager.record);
console.log("BestRecord : " + sessionStorageManager.bestRecord);
console.log("bestRecord : " + sessionStorageManager.bestRecord);
}
function isTypingGame() {
+1 -1
View File
@@ -30,7 +30,7 @@ class Game {
scoreManager.addOnChangeHighScoreListener( highScore => {
sessionStorageManager.bestRecord = highScore;
sessionStorageManager.isNewBestRecrd = true;
screenBottom.printBottomLeftTextWithBestRecord();
screenBottom.printBottomLeftTextWithBestRecord(sessionStorageManager.bestRecord);
});
+11
View File
@@ -16,6 +16,11 @@ class Start {
// top
let backButton = new BackButton( () => {
sessionStorageManager.playingAppName = null;
sessionStorageManager.playingAppKoreanName = null;
sessionStorageManager.record = null;
sessionStorageManager.bestRecord = null;
location.href = '../../web/client/menu_app.html';
});
@@ -26,6 +31,7 @@ class Start {
// this.printHowToPlay(appInfoManager.getHowToPlayText(sessionStorageManager.playingAppName));
this.loadHowToPlay(sessionStorageManager.playingAppID);
this.makeStartButton();
let today = new Date();
let date = DateUtil.getYYYYMMDD(today);
this.dbConnectManager.requestPlayerHistory(
@@ -71,6 +77,11 @@ class Start {
sessionStorageManager.BestRecord = Number(replyJSON["BestRecord"]);
let highScoreWithCommas = NumberUtil.numberWithCommas(sessionStorageManager.BestRecord);
screenBottom.printBottomLeftText("오늘의 최고 기록 : " + highScoreWithCommas);
},
replyJSON => { // no data
sessionStorageManager.BestRecord = 0;
let highScoreWithCommas = NumberUtil.numberWithCommas(sessionStorageManager.BestRecord);
screenBottom.printBottomLeftText("오늘의 최고 기록 : " + highScoreWithCommas);
}
);
}