export type GameContext = {
  streamerId: number;
  channelId: number;
  kickChannelId: string;
  kickChatroomId: string;
  gameSessionId: number;
};

export const gameScopeKey = (context: GameContext): string =>
  `${context.channelId}:${context.gameSessionId}`;

export const assertSameGameScope = (expected: GameContext, received: GameContext): void => {
  if (gameScopeKey(expected) !== gameScopeKey(received) || expected.kickChannelId !== received.kickChannelId) {
    throw new Error("Événement de jeu hors contexte refusé.");
  }
};

