API Reference
Every public type in DeadworksManaged.Api, generated from the Deadworks source at commit 76f73b5. Each member lists its signature and a link to its source. If you're new to Deadworks, start with the Features pages instead; they show how to do common things.
Plugin
| Type | Description |
|---|---|
Chat | Helpers for sending chat messages to players. |
ContentAddons | The content addons connecting clients are told to download. The active list is the server config's serverbrowser.content_addons merged with whatever every loaded plugin declares through IDeadworksPlugin.ContentAddons, de-duplicated and kept in that order. Declaring an addon from a plugin means it no longer has to be listed in the server config ahead of time - loading the plugin is enough. |
DeadworksPluginBase | Optional base class for plugins. Provides direct access to ITimer via a Timer property without needing interface casts or using aliases. |
GameRules | Provides access to CCitadelGameRules data. Automatically resolved when the citadel_gamerules proxy entity is created/destroyed. |
GlobalVars | Provides access to CGlobalVars (engine global variables such as curtime, tickcount, etc.). |
ItemInfo | Lookups against item definitions by internal name (e.g. "upgrade_echo_shard"). These read the item's VData, so they work before the item has ever been granted. |
KeyValues3 | Wraps a native KeyValues3 handle. Create with new KeyValues3(), set typed members, pass to CBaseEntity.AddModifier, then dispose. Must be disposed explicitly - no finalizer (unsafe to call native from GC thread). |
PlayerCamera | Moves a player's camera without moving their hero: pull it back, zoom, point it somewhere else and hold it there. Get one from CCitadelPlayerController.Camera. |
Precache | Resource precaching. Call AddResource during IDeadworksPlugin.OnPrecacheResources to ensure particles, models, and other resources are loaded before use. |
Server | Server-side utilities for sending commands to player clients. |
Entities
| Type | Description |
|---|---|
AbilityResource | |
CallbackHandle | A generic handle that invokes a cancellation callback when cancelled. |
CBaseEntity | Base managed wrapper for all Source 2 entities. Provides common operations: health, team, lifecycle, modifiers, schema access. |
CBaseModifier | Wraps a native CBaseModifier instance - a buff/debuff applied to an entity via CBaseEntity.AddModifier. |
CBasePlayerController | Base player controller entity. Manages the link between a player slot and their pawn. |
CBasePlayerPawn | Base player pawn entity. Provides access to the owning controller. |
CBeam | A glowing line between two points in the world that every player can see. Create one with Create, or a whole box or path at once with CreateBox and CreatePolyline. |
CBodyComponent | Body component attached to an entity, providing access to the CGameSceneNode and world position. |
CCitadel_Ability_Dash | Dash ability entity tracking consecutive air/down dash counters for a hero. |
CCitadel_Ability_Jump | Jump ability entity tracking air jump/wall jump counters for a hero. |
CCitadelAbilityComponent | Ability component on a player pawn. Provides access to stamina/ability resources and the list of equipped abilities. |
CCitadelBaseAbility | Base class for all Deadlock abilities (hero abilities, items, innates, etc.). |
CCitadelHeroComponent | Hero component on a player pawn. Exposes the inline spawn data for the current hero. |
CCitadelModifierVData | Wraps a native CCitadelModifierVData instance - Citadel-specific modifier VData with extended properties. |
CCitadelPlayerController | Deadlock-specific player controller. Provides access to player data, hero selection, team changes, and console messaging. |
CCitadelPlayerPawn | Deadlock hero pawn. The in-game physical representation of a player. Provides currency, abilities, movement state, stamina, and eye angles. |
CCollisionProperty | An entity's bounds and collision settings: what it collides with, what traces hit it, and its physics shape. Get it with CBaseEntity.Collision. |
CEntityKeyValues | Wraps a native CEntityKeyValues handle. Create with new CEntityKeyValues(), set typed members, pass to CBaseEntity.Spawn. The engine takes ownership of the underlying allocation - do not dispose manually. |
CEntitySubclassVDataBase | Wraps CEntitySubclassVDataBase - the VData subclass pointer stored on an entity, providing its design-time name. |
CGameSceneNode | Scene graph node that holds the entity's world transform and absolute origin. |
CitadelHeroData | Wrapper around native CitadelHeroData_t (VData). Obtain via HeroType.GetHeroData(). |
CitadelHeroSpawnData | Wraps CitadelHeroSpawnData_t - per-spawn hero state including the resolved hero ID. |
CModifierProperty | Wraps CModifierProperty - manages modifier state bits on an entity. Uses CNetworkVarChainer to chain network notifications to the owning entity. |
CModifierVData | Wraps a native CModifierVData instance - base VData for all modifier types. |
CParticleSystem | Represents a live info_particle_system entity. Obtain instances via Builder.Spawn. |
CParticleSystem.Builder | Fluent builder for spawning a CParticleSystem entity. |
CPlayer_ObserverServices | Observer/spectator state component on a CBasePlayerPawn. |
CPointWorldText | Wraps the point_worldtext entity - a world-space text panel rendered in 3D. |
CTakeDamageInfo | Wraps the native CTakeDamageInfo damage descriptor. Can be owned (created via constructor, must be Disposed) or non-owning (obtained from an OnTakeDamage hook). Exposes attacker, inflictor, ability, damage amount, type, and flags. |
Entities | Queries over the server's entity list. |
EntityData<T> | Dictionary-like store that associates arbitrary per-entity data with entities by their handle. Automatically removes entries when an entity is deleted. |
HeroTypeExtensions | Extension methods for converting Heroes enum values to/from hero name strings and fetching VData. |
NativeEntity | Base class for all managed wrappers around native C++ entity/object pointers. |
PlayerDataGlobal | Wraps the networked PlayerDataGlobal_t struct on a player controller - provides read access to stats like kills, gold, level, and damage. |
Players | Static helpers to enumerate all connected player controllers and pawns. |
SchemaAccessor<T> | Reads and writes a single networked schema field of type T. Resolves the field offset once on first access and caches it. Use UTF-8 string literals ("ClassName"u8) for className and fieldName. |
SchemaArrayAccessor<T> | Schema accessor for array-typed fields. Reads/writes at offset + index * sizeof(T). |
SchemaStringAccessor | Write-only schema accessor for CUtlSymbolLarge (string) fields. Calls native SetSchemaString. |
Events
| Type | Description |
|---|---|
AbilityAttemptEvent | Event fired before ability execution each think tick. Set BlockedButtons to prevent specific abilities from being cast. |
AddModifierEvent | Event data for the AddModifier hook. Modify properties and return HookResult.Stop to block or change the modifier application. |
ChatCommandAttribute | Marks a plugin method as a handler for a chat command. Can be applied multiple times. |
ChatCommandContext | Provides context for an invoked chat command, including the originating message, parsed command name, and arguments. |
ChatMessage | Incoming chat message from a player. Passed to IDeadworksPlugin.OnChatMessage. |
CheckTransmitEvent | Fired per-player during CheckTransmit. Use Hide to prevent entities from being networked to this player for the current tick. |
ClientConCommandEvent | Event data passed to IDeadworksPlugin.OnClientConCommand. Contains the controller pointer, command name, and parsed argument array. |
ClientConnectEvent | Fired when a client is connecting to the server. Passed to IDeadworksPlugin.OnClientConnect. |
ClientDisconnectedEvent | Passed to IDeadworksPlugin.OnClientDisconnecting and IDeadworksPlugin.OnClientDisconnect. |
ClientFullConnectEvent | Fired when a client has fully connected and is in-game. Passed to IDeadworksPlugin.OnClientFullConnect. |
ClientPutInServerEvent | Fired when a client is put into the server (initial connection). Passed to IDeadworksPlugin.OnClientPutInServer. |
EntityCreatedEvent | Fired when a new entity is created. Passed to IDeadworksPlugin.OnEntityCreated. |
EntityDeletedEvent | Fired just before an entity is deleted. Passed to IDeadworksPlugin.OnEntityDeleted. |
EntityInputEvent | Payload for an entity input dispatch, passed to handlers registered via EntityIO.HookInput or [EntityInputHook]. |
EntityInputHookAttribute | Marks a method as an entity-input hook. The method is auto-registered on plugin load and dropped on unload. |
EntityIO | Hooks into the Valve entity I/O system to observe or intercept inputs and outputs. Two symmetric APIs: HookInput for CEntityInstance::AcceptInput, HookOutput for CEntityIOOutput::FireOutputInternal. |
EntityIOValue | Typed accessor for the variant value carried by an entity I/O input or output hook. |
EntityOutputEvent | Payload for an entity output fire (CEntityIOOutput::FireOutputInternal), passed to handlers registered via EntityIO.HookOutput or [EntityOutputHook]. |
EntityOutputHookAttribute | Marks a method as an entity-output hook. The method is auto-registered on plugin load and dropped on unload. |
EntitySpawnedEvent | Fired when an entity has been fully spawned. Passed to IDeadworksPlugin.OnEntitySpawned. |
EntityTouchEvent | Fired when two entities start or stop touching. Passed to IDeadworksPlugin.OnEntityStartTouch and IDeadworksPlugin.OnEntityEndTouch. |
GameEvent | Represents a Source 2 game event fired by the engine. Read field values via Get* methods; write via Set* methods. |
GameEventHandler | Delegate type for dynamic game event listener callbacks registered via GameEvents. |
GameEventHandlerAttribute | Marks a method to be auto-registered as a Source 2 game event handler for the named event. |
GameEvents | Static API for registering/removing dynamic Source 2 game event listeners and creating new events. |
GameEventWriter | Wraps a newly created IGameEvent for setting fields and firing. |
HasModifierStateEvent | Event data for the HasModifierState hook. Set Result to override the return value for a specific modifier state, or leave it null to fall through to the original game logic. |
ModifierAbilityEventData | Payload of the ability events. |
ModifierDamageEventData | Payload of the damage events. Properties not carried by the current event return null or 0. |
ModifierEvent | A modifier event (damage taken, ability cast, modifier gained/lost, ...) fired by the game. Passed to IDeadworksPlugin.OnModifierEvent. Observe-only. |
ModifyCurrencyEvent | Event data passed to IDeadworksPlugin.OnModifyCurrency. Contains the pawn, currency type, amount, and source of the change. |
ProcessUsercmdsEvent | Event data passed to IDeadworksPlugin.OnProcessUsercmds. Contains the player slot, parsed usercmd protobuf messages, and timing info. |
TakeDamageEvent | Event data passed to IDeadworksPlugin.OnTakeDamage. Contains the target entity and full damage info. |
Commands
| Type | Description |
|---|---|
CommandAttribute | Registers a method as /name, !name, and dw_name with typed parameter binding. |
CommandConverters | Per-type string parsers for CommandAttribute. Register from OnLoad. |
CommandException | Thrown from a CommandAttribute handler to send Exception.Message to the caller. |
ConVars
| Type | Description |
|---|---|
ConCommandAttribute | Marks a method as a console command handler with signature void Handler(ConCommandContext ctx). |
ConCommandContext | Context passed to [ConCommand] and [ConVar] handlers. |
ConVar | Wraps a Source 2 console variable (cvar). Use Find to look up existing cvars or Create to register new ones. |
ConVarAttribute | Marks a property as a console variable. Supports int, float, bool, and string. Typing the name in console prints the current value; typing with an argument sets it. |
FCVar | Source 2 console variable / console command flags, as the engine's tier0 names them. |
Configuration
| Type | Description |
|---|---|
ConfigExtensions | |
IConfig | |
PluginConfigAttribute |
Timers
| Type | Description |
|---|---|
Duration | Strongly-typed time value that can represent either game ticks or real (wall-clock) time. Created via extension methods: 3.Seconds(), 64.Ticks(), 500.Milliseconds(). |
DurationExtensions | |
IHandle | A handle to a cancellable subscription — returned by timers, game-event listeners, net-message hooks, entity I/O hooks, and any other API that registers a long-lived callback. Allows cancellation and status checking. |
IStep | Sequence step context passed to ITimer.Sequence callbacks. Provides execution count and methods to control pacing. |
ITimer | Per-plugin timer service. Access via this.Timer in any IDeadworksPlugin. |
Networking
| Type | Description |
|---|---|
IncomingMessageContext<T> | Carries a client→server net message along with its sender. Passed to handlers registered via NetMessages.HookIncoming<T>. |
NetMessageDirection | Whether the message is travelling from client→server (Incoming) or server→client (Outgoing). |
NetMessageHandlerAttribute | Marks a method as a handler for one or more net message types. Applied alongside NetMessages.HookIncoming<T> or NetMessages.HookOutgoing<T> registrations. |
NetMessageRegistry | Maps protobuf message types to the network message IDs the engine registered them under. Used internally by the net message send/hook system; also exposes manual registration for custom message types. |
NetMessages | Entry point for sending and hooking Source 2 network messages. Messages are identified by their protobuf type; IDs are resolved via NetMessageRegistry. |
OutgoingMessageContext<T> | Carries a server→client net message along with its destination recipients. Passed to handlers registered via NetMessages.HookOutgoing<T>. |
RecipientFilter | Bitmask of player slots that should receive a net message. Each bit position corresponds to a player slot index. |
Sound
| Type | Description |
|---|---|
SoundEvent | Builds and emits an SOS sound event to clients. |
Sounds | Convenience wrappers for the most common SoundEvent usages. |
UI
| Type | Description |
|---|---|
AddonState | What happened to a runtime addon on one client — see UI.Addon. Loaded and Ready are deliberately separate: a correctly mounted VPK whose script throws reports Loaded and never reaches Ready, and that is exactly the case worth being able to tell apart. |
FlowDirection | Direction of child layout in a UIContainer. Maps to the Panorama flow-children CSS property. |
UI | Entry point for the UI message manager. Use Panel to obtain a handle for a logical UI panel; the panel id binds to the panorama-side panel script registered with the same id via DW.registerPanel({ id: "..." }). A panel stays up until you destroy it, the player leaves, or the map changes. Every panel is gone on a new map, so treat any you were tracking as closed in IDeadworksPlugin.OnStartupServer and show them again as players arrive. |
UIButton | |
UIContainer | |
UIEvent | An event dispatched from the panorama panel back to the server. |
UIImage | |
UILabel | |
UINode | Base type for nodes in a code-driven UI tree. Built via the factories on UI (UI.Vertical, UI.Label, etc.) and shipped to the client by UIPanel.BuildLayout. |
UINodeExtensions | |
UIPanel | Handle for a logical UI panel. Methods enqueue updates onto each recipient's rate-limited queue; the actual subtitles are emitted from the host runtime's per-frame tick. Field updates are coalesced latest-wins per (panel, key). |
UIUpdate | Fluent builder for batching multiple field updates and ops into a single logical send call. Use via UIPanel.Build. |
Tracing
| Type | Description |
|---|---|
BBox_t | Axis-aligned bounding box with min/max corners. |
BoundingBox | Axis-aligned bounding box helpers. |
CapsuleTrace | Shape data for a capsule trace between two center points with a radius. |
CGameTrace | Result of a VPhys2 shape trace. Check DidHit and inspect HitPoint, HitNormal, and HitEntity. |
CollisionFunctionMask_t | Flags controlling which collision callbacks are enabled on a physics object. |
CollisionGroup | Collision group that determines which objects interact with each other in the physics simulation. |
CTraceFilter | Trace filter passed to VPhys2 TraceShape. Embeds a vtable pointer (managed vtable with a destructor and ShouldHitEntity callback) and a RnQueryShapeAttr_t. Construct with new CTraceFilter() for entity-aware filtering. |
CTransform | Position + orientation transform (translation and quaternion rotation). |
HullTrace | Shape data for an AABB hull trace swept along a ray. |
InteractionLayer | Interaction layers, combined with |. An object belongs to layers (CCollisionProperty.InteractsAs), collides with layers (CCollisionProperty.InteractsWith) and can exclude layers (CCollisionProperty.InteractsExclude). Traces take the same masks. |
LineTrace | Shape data for a line (ray) trace with an optional radius for a swept sphere. |
MeshTrace | Shape data for a convex mesh trace with bounds and a vertex array. |
NameMatchType | String comparison mode used when matching entity designer names in trace results. |
Ray_t | Union ray descriptor for VPhys2 trace queries. Set the active shape via one of the Init overloads or the static factory methods. The Type field indicates which union member is valid. |
RayType_t | Shape type used for VPhys2 trace queries. |
RnCollisionAttr_t | Collision attributes of a physics object. Read an entity's with CCollisionProperty.Attribute and a traced shape's with CGameTrace.ShapeAttributes. |
RnQueryObjectSet | Bitmask controlling which object sets (static, dynamic, locatable) are included in a trace query. |
RnQueryShapeAttr_t | Query attributes for a VPhys2 shape trace: which layers and object sets to consider, entities to skip, and flags like HitSolid and HitTrigger. Default-constructed with sensible defaults (hit solid, ignore disabled pairs, all object sets). |
SphereTrace | Shape data for a sphere trace at a fixed center point. |
Trace | Static API for VPhys2 ray and shape casting. All methods are no-ops if the physics query system is not yet ready. |
TraceResult | Simplified trace result returned by Trace.Ray. Contains the hit position, fraction, and full CGameTrace data. |
Zones and Helpers
| Type | Description |
|---|---|
PawnExtensions | Common things to do to a player's hero: hold them in place and kill them. With using DeadworksManaged.Api.Utils; they're available on every CCitadelPlayerPawn. |
Zone | A box in the world that tells you when players walk into it and out of it, through Entered and Left. Use it for checkpoints, start and finish lines, reset areas, safe areas, or anything else you'd otherwise check by hand every frame. |
Enums
| Type | Description |
|---|---|
CameraSetting | A camera setting that PlayerCamera can move or hold. |
EAbilitySlot | Ability slot indices matching EAbilitySlots_t from the game SDK. |
ECitadelDamageType | The kind of damage being dealt (bullet, spirit, melee, ...). See CTakeDamageInfo.CitadelDamageType. |
ECitadelGameMode | |
ECitadelMatchMode | |
ECurrencySource | Reason a currency modification occurred (kill, orb, purchase, etc.). |
ECurrencyType | Types of in-game currency (gold, ability points, etc.). |
EGameState | |
EKnockDownTypes | Knockdown animation type applied to a hero. |
EModifierEvent | Modifier event types. *Broadcast values are not delivered to IDeadworksPlugin.OnModifierEvent. |
EModifierState | All modifier state flags that can be toggled on an entity via CModifierProperty. Contains 308 values covering movement, visibility, combat, and hero-specific states. |
EntityFlags | Engine-level flag bits stored in CBaseEntity.m_fFlags (on-ground, ducking, client, in-vehicle, godmode, etc.). |
FieldType | Source 2 datadesc field type — populated by the native variant_t carried by an entity I/O hook. |
Heroes | Enum of all Deadlock hero identities. Values match game hero IDs. Use HeroTypeExtensions to convert to/from hero name strings. |
HookMode | When an entity I/O hook fires relative to the original handler. |
HookResult | Return value for hooks and event handlers. Stop blocks further processing; Handled signals the event was consumed. |
HorizontalJustify | |
ImbueEffects | What an imbuable item does to the ability it is imbued into (ECitadelTargetAbilityEffects in the game SDK). None means the item declares no imbue behaviour and cannot be imbued at all. |
ImbueResult | Outcome of an imbue attempt. Every value other than Success leaves the pawn exactly as it was - a rejected imbue never grants the item. |
InputButton | Input button bitmask flags (InputBitMask_t). |
LaneColor | Team lane color used in Deadlock matches. |
LifeState | Entity life-cycle state (alive, dying, dead, respawning). |
MoveType | How an entity moves. Read it with CBaseEntity.MoveType and change it with CBaseEntity.SetMoveType. |
ObserverMode_t | Observer camera mode. Stored on CPlayer_ObserverServices as m_iObserverMode. |
SolidFlags | Solid flags on an entity. See CCollisionProperty.SolidFlags. |
SolidType | The shape an entity's physics body is built from. See CCollisionProperty.SolidType. |
TakeDamageFlags | Flags that modify how damage is applied, processed, or reported (suppress effects, force death, crit immunity, etc.). |
UpgradeFlags | |
VerticalJustify |