make match finish async again
This commit is contained in:
parent
1907e9910d
commit
b6a0d5e4b1
1 changed files with 6 additions and 4 deletions
|
@ -550,10 +550,12 @@ export class Match {
|
|||
}
|
||||
|
||||
// All players have finished playing, finish the match
|
||||
if (allLoaded) await this.finishMatch();
|
||||
if (allLoaded) {
|
||||
await this.finishMatch();
|
||||
}
|
||||
}
|
||||
|
||||
public finishMatch() {
|
||||
public async finishMatch() {
|
||||
if (!this.inProgress) {
|
||||
return;
|
||||
}
|
||||
|
@ -597,6 +599,8 @@ export class Match {
|
|||
slot.status = SlotStatus.NotReady;
|
||||
}
|
||||
|
||||
await this.sharedContent.database.query("INSERT INTO mp_match_rounds (id, match_id, round_id, round_mode, match_type, round_scoring_type, round_team_type, round_mods, beatmap_md5, freemod, player0, player1, player2, player3, player4, player5, player6, player7, player8, player9, player10, player11, player12, player13, player14, player15) VALUES (NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", queryData);
|
||||
|
||||
osuPacketWriter.MatchComplete();
|
||||
|
||||
// Inform all users in the match that it is complete
|
||||
|
@ -609,8 +613,6 @@ export class Match {
|
|||
// TODO: Re-implement multiplayer extras
|
||||
//if (this.multiplayerExtras != null) this.multiplayerExtras.onMatchFinished(JSON.parse(JSON.stringify(this.playerScores)));
|
||||
|
||||
this.sharedContent.database.query("INSERT INTO mp_match_rounds (id, match_id, round_id, round_mode, match_type, round_scoring_type, round_team_type, round_mods, beatmap_md5, freemod, player0, player1, player2, player3, player4, player5, player6, player7, player8, player9, player10, player11, player12, player13, player14, player15) VALUES (NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", queryData);
|
||||
|
||||
this.playerScores = undefined;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue