Skip to content

Commit 3f94665

Browse files
committed
Get mapWinInfo from client, bump version
1 parent 9d0cf8f commit 3f94665

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spectra-server",
3-
"version": "0.2.11",
3+
"version": "0.2.12",
44
"author": {
55
"name": "Spectra Team",
66
"url": "https://valospectra.com"

src/model/Match.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ export class Match {
3434
private spikeState: SpikeStates = { planted: false, detonated: false, defused: false };
3535
private attackersWon: boolean = false;
3636

37+
private mapsNeeded: number = 1;
38+
private mapsWonLeft: number = 0;
39+
private mapsWonRight: number = 0;
40+
3741
// private ranks: { team1: string[]; team2: string[] } = { team1: [], team2: [] };
3842

3943
private replayLog: ReplayLogging;
@@ -52,6 +56,13 @@ export class Match {
5256
this.teams.push(firstTeam);
5357
this.teams.push(secondTeam);
5458

59+
this.mapsNeeded =
60+
typeof data.mapWinInfo.mapsNeeded == "number" ? data.mapWinInfo.mapsNeeded : 1;
61+
this.mapsWonLeft =
62+
typeof data.mapWinInfo.mapsWonLeft == "number" ? data.mapWinInfo.mapsWonLeft : 0;
63+
this.mapsWonRight =
64+
typeof data.mapWinInfo.mapsWonRight == "number" ? data.mapWinInfo.mapsWonRight : 0;
65+
5566
if (process.env.USE_BACKEND === "true") {
5667
this.organizationId = data.organizationId || "";
5768
}

src/model/eventData.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export interface IAUthenticationData {
8383
groupCode: string;
8484
leftTeam: AuthTeam;
8585
rightTeam: AuthTeam;
86+
mapWinInfo: IMapWinInfo;
8687
organizationId?: string;
8788
}
8889

@@ -109,3 +110,9 @@ export function isAuthedData(data: object): data is IAuthedData {
109110
}
110111
return false;
111112
}
113+
114+
export interface IMapWinInfo {
115+
mapsNeeded: number;
116+
mapsWonLeft: number;
117+
mapsWonRight: number;
118+
}

src/replay/ReplayConnectorService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export class ReplayConnectorService {
7373
key: this.key,
7474
leftTeam: this.leftTeam,
7575
rightTeam: this.rightTeam,
76+
mapWinInfo: { mapsNeeded: 1, mapsWonLeft: 0, mapsWonRight: 0 },
7677
};
7778
this.ws.emit("obs_logon", JSON.stringify(authData));
7879

src/util/CompatibleClients.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import semver from "semver";
22

33
export function isCompatibleVersion(version: string): boolean {
4-
return semver.satisfies(version, `>=0.2.6 <0.3.0`);
4+
return semver.satisfies(version, `>=0.2.9 <0.3.0`);
55
}

0 commit comments

Comments
 (0)