Fix: result record, ranking board bug

This commit is contained in:
2018-10-24 11:11:02 +09:00
parent c0e491677f
commit 8894b5a8e8
6 changed files with 50 additions and 37 deletions
+23 -17
View File
@@ -15,25 +15,31 @@ function HistoryBoard(type) {
this.textMyRanking = game.add.text(posX, posY + 100, '', arrayTabStyle)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
var today = new Date();
var date = DateUtil.getYYYYMMDD(today);
this.dbConnectManager.requestPlayerHistory(
sessionStorageManager.getMaestroID(),
date,
(function(historyRecordManager) {
if(historyRecordManager.getCount() == 0) {
console.log("history board - no data");
return;
}
setTimeout(
(function() {
var today = new Date();
var date = DateUtil.getYYYYMMDD(today);
this.dbConnectManager.requestPlayerHistory(
sessionStorageManager.getMaestroID(),
date,
(function(historyRecordManager) {
if(historyRecordManager.getCount() == 0) {
console.log("history board - no data");
return;
}
for(var i = 0; i < historyRecordManager.getCount(); i++) {
var data = historyRecordManager.getAt(i);
this.printRecord(i, data.date, data.bestRecord);
for(var i = 0; i < historyRecordManager.getCount(); i++) {
var data = historyRecordManager.getAt(i);
this.printRecord(i, data.date, data.bestRecord);
if(date == data.date)
this.todayBestRecord = data.bestRecord;
}
}).bind(this)
if(date == data.date)
this.todayBestRecord = data.bestRecord;
}
}).bind(this)
);
}).bind(this),
RecordBoard.DELAY_UPDATING_RESULT_RECORD_MS
);
}