A C# framework for Source 2 servers.
Build modern Counter-Strike 2 plugins with the full power of .NET - hot reload, async/await, and native engine access. No wrappers, no compromises.
~/plugins $ dotnet new install SwiftlyS2.CS2.PluginTemplate
Success: SwiftlyS2.CS2.PluginTemplate installed.
~/plugins $ dotnet new swplugin -n "TestPlugin" --PluginAuthor "Anonymous"
The template "SwiftlyS2 CS2 Plugin" was created successfully.
~/plugins/TestPlugin $ dotnet publish
Build succeeded → build/publish/TestPlugin.dll
~/plugins/TestPlugin $ ▌
Why SwiftlyS2
Memory-safe by design
Managed abstractions over the raw Source 2 SDK prevent the memory leaks and crashes common in native modding.
Hybrid C++/C# core
A C++ core with a managed C# layer - plugin code calls straight into natives without leaving C#.
Full C# plugin API
Write plugins in modern C# with typed access to entities, cvars, events and more.
Community-driven
Open-source under GPLv3, built in the open with contributions from the CS2 server community.
Console & chat commands
CoreRegister console commands, chat commands, and hook client command execution with typed argument parsing.
CVar management
CoreFind or create typed console variables with change callbacks.
Entity system
CoreQuery and manipulate entities, read keyvalues, and hook entity inputs and outputs.
Source 2 internals
CoreDirect access to server info, the global variables struct, and map validation.
Game data & signatures
CoreResolve engine offsets and signatures declared in signatures.jsonc gamedata files.
Match state
CoreRead and control live match data and the current game phase.
Player management
CoreQuery online status, player counts, and server capacity.
Permissions
CoreCheck wildcard-capable player permissions like admin.*.
Translations & localization
CoreServe per-player localized strings through the built-in translation service.
Timers & scheduling
CoreQueue next-tick callbacks and delayed or repeating tasks off the game loop.
Performance profiling
CoreStart and stop named profiling recordings to find hot paths in your plugin.
Collision tracing
CoreRun engine hull and ray collision traces with custom filters.
Hot reload
CorePlugins are told when they've been hot-reloaded so state can survive a reload.
Memory manipulation
HooksResolve addresses by signature, vtable, or interface name, then call or hook them directly.
Engine & entity hooks
HooksHook controller, weapon, movement, pawn, entity, and datamap calls directly.
Game event hooks
HooksHook pre and post native game events with typed event objects.
Tick & world hooks
HooksSubscribe to per-tick and world-update callbacks, hibernation-aware.
Protobuf networking
NetworkingHook and exchange fully typed protobuf network messages, both ways.
String tables
NetworkingFind and inspect Source 2 network string tables by name or ID.
Database connections
DatabaseNamed MySQL, PostgreSQL, and SQLite connections resolved centrally and shared across plugins.
Menu system
MenusBuilder-pattern menus with configurable navigation, input mode, and buttons.
Audio playback
MediaCreate and play native sound events for connected clients.
Top creators
Frequently asked questions
Yes. The C++ core is licensed under GPLv3 and the full source is on GitHub - you can read it and build it yourself.
No. The GPLv3 license carries an explicit MIT exception for derivative works - your plugins, or anything built against the published .NET packages, can stay closed-source or commercial.
C#, using the official dotnet templates (dotnet new swplugin). The framework's core is C++, but plugin code never has to touch it directly.
Counter-Strike 2 today. The core is built engine-first for Source 2 more broadly, but CS2 is the only shipped target right now.
No. It's a server-side scripting framework - players connect and play normally, no client-side installation required.
Yes - plugins are told when they've been hot-reloaded, so they can restore state on the fly with no server restart.
No. SwiftlyS2 is an independent project built by Swiftly Labs and is not affiliated with, endorsed, or sponsored by Valve Corporation.
Join the Discord community for day-to-day help, or open an issue on GitHub for bugs and feature requests.
Build your first plugin
Write it in C#, run it against the real C++ core. Every capability above is one import away.