Overview
The event data system defines all data structures used to communicate match state between clients (observer, auxiliary) and the server. Events are strongly typed using TypeScript interfaces and discriminated by the DataTypes enum.
DataTypes Enum
export enum DataTypes {
// Observer Data
SCOREBOARD = "scoreboard",
KILLFEED = "killfeed",
ROSTER = "roster",
MATCH_START = "match_start",
ROUND_INFO = "round_info",
TEAM_IS_ATTACKER = "team_is_attacker",
SCORE = "score",
GAME_MODE = "game_mode",
MAP = "map",
OBSERVING = "observing",
SPIKE_DETONATED = "spike_detonated",
SPIKE_DEFUSED = "spike_defused",
// Authentication
AUTH = "authenticate",
AUX_AUTH = "aux_authenticate",
// Auxiliary Data
AUX_ABILITIES = "aux_abilities",
AUX_HEALTH = "aux_health",
AUX_SCOREBOARD = "aux_scoreboard",
AUX_SCOREBOARD_TEAM = "aux_scoreboard_team",
AUX_ASTRA_TARGETING = "aux_astra_targeting",
AUX_CYPHER_CAM = "aux_cypher_cam",
// Hotkey Events
SPIKE_PLANTED = "spike_planted",
TECH_PAUSE = "tech_pause",
LEFT_TIMEOUT = "left_timeout",
RIGHT_TIMEOUT = "right_timeout",
SWITCH_KDA_CREDITS = "switch_kda_credits",
// Preview
PREVIEW = "preview",
}
Observer Event Interfaces
export interface IFormattedScoreboard {
name: string;
tagline: string;
playerId: string;
startTeam: number; // 0 or 1
agentInternal: keyof typeof Agents;
isAlive: boolean;
initialArmor: number; // 0, 1, or 2
scoreboardWeaponInternal: keyof typeof WeaponsAndAbilities;
currUltPoints: number;
maxUltPoints: number;
hasSpike: boolean;
money: number;
kills: number;
deaths: number;
assists: number;
}
Sent when the observer client detects scoreboard updates.
Player’s unique identifier (PUUID).
Team ID (0 = attackers at start, 1 = defenders at start).
Internal agent identifier (e.g., “Clay_PC_C” for Raze).
Whether the player is currently alive.
Armor type: 0 = none, 1 = light (25 HP), 2 = heavy (50 HP).
Internal weapon identifier for the best weapon held.
Ultimate points required for this agent.
Whether this player is carrying the spike.
export interface IFormattedKillfeed {
attacker: string;
victim: string;
weaponKillfeedInternal: keyof typeof WeaponsAndAbilities;
headshotKill: boolean;
assists: string[]; // Array of assisting agent internal names
isTeamkill: boolean;
}
Sent when a kill appears in the killfeed.
Name of the player who got the kill.
Name of the player who died.
Internal weapon/ability identifier used for the kill.
Whether the kill was a headshot.
Array of internal agent names that assisted (e.g., [“Jett_PC_C”]).
Whether this was a friendly fire kill.
export interface IFormattedRoster {
name: string;
tagline: string;
startTeam: number;
agentInternal: keyof typeof Agents;
playerId: string;
position: number; // 0-4
locked: boolean;
rank: number;
}
Sent during agent select and when player data updates.
Player’s position in team roster (0-4).
Whether the agent selection is locked.
Player’s competitive rank tier.
export interface IFormattedRoundInfo {
roundPhase: string;
roundNumber: number;
}
Current phase: “LOBBY”, “shopping”, “combat”, “end”, “game_end”.
Current round (1-indexed).
export interface IFormattedScore {
team_0: number;
team_1: number;
}
Rounds won by team 0 (attackers at start).
Rounds won by team 1 (defenders at start).
Authentication Interfaces
IAuthenticationData
export interface IAuthenticationData {
type: DataTypes.AUTH;
clientVersion: string;
obsName: string;
key: string;
groupCode: string;
groupSecret?: string;
leftTeam: AuthTeam;
rightTeam: AuthTeam;
toolsData: ToolsData;
organizationId?: string; // Added by server
isSupporter?: boolean; // Added by server
}
Sent by the observer client to initialize a match.
Version of the observer client.
Authentication key for the organization.
Unique code for this match session.
Secret for reconnecting to existing match.
Configuration for the left team.{
name: string;
tricode: string;
url: string; // Logo URL
attackStart: boolean;
}
Configuration for the right team (same structure as leftTeam).
Tournament info, sponsors, timeouts, and display settings.
IAuxAuthenticationData
export interface IAuxAuthenticationData {
type: DataTypes.AUX_AUTH;
clientVersion: string;
name: string;
matchId: string;
playerId: string;
}
Sent by auxiliary (player) clients to connect to a match.
Auxiliary Event Interfaces
export interface IFormattedAuxiliary {
type: DataTypes.AUX_SCOREBOARD
| DataTypes.AUX_SCOREBOARD_TEAM
| DataTypes.AUX_ABILITIES
| DataTypes.AUX_HEALTH
| DataTypes.AUX_ASTRA_TARGETING
| DataTypes.AUX_CYPHER_CAM;
playerId: string;
matchId: string;
data: IFormattedScoreboard
| IFormattedAuxScoreboardTeam[]
| IFormattedAbilities
| number
| string
| boolean;
}
Base structure for auxiliary client events.
export interface IFormattedAuxScoreboardTeam {
playerId: string;
agentInternal: keyof typeof Agents;
isAlive: boolean;
initialArmor: number;
scoreboardWeaponInternal: keyof typeof WeaponsAndAbilities;
currUltPoints: number;
maxUltPoints: number;
hasSpike: boolean;
money: number;
kills: number;
deaths: number;
assists: number;
}
Scoreboard data for team members (sent as array from auxiliary client).
export interface IFormattedAbilities {
grenade: number; // Q ability charges
ability_1: number; // E ability charges
ability_2: number; // C ability charges
}
Ability charge counts from auxiliary client.
Authenticated Event Wrappers
IAuthedData
export interface IAuthedData {
obsName: string;
groupCode: string;
type: string;
timestamp: number;
data: IFormattedScoreboard
| IFormattedKillfeed
| IFormattedRoster
| IFormattedRoundInfo
| IFormattedScore
| IFormattedAuxiliary
| boolean
| string
| number;
}
Wrapper for all observer events after authentication.
Observer client identifier.
Event type from DataTypes enum.
Unix timestamp in milliseconds.
Event payload (type depends on type field).
IAuthedAuxData
export interface IAuthedAuxData {
playerId: string;
matchId: string;
type: string;
timestamp: number;
data: IFormattedAuxiliary | number | boolean;
}
Wrapper for all auxiliary client events.
Type Guard
export function isAuthedData(data: object): data is IAuthedData | IAuthedAuxData
Type guard to check if an object is authenticated event data.
Example Event Flow
// 1. Observer authenticates
const authEvent: IAuthenticationData = {
type: DataTypes.AUTH,
clientVersion: "1.0.0",
obsName: "Observer1",
key: "org-api-key",
groupCode: "MATCH123",
leftTeam: { name: "Team A", tricode: "TMA", url: "", attackStart: true },
rightTeam: { name: "Team B", tricode: "TMB", url: "", attackStart: false },
toolsData: new ToolsData()
};
// 2. Match starts
const matchStartEvent: IAuthedData = {
obsName: "Observer1",
groupCode: "MATCH123",
type: DataTypes.MATCH_START,
timestamp: Date.now(),
data: "match-uuid-456"
};
// 3. Scoreboard update
const scoreboardEvent: IAuthedData = {
obsName: "Observer1",
groupCode: "MATCH123",
type: DataTypes.SCOREBOARD,
timestamp: Date.now(),
data: {
name: "Player1",
tagline: "NA1",
playerId: "player-uuid-1",
startTeam: 0,
agentInternal: "Jett_PC_C",
isAlive: true,
initialArmor: 2,
scoreboardWeaponInternal: "vandal",
currUltPoints: 5,
maxUltPoints: 7,
hasSpike: false,
money: 3200,
kills: 10,
deaths: 7,
assists: 4
}
};
// 4. Auxiliary client sends abilities
const abilitiesEvent: IAuthedAuxData = {
playerId: "player-uuid-1",
matchId: "match-uuid-456",
type: DataTypes.AUX_ABILITIES,
timestamp: Date.now(),
data: {
type: DataTypes.AUX_ABILITIES,
playerId: "player-uuid-1",
matchId: "match-uuid-456",
data: {
grenade: 1,
ability_1: 2,
ability_2: 1
}
}
};