Add: selected subject name to license time db
This commit is contained in:
@@ -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);
|
||||
})
|
||||
);
|
||||
},
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user