Skip to content

ENHANCEMENTS: - RestAPI: add attendance PlayerCards mode - #154

Open
Penfold-88 wants to merge 1 commit into
Special-K-s-Flightsim-Bots:developmentfrom
Penfold-88:feat/server-attendance-player-cards
Open

ENHANCEMENTS: - RestAPI: add attendance PlayerCards mode#154
Penfold-88 wants to merge 1 commit into
Special-K-s-Flightsim-Bots:developmentfrom
Penfold-88:feat/server-attendance-player-cards

Conversation

@Penfold-88

Copy link
Copy Markdown

Description

Adds an optimized PlayerCards mode to the /server_attendance REST API endpoint.

Global attendance

GET /server_attendance?PlayerCards=true

Server-specific attendance

GET /server_attendance?server_name=SERVER_NAME&PlayerCards=true

The response contains only the values required by the dashboard’s attendance cards:

{
  "current_players": 0,
  "unique_players_24h": 4,
  "unique_players_7d": 28,
  "unique_players_30d": 62
}

Performance

PlayerCards mode uses one count-only database query. It avoids calculating unnecessary:

  • Playtime statistics
  • Discord engagement
  • Daily trends
  • Top theatres
  • Top missions
  • Top modules
  • Combat statistics

Backward Compatibility

  • Omitting PlayerCards preserves the existing comprehensive response.
  • PlayerCards=false preserves the existing comprehensive response.
  • Global and server-specific filtering continue to work.
  • Instance aliases and full DCS server names continue using the existing resolution logic.
  • Existing integrations require no changes.

Testing

Tested against a running DCSServerBot instance:

  • Global PlayerCards=true: HTTP 200 with exactly four fields.
  • Server-specific PlayerCards=true: HTTP 200 with correctly filtered data.
  • PlayerCards=false: HTTP 200 with the original 19-field response.
  • Parameter omitted: HTTP 200 with the original 19-field response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant