Skip to main content

Overview

The ToolsData class contains all configurable settings for a match, including tournament information, sponsor displays, timeout configuration, watermarks, playercam settings, and name overrides.

ToolsData Class

export class ToolsData {
  public seriesInfo: ISeriesInfo;
  public seedingInfo: ISeedingInfo;
  public tournamentInfo: ITournamentInfo;
  public timeoutDuration: number = 60;
  public timeoutCounter: ITimeoutInfo;
  public timeoutCancellationGracePeriod: number = 10;
  public sponsorInfo: ISponsorInfo;
  public watermarkInfo: IWatermarkInfo;
  public playercamsInfo: IPlayercamsInfo;
  public nameOverrides: INameOverrides;
  
  public constructor(init?: Partial<ToolsData>) {
    Object.assign(this, init);
    
    if (this.tournamentInfo.logoUrl != "" || this.tournamentInfo.name != "") {
      this.tournamentInfo.enabled = true;
    }
    this.timeoutCounter.left = this.timeoutCounter.max;
    this.timeoutCounter.right = this.timeoutCounter.max;
  }
}

Series Information

ISeriesInfo

export type ISeriesInfo = {
  needed: number;
  wonLeft: number;
  wonRight: number;
  mapInfo: MapPoolInfo[];
};
needed
number
default:"1"
Number of maps needed to win the series (e.g., 3 for Bo5).
wonLeft
number
default:"0"
Maps won by the left team.
wonRight
number
default:"0"
Maps won by the right team.
mapInfo
MapPoolInfo[]
default:"[]"
Array of map pool entries showing past results and upcoming maps.

Tournament Configuration

ITournamentInfo

export type ITournamentInfo = {
  name: string;
  logoUrl: string;
  backdropUrl: string;
  enabled: boolean;
};
name
string
default:""
Tournament name to display.
logoUrl
string
default:""
URL to tournament logo image.
backdropUrl
string
default:""
URL to tournament backdrop/background image.
enabled
boolean
Auto-set to true if name or logoUrl is provided.

ISeedingInfo

