Skip to content

Repository files navigation

Server Analytics

License PHP Pelican

Real-time analytics for your Pelican Panel game servers: live player count and player lists, player activity charts, peak statistics, a player leaderboard, map popularity tracking — plus kick/ban/map-change admin actions right from the panel, all backed by snapshot history stored in the database.

Tested against GoldSrc / Source-engine servers (Counter-Strike 1.6, CS:S, CS2). Minecraft, Bedrock, CitizenFX and Palworld query protocols are included best-effort — see Game support below.

Screenshots

The Players page in the server sidebar (live player list with score and time for Source/GoldSrc, online status, kick/ban actions):

Players page

The Maps page (play counts, first/last seen dates, optional map change):

Maps page

Analytics widgets on the server overview: peak stats, player activity chart, top players and map popularity:

Analytics charts

Server status / players widget shown above the console:

Server status and players widget

Plugin settings in the admin panel, under Admin Area → Plugins → Settings:

Admin plugin settings 1 Admin plugin settings 2

Features

  • Live server querying — real-time hostname, player count and map for every linked game server via its native query protocol.
  • Players page — live player list with per-player information:
    • Source / GoldSrc: name, score and connection time; one-click kick and ban right from the panel.
    • Minecraft (Java): player avatar (Cravatar), online status, plus kick/ban/whitelist/OP management through the panel console.
  • Maps page — how often each map is played, first/last seen, and an optional change map action.
  • Player activity chart — player count over time (1 / 7 / 14 / 30 day), snapshot-based.
  • Peak statistics — peak today, peak this week, peak all-time and average players over the last 7 days.
  • Top players leaderboard — top 5 by score on Source/GoldSrc servers.
  • Map popularity doughnut — most-played maps.
  • Snapshot history — player count is sampled on a schedule and stored, so charts and peaks work even while servers are offline later. Old snapshots are cleaned up automatically after a configurable retention period.
  • Admin Game Queries resource — inspect and manage query types, link query protocols to eggs, and configure query port offsets / variables.
  • Client APIGET /api/client/servers/{server}/query and GET /api/client/servers/{server}/query/players endpoints (rate-limited).
  • Fully configurable from the admin panel (see Configuration).

Game support

Protocol Engine Status
GoldSrc CS 1.6 and other GoldSrc games Tested
Source CS:S, CS2, Squad, Barotrauma, Valheim, V-Rising, ARK, Unturned, Arma 3 and more Tested
Minecraft (Java) Vanilla / Spigot / Paper et al. Included, best-effort
Minecraft (Bedrock) Bedrock dedicated servers Included, best-effort
CitizenFX FiveM / RedM Included, best-effort
Palworld Dedicated (REST API) Included, best-effort

We test against Counter-Strike (GoldSrc / Source) servers. The other query protocols ship with the plugin but are not verified by us; please report issues on the issue tracker.

Requirements

  • Pelican Panel (current release)
  • PHP 8.2+
  • A queue worker is not required

Installation

  1. Download the release ZIP from the Releases page and unpack it into <panel>/plugins/server-analytics/ (folder name must match the id in plugin.json), or use the Import button in Admin Area → Plugins.
  2. Run php artisan p:plugin:install and select the plugin.
  3. Run php artisan db:seed --class=ServerAnalyticsSeeder once to auto-link known game eggs to their query protocol (optional but recommended).
  4. The database migrations create the analytics tables automatically. The plugin's composer dependencies are installed during panel startup.

Setup for game servers

Make sure the server's allocation has a public IP. If you use local IPs you can put the public IP into the allocation alias and enable "Use allocation alias?" in the plugin settings. Domains, 0.0.0.0 and :: are not supported.

Link a server's egg to a query type in Admin Area → Game Queries: create or edit a game query, pick the protocol that matches the game, and attach the egg. For games that reply on a different port than the allocation you can set a port offset (e.g. +1) or select a startup variable that holds the query port. The seeder already links common eggs — verify the mapping if a server shows "Unknown".

Game-specific notes:

  • Minecraft (Java): prefers the query protocol (set enable-query=true and the query.port in server.properties) and falls back to server listing ping when query is disabled.
  • Bedrock: uses the Minecraft Bedrock query protocol.
  • Palworld: requires RESTAPIEnabled=true, the REST API port set to the server port, and an ADMIN_PASSWORD startup variable.
  • Source/GoldSrc: queried via the standard Source/A2S protocol.

Scheduler

The plugin registers its commands with Laravel's scheduler, so only the standard panel cron entry is needed:

* * * * * php /var/www/pelican/artisan schedule:run >> /dev/null 2>&1
  • server-analytics:collect --all — queries every linked server and stores a snapshot. Runs every SERVER_ANALYTICS_COLLECT_INTERVAL minutes. Can also be run for a single server: php artisan server-analytics:collect <server_id>
  • server-analytics:cleanup — deletes snapshots older than the retention period. Runs daily.

Configuration

These values live in .env (or set them via the plugin's Settings page):

SERVER_ANALYTICS_USE_ALIAS=false                 # use allocation alias instead of IP
SERVER_ANALYTICS_COLLECT_INTERVAL=5             # snapshot interval in minutes (1-60)
SERVER_ANALYTICS_CHART_DAYS=7                   # default chart range: 1, 7, 14 or 30
SERVER_ANALYTICS_ENABLE_KICK=true               # show kick actions
SERVER_ANALYTICS_ENABLE_BAN=true                # show ban actions
SERVER_ANALYTICS_ENABLE_MAP_CHANGE=false        # show change-map action
SERVER_ANALYTICS_ENABLE_LEADERBOARD=true        # show top players chart
SERVER_ANALYTICS_ENABLE_MAP_TRACKING=true       # track/display map statistics
SERVER_ANALYTICS_SNAPSHOT_RETENTION_DAYS=30     # snapshot retention (1-365)

Client API

Authenticated panel client API endpoints (rate-limited per server):

Endpoint Description
GET /api/client/servers/{server}/query Query info: hostname, map, current/max players (no player list)
GET /api/client/servers/{server}/query/players Array of online player names

Development

Set PANEL_PLUGIN_DEV_MODE=true in .env to get real error logs instead of a generic errored plugin state, then watch storage/logs/laravel.log. Clear caches after changes:

php artisan optimize:clear

Run the lint and style checks before contributing:

find . -name '*.php' -exec php -l {} \;
./vendor/bin/pint

Uninstall

Admin Area → Plugins → Uninstall. The analytics tables are removed by the migration rollback.

Credits

This plugin is a fork of Player Counter by Boy132, extended with snapshot-based analytics (activity charts, peak stats, player leaderboard and map tracking), a Maps page, an admin Game Queries resource and a client API. It is released under the original project's GPL-3.0 license.

Support

Found a bug or want a feature? Open an issue on the issue tracker.

License

GPL-3.0 © Abdulrahman Othman — original by Boy132.

About

Server Analytics - Pelican panel plugin (fork of Player Counter by Boy132). Real-time server analytics, player tracking, leaderboards, charts, map tracking and admin tools.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages