Add: app highest record

This commit is contained in:
2018-10-23 22:29:24 +09:00
parent e384627c54
commit d45e44c6b2
12 changed files with 295 additions and 20 deletions
+33
View File
@@ -379,6 +379,18 @@ DBConnectManager.prototype.updateTodayBestRecord = function(maestroID, playerID,
);
}
DBConnectManager.prototype.updateAppHighestRecord = function(maestroID, playerID, appID, record) {
var xhr = new XMLHttpRequest();
xhr.open("POST", this.phpPath + "server/record/update_app_highest_record.php", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(
"MaestroID=" + maestroID
+ "&PlayerID=" + playerID
+ "&AppID=" + appID
+ "&Record=" + record
);
}
DBConnectManager.prototype.requestTodayBestRecord = function(maestroID, playerID, appID, onSucceededListener, onFailedListener) {
var xhr = new XMLHttpRequest();
xhr.open("POST", this.phpPath + "server/record/request_best_record.php", true);
@@ -400,6 +412,27 @@ DBConnectManager.prototype.requestTodayBestRecord = function(maestroID, playerID
);
}
DBConnectManager.prototype.requestAppHighestRecord = function(maestroID, playerID, appID, onSucceededListener, onFailedListener) {
var xhr = new XMLHttpRequest();
xhr.open("POST", this.phpPath + "server/record/request_app_highest_record.php", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if(xhr.readyState == 4 && xhr.status == 200) {
var replyJSON = JSON.parse(xhr.responseText);
if(replyJSON != null && replyJSON["AppHighestRecord"] != null)
onSucceededListener(replyJSON);
else
onFailedListener(replyJSON);
}
};
xhr.send(
"MaestroID=" + maestroID
+ "&PlayerID=" + playerID
+ "&AppID=" + appID
);
}
DBConnectManager.prototype.requestAppRanking = function(maestroID, appID, onSucceededListener, onFailedListener) {
var xhr = new XMLHttpRequest();
xhr.open("POST", this.phpPath + "server/record/app_ranking.php", true);
+1 -1
View File
@@ -65,7 +65,7 @@ ScreenBottomUI.prototype.printText = function(textObject, text, align) {
ScreenBottomUI.prototype.printLeftTextWithBestRecord = function(bestRecord) {
var roundUpBestRecord = Math.round(bestRecord);
var highScoreWithCommas = NumberUtil.numberWithCommas(roundUpBestRecord);
this.printLeftText("오늘의 최고 기록 : " + highScoreWithCommas);
this.printLeftText("최고 기록 : " + highScoreWithCommas);
}
ScreenBottomUI.prototype.getFontStyle = function() {
+11 -2
View File
@@ -80,7 +80,7 @@ SessionStorageManager.prototype.setRecord = function(value) {
sessionStorage.setItem("record", value);
}
SessionStorageManager.prototype.getRecord = function() {
return sessionStorage.getItem("record");
return Number(sessionStorage.getItem("record"));
}
// best record
@@ -88,7 +88,15 @@ SessionStorageManager.prototype.setBestRecord = function(value) {
sessionStorage.setItem("bestRecord", value);
}
SessionStorageManager.prototype.getBestRecord = function() {
return sessionStorage.getItem("bestRecord");
return Number(sessionStorage.getItem("bestRecord"));
}
// best record
SessionStorageManager.prototype.setAppHighestRecord = function(value) {
sessionStorage.setItem("appHighestRecord", value);
}
SessionStorageManager.prototype.getAppHighestRecord = function() {
return Number(sessionStorage.getItem("appHighestRecord"));
}
// best record
@@ -105,6 +113,7 @@ SessionStorageManager.prototype.resetPlayingAppData = function() {
this.removeItem("playingAppKoreanName");
this.removeItem("record");
this.removeItem("bestRecord");
this.removeItem("appHighestRecord");
}