This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
IW4MAdmin is a game server administration tool for Call of Duty dedicated servers (IW4x, IW6x, Pluto T6/IW5, CoD4x, TeknoMW3, etc.). It monitors server activity, manages players (bans/kicks/warnings), tracks stats, and provides a web interface for administration.
# Restore packages
dotnet restore IW4MAdmin.sln
# Build the full solution (Debug)
dotnet build IW4MAdmin.sln
# Build the main application
dotnet build Application/Application.csproj
# Build a specific plugin
dotnet build Plugins/Stats/Stats.csproj
# Publish the application (Prerelease config used in CI)
dotnet publish Application/Application.csproj -c Prerelease -o Publish/Prerelease
# Build all plugins (from repo root)
find Plugins -name "*.csproj" -exec dotnet publish {} -c Debug -o BUILD/Plugins \;Build configurations: Debug, Release, Prerelease. Target framework: net10.0.
In Debug mode, a PreBuild PowerShell script runs and PluginDebugReference is included (it aggregates all plugin projects for easier debugging).
The web frontend requires additional steps beyond dotnet build:
- Tailwind CSS:
tailwindcss -i wwwroot/css/src/app.css -o wwwroot/css/app.css --minify(run from WebfrontCore/) - SCSS: Compiled via
Excubo.WebCompiler(webcompiler -r WebfrontCore/wwwroot/css/src -o WebfrontCore/wwwroot/css/) - JS bundling: Uses
dotnet-bundlewithWebfrontCore/bundleconfig.json - Phosphor icon fonts: CSS paths are patched post-build (see CI workflow)
Tests are in Tests/ApplicationTests/ but are not included in the solution file. They use NUnit with FakeItEasy/Moq and FluentAssertions. Test fixtures and mock data are in Tests/ApplicationTests/Fixtures/ and Tests/ApplicationTests/Mocks/.
EF Core 9.0 with three supported providers (each has its own migration context in Data/MigrationContext/):
- SQLite — default,
SqliteDatabaseContext - PostgreSQL —
PostgresqlDatabaseContext(via Npgsql) - MySQL —
MySqlDatabaseContext(via Pomelo)
Migrations live in Data/Migrations/{Sqlite,Postgresql,MySql}/. When adding a migration, you must add it for each provider using the corresponding context class.
Application (entry point, console host)
├── SharedLibraryCore (interfaces, models, commands, base classes)
│ └── Data (EF Core contexts, entities, migrations)
├── WebfrontCore (Blazor Server UI, API controllers)
│ └── WebCommon (shared Blazor UI components)
├── Integrations.Cod (Call of Duty RCon protocol, game parsers)
├── Integrations.Source (Source engine integration)
└── Plugins/* (compiled plugins, loaded dynamically)
ApplicationManager (Application/ApplicationManager.cs): Central orchestrator. Manages game server instances, dispatches events, coordinates command execution, and manages plugin lifecycles.
Event System: Event-driven via IGameServerEventSubscriptions, IManagementEventSubscriptions, and IGameEventSubscriptions. Game servers emit events (player connects, chat messages, kills) which are processed by handlers and plugins.
Plugin System — two generations:
- IPluginV2 (modern): Registers DI dependencies via
RegisterDependencies(IServiceCollection), subscribes to events. Used by Stats, Mute, etc. - IPlugin (legacy): Older interface, still supported.
- Script plugins: JavaScript (via Jint engine) and C# scripts in
Plugins/ScriptPlugins/. These are the game-specific parser plugins (e.g.,ParserIW4x.js,ParserPlutoniumT6.js).
Plugin DLLs are loaded dynamically at runtime by Application/Plugin/PluginImporter.cs.
Command System: Commands extend SharedLibraryCore.Command. Built-in commands in Application/Commands/ and SharedLibraryCore/Commands/. Commands are permission-gated by EFClient.Permission level.
Web Layer: ASP.NET Core with Blazor Server. Components in WebfrontCore/Components/. REST API controllers in WebfrontCore/Controllers/API/. Auth uses cookies + JWT + optional TOTP 2FA. Real-time updates via SignalR.
RCon Communication: Game servers are controlled via Remote Console (RCon) protocol. Parsers in Application/RConParsers/ handle game-specific response formats. Integrations.Cod implements the CoD-specific RCon wire protocol.
EFClient— game playersEFAlias/EFAliasLink— player name/IP historyEFPenalty— bans, kicks, warnings, mutesEFServer— game server metadataEFClientKill/EFClientMessage— stats trackingEFMeta/EFChangeHistory— metadata and audit trail
Multi-language support (en-US, ru-RU, es-EC, pt-BR, de-DE). Translation files are downloaded at build time to Localization/ directory.