diff --git a/src/controller/MatchController.ts b/src/controller/MatchController.ts index 47afec0..3e6a588 100644 --- a/src/controller/MatchController.ts +++ b/src/controller/MatchController.ts @@ -28,14 +28,10 @@ export class MatchController { } const newMatch = new Match(data); - if (process.env.USE_BACKEND === "true") { - newMatch.organizationId = data.organizationId || ""; - } - this.matches[data.groupCode] = newMatch; this.eventNumbers[data.groupCode] = 0; - this.startOutgoingSendLoop(); Log.info(`New match "${newMatch.groupCode}" registered!`); + this.startOutgoingSendLoop(); return true; } catch (e) { Log.info(`Failed to create match with group code ${data.groupCode}, ${e}`); diff --git a/src/model/Match.ts b/src/model/Match.ts index 4383ad3..11ba9b4 100644 --- a/src/model/Match.ts +++ b/src/model/Match.ts @@ -51,6 +51,11 @@ export class Match { this.teams.push(firstTeam); this.teams.push(secondTeam); + + if (process.env.USE_BACKEND === "true") { + this.organizationId = data.organizationId || ""; + Log.info(`Match ${this.groupCode} created with organization ${this.organizationId}`); + } } async receiveMatchSpecificData(data: IAuthedData) {