SwiftlyS2 is a powerful scripting framework for Source 2 games, built in C++ with C# plugin support. It provides developers with a comprehensive API to create plugins and extensions for Source 2-based games like Counter-Strike 2.
Warning
The framework is still under development.
- C# Plugin Development: Write plugins in C# with full .NET support
- Comprehensive API: Access to game events, player management, and server control
- High Performance: Native C++ core with optimized plugin execution
- Memory Safety: Built-in memory management and thread-safe operations
- Hot Reload: Reload plugins without restarting the server
- Cross-Platform: Supports Windows and Linux
- Source 2 Ready: Designed specifically for Source 2 engine games
- Counter-Strike 2
- Windows: Visual Studio 2022 with C++ and .NET workloads
- Linux: GCC 11+ and .NET 8.0 SDK
- XMake
-
Clone the repository
git clone --recurse-submodules https://github.com/swiftly-solution/swiftlys2.git cd swiftlys2
-
Build the framework
# Windows xmake -j 4 # Linux xmake -j $(nproc)
-
Install to game directory
# Copy built files to your CS2 server cp -r build/package/* /path/to/cs2/game/csgo/
-
Start your server
Create a simple "Hello World" plugin:
using Microsoft.Extensions.DependencyInjection;
using SwiftlyS2.Shared.Plugins;
using SwiftlyS2.Shared;
namespace SwiftlyS2.Plugin;
public partial class PluginClassName : BasePlugin {
public PluginClassName(ISwiftlyCore core): base(core) {
}
public override void ConfigureSharedServices(IServiceCollection sharedServices) {
}
public override void UseSharedServices(IServiceProvider sharedProvider) {
}
public override void Load(bool hotReload)
{
Console.WriteLine("Hello World!!");
// Check examples folder for more information. Don't forget to delete the folder after reading.
}
public override void Unload() {
}
}
SwiftlyS2/
├── src/ # C++ core framework
│ ├── api/ # C++ API interfaces
│ ├── core/ # Core framework logic
│ ├── engine/ # Source 2 engine integration
│ ├── memory/ # Memory management
│ ├── monitor/ # Loggers
│ ├── network/ # Network handling
│ ├── scripting/ # Native Exports
│ ├── sdk/ # SDK Dumper
│ └── server/ # Server management
├── managed/ # C# managed layer
│ └── src/ # C++ core framework
│ ├── api/ # C++ API interfaces
│ ├── SwiftlyS2.Core/ # Core C# APIs
│ ├── SwiftlyS2.Generated/ # Generated bindings
│ └── SwiftlyS2.Shared/ # Shared utilities
├── natives/ # Native definitions
├── generator/ # Code generation tools
└── vendor/ # Third-party dependencies
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
- Discord: Join our community
- Issues: Report bugs and request features
- Metamod:Source - Plugin architecture inspiration
- HL2SDK - Source engine integration
- All our contributors
Made with ❤️ by the Swiftly Development team