Commit 5b67fb82 authored by 范雪寒's avatar 范雪寒

feat: 上报成绩

parent cf1c38a3
...@@ -457,6 +457,16 @@ cc.Class({ ...@@ -457,6 +457,16 @@ cc.Class({
); );
} }
}); });
if (item.data.playerData.find(player => player.uuid == this.playerId)) {
item.data.playerData.sort((a, b) => {
return a.duration - b.duration;
});
const idx = item.data.playerData.findIndex(player => player.uuid == this.playerId);
this.onHomeworkFinish({
rank: idx + 1,
duration: this._gameDuration
});
}
} else if (item.data.type == "complete") { } else if (item.data.type == "complete") {
if (this.server) { if (this.server) {
this.server.onPlayerComplete(item.data.uuid, item.data.duration); this.server.onPlayerComplete(item.data.uuid, item.data.duration);
...@@ -499,6 +509,13 @@ cc.Class({ ...@@ -499,6 +509,13 @@ cc.Class({
}, },
//TODO:copy---end //TODO:copy---end
finish: false,
onHomeworkFinish(data) {
if (!finish) {
onHomeworkFinish(data);
this.finish = true;
}
},
onAnswerRight() { onAnswerRight() {
//TODO:copy---放烟花时机修改 //TODO:copy---放烟花时机修改
...@@ -565,7 +582,6 @@ cc.Class({ ...@@ -565,7 +582,6 @@ cc.Class({
this.submitBtnMoveOut(); this.submitBtnMoveOut();
this.showNextBtn(); this.showNextBtn();
this.stopCountTime(); this.stopCountTime();
onHomeworkFinish();
this.showResultLayer(); this.showResultLayer();
this.sendServerData(); this.sendServerData();
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment