> ## Documentation Index
> Fetch the complete documentation index at: https://docs-ts.playservices.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Tournament Types Overview

> Understanding the different tournament formats supported by the Tournament Platform

# Tournament Types

The Tournament Platform supports two distinct tournament formats, each optimized for different gameplay scenarios and user experiences. Both formats share common functionality for player management, gameplay, and results processing, but differ in their creation and start logic.

## Format Comparison

<table>
  <thead>
    <tr>
      <th>Feature</th>
      <th>Scheduled Tournaments</th>
      <th>Hop-On/Off Tournaments</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**Creation**</td>
      <td>Casino System creates via external API</td>
      <td>Game Platform creates on-demand via internal API</td>
    </tr>

    <tr>
      <td>**Start Trigger**</td>
      <td>Specific scheduled time</td>
      <td>Minimum player count reached</td>
    </tr>

    <tr>
      <td>**Registration**</td>
      <td>Pre-registration before start time</td>
      <td>Lobby-based, then buy-in via Casino System</td>
    </tr>

    <tr>
      <td>**Player Flow**</td>
      <td>Standard registration → wait → tournament starts</td>
      <td>Join lobby → buy-in → tournament starts when threshold met</td>
    </tr>

    <tr>
      <td>**Late Joiners**</td>
      <td>Registration closes at scheduled time</td>
      <td>Creates new tournament automatically</td>
    </tr>

    <tr>
      <td>**Refunds**</td>
      <td>Standard tournament cancellation policy</td>
      <td>Full refunds if player leaves before start</td>
    </tr>
  </tbody>
</table>

## Common Shared Functionality

Both tournament types utilize identical systems for:

<Columns cols={2}>
  <Card title="Player Registration & Authentication" icon="user-plus" href="/casino-integration/player-management">
    JWT token generation, player validation, and session management.
  </Card>

  <Card title="Game Platform Configuration" icon="gear" href="/game-platform-integration/internal-apis">
    Tournament config delivery and status synchronization.
  </Card>

  <Card title="Real-time Gameplay" icon="bolt" href="/game-platform-integration/real-time-communication">
    Room connections, postMessage events, and SQS reporting.
  </Card>

  <Card title="Tournament Completion" icon="trophy" href="/casino-integration/results-leaderboards">
    Results calculation, prize distribution, and cleanup.
  </Card>
</Columns>

## Tournament Lifecycle

### Shared Components (Both Formats)

1. **Player Registration & Authentication** → Standard external APIs for player management
2. **Game Platform Configuration Exchange** → Internal APIs for game setup and status
3. **Tournament Gameplay & Event Reporting** → SQS events and postMessage communication
4. **Player Management** → Rebuy and player leaving functionality
5. **Tournament Completion** → Result calculation and cleanup

### Format-Specific Components

<Tabs>
  <Tab title="Scheduled Tournaments">
    **Format-Specific Flow:**

    1. **Casino System** creates tournament with specific `startTime`
    2. **Tournament System** schedules start job or starts immediately
    3. **Players** register in advance using standard APIs
    4. **Tournament** starts automatically at scheduled time
    5. **Shared gameplay flow** takes over from this point

    **Best for:** Planned events, marketing campaigns, fixed-time competitions
  </Tab>

  <Tab title="Hop-On/Off Tournaments">
    **Format-Specific Flow:**

    1. **Game Platform** creates tournament when first player joins lobby
    2. **Players** join lobby, then buy-in through Casino System
    3. **Tournament** starts when minimum player count reached
    4. **Late joiners** automatically placed in next tournament
    5. **Shared gameplay flow** takes over from this point

    **Best for:** Continuous availability, instant gratification, casual play
  </Tab>
</Tabs>

## Integration Architecture

<Info>
  The Tournament Platform uses a **shared common flow architecture** to eliminate code duplication while supporting format-specific requirements.
</Info>

### Communication Patterns

* **Casino System ↔ Tournament System**: Standard external APIs with operator authentication
* **Tournament System ↔ Game Platform**: Internal APIs for configuration and control
* **Game Platform ↔ Casino UI**: postMessage events for real-time updates
* **Tournament System → Casino System**: SQS events for notifications

## API Usage by Format

### Scheduled Tournaments

* **Creation**: `POST /api/tournaments` (Casino System)
* **Start Logic**: Time-based automatic start
* **APIs**: 100% existing external API endpoints

### Hop-On/Off Tournaments

* **Creation**: `POST /internal/tournaments` (Game Platform)
* **Start Logic**: Player-count based automatic start
* **New APIs**: Tournament creation and refund logic
* **Shared APIs**: All gameplay, events, and management

## Next Steps

<CardGroup cols={2}>
  <Card title="Scheduled Tournaments" icon="calendar" href="/tournament-types/scheduled-tournaments">
    Detailed flow for time-based tournament format.
  </Card>

  <Card title="Hop-On/Off Tournaments" icon="users" href="/tournament-types/hop-on-off-tournaments">
    Detailed flow for player-count based tournament format.
  </Card>
</CardGroup>
