Fix: updateRecord before Result

This commit is contained in:
2018-12-25 18:49:34 +09:00
parent 1a2dde8a94
commit 4c1a2a278e
18 changed files with 287 additions and 56 deletions
+20 -6
View File
@@ -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';
},
+31 -6
View File
@@ -1,6 +1,8 @@
var TypingTest = {
create: function() {
this.dbConnectManager = new DBConnectManager();
var self = this;
this.initTypingData();
@@ -8,7 +10,7 @@ var TypingTest = {
var experienceAppTimer = new ExperienceAppTimer();
experienceAppTimer.setTimeOverListener(
(function() { this.gameOver(); }).bind(this)
(function() { this.timeOver(); }).bind(this)
);
game.stage.backgroundColor = '#4d4d4d';
@@ -164,20 +166,42 @@ var TypingTest = {
this.showPlayingWordNumber();
},
gameOver: function() {
var gameOverText = new GameOverText();
timeOver: function() {
var timeOverText = new TimeOverText();
this.stopAndGoResult();
},
gameOver: function() {
var missionClearText = new MissionClearText();
this.stopAndGoResult();
},
stopAndGoResult: function() {
this.animalList.stopAnimation();
sessionStorageManager.setRecord(this.typingRecordTotal);
if(!isExperienceMaestroAccount())
this.updateResultRecord();
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
},
goResult: function() {
sessionStorageManager.setRecord(this.typingRecordTotal);
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';
},
initTypingData: function() {
var typingTextMan = new TypingTextManager();
@@ -333,7 +357,8 @@ var TypingTest = {
this.playNextContent();
if(this.typingIndex == this.typingContentLength)
this.goResult();
this.gameOver();
// this.goResult();
// this.state.start('TypingTestResult');
}
}
+22 -6
View File
@@ -1,6 +1,8 @@
var WhacAMole = {
create: function() {
this.dbConnectManager = new DBConnectManager();
var self = this;
this.isOnStage = false;
@@ -10,7 +12,7 @@ var WhacAMole = {
var experienceAppTimer = new ExperienceAppTimer();
experienceAppTimer.setTimeOverListener(
(function() { this.gameOver(); }).bind(this)
(function() { this.timeOver(); }).bind(this)
);
game.stage.backgroundColor = '#4d4d4d';
@@ -45,7 +47,7 @@ var WhacAMole = {
self.isOnStage = false;
// self.goResult();
self.gameOver();
self.timeOver();
}));
@@ -155,7 +157,7 @@ var WhacAMole = {
this.showHighlightKey();
},
gameOver: function() {
timeOver: function() {
this.isOnStage = false;
for(var i = 0; i < WhacAMole.TYPING_CONTENT_DONE_COUNT; i++) {
@@ -173,13 +175,27 @@ var WhacAMole = {
this.textTypingContentPreview[i].text = "";
}
var gameOverText = new GameOverText();
var timeOverText = new TimeOverText();
sessionStorageManager.setRecord(this.scoreManager.getScore());
if(!isExperienceMaestroAccount())
this.updateResultRecord();
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
},
goResult: function() {
sessionStorageManager.setRecord(this.scoreManager.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';
},