diff --git a/src/controller/MatchController.ts b/src/controller/MatchController.ts index a4fec81..b3dd804 100644 --- a/src/controller/MatchController.ts +++ b/src/controller/MatchController.ts @@ -3,6 +3,7 @@ import { AuthTeam, WebsocketIncoming } from "../connector/websocketIncoming"; import { WebsocketOutgoing } from "../connector/websocketOutgoing"; import { Match } from "../model/Match"; import { IAuthedAuxData, IAuthedData, IAuthenticationData } from "../model/eventData"; +import { ITournamentInfo, ISponsorInfo } from "../model/ToolsData"; import logging from "../util/Logging"; const Log = logging("MatchController"); @@ -18,7 +19,7 @@ export class MatchController { private codeToTeamInfo: Record = {}; private finishedGamesTeamInfo: Record< string, - { leftTeam: AuthTeam; rightTeam: AuthTeam; higherScore: 0 | 1 } + { leftTeam: AuthTeam; rightTeam: AuthTeam; higherScore: 0 | 1; tournamentInfo: ITournamentInfo; sponsorInfo: ISponsorInfo; isSupporter: boolean } > = {}; private teamInfoExpiry: Record = {}; @@ -201,11 +202,14 @@ export class MatchController { } } - public setWinningTeamInfo(groupCode: string, higherScoreTeam: 0 | 1) { + public setWinningTeamInfo(groupCode: string, higherScoreTeam: 0 | 1, sponsorInfo: ISponsorInfo, tournamentInfo: ITournamentInfo, isSupporter: boolean) { this.finishedGamesTeamInfo[groupCode] = { leftTeam: this.codeToTeamInfo[groupCode].leftTeam, rightTeam: this.codeToTeamInfo[groupCode].rightTeam, higherScore: higherScoreTeam, + tournamentInfo: tournamentInfo, + sponsorInfo: sponsorInfo, + isSupporter: isSupporter, }; } } diff --git a/src/model/Match.ts b/src/model/Match.ts index a54b808..42b2827 100644 --- a/src/model/Match.ts +++ b/src/model/Match.ts @@ -280,6 +280,9 @@ export class Match { MatchController.getInstance().setWinningTeamInfo( this.groupCode, this.teams[0].roundsWon > this.teams[1].roundsWon ? 0 : 1, + this.tools.sponsorInfo, + this.tools.tournamentInfo, + this.orgIsSupporter, ); this.eventNumber++;