Add: selected subject name to license time db

This commit is contained in:
2018-12-13 12:51:21 +09:00
parent 7b0664f8d5
commit 4e31886281
8 changed files with 80 additions and 55 deletions
+22
View File
@@ -3,6 +3,8 @@ var LicenseTimer = {
create: function() {
game.stage.backgroundColor = "#4d4d4d";
this.dbConnectManager = new DBConnectManager();
// keyboard shortcut
this.keyboardShortcut = new KeyboardShortcut();
this.keyboardShortcut.addCallback(
@@ -28,6 +30,8 @@ var LicenseTimer = {
this.chart = new Chart(this.licenseDataManager);
this.inputScore = new InputScore(this.licenseDataManager, this.timer, this.chart);
this.loadDataFromServer();
},
back: function() {
@@ -36,4 +40,22 @@ var LicenseTimer = {
game.state.start('Login');
},
loadDataFromServer: function() {
this.dbConnectManager.requestLicenseTimeData(
sessionStorageManager.getMaestroID(),
sessionStorageManager.getPlayerID(),
Timer.TIME_DEFAULT_SEC,
(function(replyJson) {
console.log(replyJson);
this.timer.loadDataFromServer(replyJson.leftTime, replyJson.startTime, replyJson.subjectName);
this.inputScore.loadDataFromServer(replyJson.subjectName);
}).bind(this),
(function(replyJson) {
console.log(replyJson);
this.timer.loadDataFromServer(Timer.TIME_DEFAULT_SEC, Timer.TIME_DEFAULT_SEC);
})
);
},
}