Skip to content

Player Statistics Plugin

Plugin

This feature is provided by the Empostor.Plugins.PlayerStats plugin (cn.hayashiume.playerstats). It must be installed and enabled for this to work.

Overview

The Player Statistics plugin tracks persistent per-player game statistics across sessions. Stats are keyed by friend code and survive server restarts when file persistence is enabled.

In-Game Command

#stat (aliases: #stats, #mystats)

View your personal statistics. The response is sent as a private message.

Tracked Metrics:

StatDescription
Games PlayedTotal games participated in
WinsGames won as crewmate
LossesGames lost as crewmate
Impostor WinsGames won as impostor
KillsTotal kills performed
DeathsTotal times killed
Tasks CompletedTotal tasks completed
Times ExiledTotal times voted out

Configuration

Configuration is stored in [Empostor.Plugins.PlayerStats]Config.json:

json
{
  "Enabled": false,
  "PersistToFile": true
}
SettingTypeDefaultDescription
EnabledboolfalseWhether stat recording is active
PersistToFilebooltrueWhether to persist stats to disk

When disabled, events are ignored and no stats are recorded.

Admin Panel

The statistics tab in the admin panel provides:

  • Enable/Disable toggle for stat recording
  • Reset All Stats button (danger action, requires confirmation)
  • Data table showing per-player stats sorted by games played

Columns: Friend Code, Name, Games, Wins, Losses, Imp. Wins, Kills, Deaths, Tasks, Exiled

API Endpoints

MethodPathDescription
GET/api/admin/player/statsReturns all player stats sorted by games played
GET/api/admin/player/stats/{friendCode}Returns stats for a single player
POST/api/admin/player/stats/resetClears all player statistics (requires auth)

Storage

Stats are persisted to Data/player_stats.json when PersistToFile is true.