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 -5
View File
@@ -1,13 +1,15 @@
var Game = {
create: function() {
this.dbConnectManager = new DBConnectManager();
this.game.stage.backgroundColor = "#000000"; // '#4d4d4d';
sessionStorageManager.setIsNewAppHighestRecord(false);
var experienceAppTimer = new ExperienceAppTimer();
experienceAppTimer.setTimeOverListener(
(function() { this.gameOver(); }).bind(this)
(function() { this.timeOver(); }).bind(this)
);
// keyboard shortcut
@@ -47,7 +49,7 @@ var Game = {
(function() {
this.setClickEnable(false);
this.gameOver();
this.timeOver();
}).bind(this)
);
@@ -540,7 +542,11 @@ var Game = {
},
gameOver: function() {
timeOver: function() {
var timeOverText = new TimeOverText();
if(!isExperienceMaestroAccount())
this.updateResultRecord();
this.activatedCardColumnNo = 0;
this.activatedCardRowNo = 0;
this.initCards();
@@ -553,11 +559,20 @@ var Game = {
}
this.gameTimeEvents = [];
var gameOverText = new GameOverText();
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
},
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';
},