export type ISeedingInfo = {
  left: string;
  right: string;
};
left
string
default:""
Seeding information for left team (e.g., “#1 Seed”, “Upper Finals”).
right
string
default:""
Seeding information for right team.

Timeout Configuration

ITimeoutInfo

export type ITimeoutInfo = {
  max: number;
  left: number;
  right: number;
};
max
number
default:"2"
Maximum timeouts each team can have.
left
number
default:"2"
Timeouts remaining for left team. Initialized to max.
right
number
default:"2"
Timeouts remaining for right team. Initialized to max.

Timeout Settings

timeoutDuration
number
default:"60"
Duration of each timeout in seconds.
timeoutCancellationGracePeriod
number
default:"10"
Grace period in seconds during which a timeout can be cancelled without consuming it.

ISponsorInfo

export type ISponsorInfo = {
  enabled: boolean;
  duration: number;
  sponsors: string[];
};
enabled
boolean
default:"false"
Whether sponsor rotation is active.
duration
number
default:"5"
Seconds each sponsor is displayed before rotating.
sponsors
string[]
default:"[]"
Array of sponsor image URLs. Automatically includes Spectra logo for non-supporters.
Note: If enabled is true and the organization is not a Spectra Plus supporter, the Spectra logo is automatically appended to the sponsors array.

Watermark Settings

IWatermarkInfo

export type IWatermarkInfo = {
  spectraWatermark: boolean;
  customTextEnabled: boolean;
  customText: string;
};
spectraWatermark
boolean
default:"true"
Whether to show the Spectra watermark.License Requirement: Always true for non-supporters. Disabling without Spectra Plus violates license terms.
customTextEnabled
boolean
default:"false"
Whether custom watermark text is enabled.Supporter Feature: Only available with Spectra Plus. Automatically disabled for non-supporters.
customText
string
default:""
Custom watermark text to display (when enabled and user is a supporter).

Playercam Integration

IPlayercamsInfo

export type IPlayercamsInfo = {
  enable: boolean;
  removeTricodes: boolean;
  identifier: string;
  secret: string;
  endTime: number;
  enabledPlayers: string[];
};
enable
boolean
default:"false"
Whether playercam integration is enabled.
removeTricodes
boolean
default:"false"
Whether to remove team tricodes from player names.
identifier
string
default:""
Unique identifier for playercam session.
secret
string
default:""
Secret key for playercam authentication.
endTime
number
default:"0"
Unix timestamp when playercam access expires.
enabledPlayers
string[]
default:"[]"
Array of player IDs with playercams enabled. Populated from backend.

Name Overrides

INameOverrides

export type INameOverrides = {
  overrides: string;  // JSON representation of Map<string, string>
};
overrides
string
default:"'[]'"
JSON-encoded map of player ID to display name overrides.

IOverridesPlayercamsData

export type IOverridesPlayercamsData = {
  nameOverrides: string;  // JSON representation of Map<string, string>
  enabledPlayers: string[];
};
Response structure from backend when fetching playercam and name override data.

MapPoolInfo Types

The map pool system supports four states for each map in a series:

Base Type

type BaseMapPoolInfo = {
  type: "past" | "present" | "future" | "disabled";
};

Past Map

type PastMapPoolInfo = BaseMapPoolInfo & {
  type: "past";
  map: string;
  left: {
    logo: string;
    score: number;
  };
  right: {
    logo: string;
    score: number;
  };
};
Represents a completed map with final scores.
map
string
Map name (e.g., “Ascent”, “Bind”).
Left team logo URL.
left.score
number
Left team’s score on this map.
Right team logo URL.
right.score
number
Right team’s score on this map.

Present Map

type PresentMapPoolInfo = BaseMapPoolInfo & {
  type: "present";
  logo: string;
};
Represents the currently active map.
Map logo/image URL.

Future Map

type FutureMapPoolInfo = BaseMapPoolInfo & {
  type: "future";
  map: string;
  logo: string;
};
Represents an upcoming map in the series.
map
string
Map name.
logo
string
Map logo URL.

Disabled Slot

type DisabledMapPoolInfo = BaseMapPoolInfo & {
  type: "disabled";
};
Represents an unused map slot.

Union Type

export type MapPoolInfo =
  | PastMapPoolInfo
  | PresentMapPoolInfo
  | FutureMapPoolInfo
  | DisabledMapPoolInfo;

Example Usage

// Basic configuration
const toolsData = new ToolsData({
  tournamentInfo: {
    name: "VCT Champions 2024",
    logoUrl: "https://example.com/vct-logo.png",
    backdropUrl: "https://example.com/vct-bg.png",
    enabled: true
  },
  seriesInfo: {
    needed: 3,  // Best of 5
    wonLeft: 1,
    wonRight: 0,
    mapInfo: [
      {
        type: "past",
        map: "Ascent",
        left: { logo: "https://example.com/team1.png", score: 13 },
        right: { logo: "https://example.com/team2.png", score: 11 }
      },
      {
        type: "present",
        logo: "https://example.com/bind.png"
      },
      {
        type: "future",
        map: "Haven",
        logo: "https://example.com/haven.png"
      }
    ]
  },
  seedingInfo: {
    left: "#1 Seed - Americas",
    right: "#2 Seed - EMEA"
  },
  timeoutDuration: 90,  // 90-second timeouts
  timeoutCounter: {
    max: 2,
    left: 2,
    right: 2
  },
  sponsorInfo: {
    enabled: true,
    duration: 8,
    sponsors: [
      "https://example.com/sponsor1.png",
      "https://example.com/sponsor2.png"
    ]
  },
  watermarkInfo: {
    spectraWatermark: true,
    customTextEnabled: true,
    customText: "VCT Champions - Grand Finals"
  },
  playercamsInfo: {
    enable: true,
    removeTricodes: true,
    identifier: "session-123",
    secret: "secret-456",
    endTime: Date.now() + 3600000,  // 1 hour from now
    enabledPlayers: ["player-1", "player-2"]
  },
  nameOverrides: {
    overrides: JSON.stringify({
      "player-uuid-1": "TenZ",
      "player-uuid-2": "zekken"
    })
  }
});

// Access configuration
console.log(toolsData.tournamentInfo.name); // "VCT Champions 2024"
console.log(toolsData.timeoutCounter.left); // 2
console.log(toolsData.seriesInfo.needed); // 3

Automatic Adjustments

Build docs developers (and LLMs) love