Fix: updateRecord before Result
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
var TypingPractice = {
|
||||
|
||||
create: function() {
|
||||
this.dbConnectManager = new DBConnectManager();
|
||||
|
||||
var self = this;
|
||||
|
||||
this.isOnStage = false;
|
||||
@@ -10,7 +12,7 @@ var TypingPractice = {
|
||||
|
||||
var experienceAppTimer = new ExperienceAppTimer();
|
||||
experienceAppTimer.setTimeOverListener(
|
||||
(function() { this.gameOver(); }).bind(this)
|
||||
(function() { this.timeOver(); }).bind(this)
|
||||
);
|
||||
|
||||
game.stage.backgroundColor = '#4d4d4d';
|
||||
@@ -26,7 +28,7 @@ var TypingPractice = {
|
||||
self.isOnStage = false;
|
||||
|
||||
// self.goResult();
|
||||
self.gameOver();
|
||||
self.timeOver();
|
||||
}));
|
||||
|
||||
|
||||
@@ -130,7 +132,7 @@ var TypingPractice = {
|
||||
this.moveHands();
|
||||
},
|
||||
|
||||
gameOver: function() {
|
||||
timeOver: function() {
|
||||
this.isOnStage = false;
|
||||
|
||||
for(var i = 0; i < TypingPractice.TYPING_CONTENT_DONE_COUNT; i++) {
|
||||
@@ -151,14 +153,26 @@ var TypingPractice = {
|
||||
this.rightHand.moveToDefaultPosition();
|
||||
|
||||
this.animalList.stopAnimation();
|
||||
var timeOverText = new TimeOverText();
|
||||
|
||||
sessionStorageManager.setRecord(this.typingScore.getScore());
|
||||
this.updateResultRecord();
|
||||
|
||||
var gameOverText = new GameOverText();
|
||||
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
|
||||
},
|
||||
|
||||
goResult: function() {
|
||||
sessionStorageManager.setRecord(this.typingScore.getScore());
|
||||
updateResultRecord: function() {
|
||||
if(sessionStorageManager.getMaestroAccountType() < 100) { // experience account
|
||||
this.dbConnectManager.updateResultRecord(
|
||||
sessionStorageManager.getMaestroID(),
|
||||
sessionStorageManager.getPlayerID(),
|
||||
sessionStorageManager.getPlayingAppID(),
|
||||
sessionStorageManager.getRecord()
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
goResult: function() {
|
||||
location.href = '../../web/client/result.html';
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user