swiftlys2/docs/api/releases/features/ai/

Feature Reference

Everything SwiftlyS2 gives a plugin, with code for each area. The recent changes list is pulled from the latest stable release.

7,500+
generated schema files
1,600+
protobuf message types
550+
typed game event files
30
bundled translations
66
signatures in gamedata
320+
fix commits to v1.5.0
Loading recent changes...

Plugin framework

How plugins are built, loaded, configured and wired together.

Plugin lifecycle & hot reload

Plugins are plain C# classes that derive from BasePlugin. The framework hands each one an ISwiftlyCore with every service attached.

Shared interfaces between plugins

Plugins can publish an interface under a string key and consume interfaces from other plugins without referencing their assemblies at runtime.

Configuration & dependency injection

Typed configuration files in JSONC or TOML, created from your model on first run and live-reloaded when edited.

Threading & async

Game state is only safe on the game thread. The API gives you an async twin for most calls so you can await without blocking the server.

Gameplay APIs

Talk to players, entities and the match.

Commands

Console and chat commands from a single attribute, with aliases, permissions and prefix handling.

Typed game events

Every native game event has a generated class with typed fields, so there are no string keys or casts.

Engine events

Framework-level events for the server, clients and entities, as C# events or attributes.

Players & messaging

A rich IPlayer wrapper plus a player manager for queries, targeting and broadcasting.

Entity system & schemas

Create, query, mutate and hook any entity through generated, typed schema classes.

Native game hooks

Pre and post hooks on engine functions, with mutable parameter structs.

Collision tracing

Ray, hull and player-bounds traces through the engine with a fluent builder and an entity filter callback.

Scheduler & timers

Tick-based and wall-clock timers that you can cancel, plus helpers to run work on the next tick or world update.

Sound events

Create and emit native sound events to chosen recipients.

Engine access

Reach below the managed API when you need to.

Memory, signatures & native hooks

Find functions by signature, vtable or interface name, then call or hook them with a managed delegate.

Gamedata: signatures, offsets & patches

Engine addresses live in JSONC files, per platform, so a game update is a data change rather than a rebuild.

Protobuf net messages

Send, receive and rewrite the game's network messages with generated, typed protobuf classes.

String tables

Find and edit Source 2 network string tables by name or id.

ConVars

Typed console variables: find, create, replicate and watch.

Native extensions

Load C++ extensions at runtime and share raw pointers between extensions and managed code.

Steamworks

Generated Steamworks bindings with a callback dispatcher, ready once the Steam API activates.

Data, access & localization

Storage, permissions and languages.

Database connections

Connections are named once in database.jsonc and shared by every plugin, so credentials live in one place.

Permissions

Per-player permissions with groups, inheritance and wildcards, usable straight from command attributes.

Translations & localization

Per-player languages, 30 bundled core translations and a localizer you can index like a dictionary.

Operations & tooling

Everything around running and building on a server.

Profiler

Record named sections from your plugin and capture .NET EventPipe traces, then turn them into a readable summary.

Server configuration

One core.jsonc controls logging, prefixes, menus, Steam auth and crash handling.

The sw console command

Manage the framework from the server console.

Templates, packages & builds

Start a plugin in a minute and build the core yourself.

Fixes

Server List Fix

Fills the server name and score back into the server list.

Preload DLL

Removes the need for -DoNotPreloadDLLs at CS2 server startup on Windows.

HammerID patch

Lets developers see the HammerID schema field.

FileSystem Fix

Restores the default writer's filesystem output path to the game one.