Skip to main content

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​

TypeDescription
ChatHelpers for sending chat messages to players.
ContentAddonsThe 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.
DeadworksPluginBaseOptional base class for plugins. Provides direct access to ITimer via a Timer property without needing interface casts or using aliases.
GameRulesProvides access to CCitadelGameRules data. Automatically resolved when the citadel_gamerules proxy entity is created/destroyed.
GlobalVarsProvides access to CGlobalVars (engine global variables such as curtime, tickcount, etc.).
ItemInfoLookups 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.
KeyValues3Wraps 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).
PlayerCameraMoves 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.
PrecacheResource precaching. Call AddResource during IDeadworksPlugin.OnPrecacheResources to ensure particles, models, and other resources are loaded before use.
ServerServer-side utilities for sending commands to player clients.

Entities​

TypeDescription
AbilityResource
CallbackHandleA generic handle that invokes a cancellation callback when cancelled.
CBaseEntityBase managed wrapper for all Source 2 entities. Provides common operations: health, team, lifecycle, modifiers, schema access.
CBaseModifierWraps a native CBaseModifier instance - a buff/debuff applied to an entity via CBaseEntity.AddModifier.
CBasePlayerControllerBase player controller entity. Manages the link between a player slot and their pawn.
CBasePlayerPawnBase player pawn entity. Provides access to the owning controller.
CBeamA 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.
CBodyComponentBody component attached to an entity, providing access to the CGameSceneNode and world position.
CCitadel_Ability_DashDash ability entity tracking consecutive air/down dash counters for a hero.
CCitadel_Ability_JumpJump ability entity tracking air jump/wall jump counters for a hero.
CCitadelAbilityComponentAbility component on a player pawn. Provides access to stamina/ability resources and the list of equipped abilities.
CCitadelBaseAbilityBase class for all Deadlock abilities (hero abilities, items, innates, etc.).
CCitadelHeroComponentHero component on a player pawn. Exposes the inline spawn data for the current hero.
CCitadelModifierVDataWraps a native CCitadelModifierVData instance - Citadel-specific modifier VData with extended properties.
CCitadelPlayerControllerDeadlock-specific player controller. Provides access to player data, hero selection, team changes, and console messaging.
CCitadelPlayerPawnDeadlock hero pawn. The in-game physical representation of a player. Provides currency, abilities, movement state, stamina, and eye angles.
CCollisionPropertyAn entity's bounds and collision settings: what it collides with, what traces hit it, and its physics shape. Get it with CBaseEntity.Collision.
CEntityKeyValuesWraps 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.
CEntitySubclassVDataBaseWraps CEntitySubclassVDataBase - the VData subclass pointer stored on an entity, providing its design-time name.
CGameSceneNodeScene graph node that holds the entity's world transform and absolute origin.
CitadelHeroDataWrapper around native CitadelHeroData_t (VData). Obtain via HeroType.GetHeroData().
CitadelHeroSpawnDataWraps CitadelHeroSpawnData_t - per-spawn hero state including the resolved hero ID.
CModifierPropertyWraps CModifierProperty - manages modifier state bits on an entity. Uses CNetworkVarChainer to chain network notifications to the owning entity.
CModifierVDataWraps a native CModifierVData instance - base VData for all modifier types.
CParticleSystemRepresents a live info_particle_system entity. Obtain instances via Builder.Spawn.
CParticleSystem.BuilderFluent builder for spawning a CParticleSystem entity.
CPlayer_ObserverServicesObserver/spectator state component on a CBasePlayerPawn.
CPointWorldTextWraps the point_worldtext entity - a world-space text panel rendered in 3D.
CTakeDamageInfoWraps 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.
EntitiesQueries 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.
HeroTypeExtensionsExtension methods for converting Heroes enum values to/from hero name strings and fetching VData.
NativeEntityBase class for all managed wrappers around native C++ entity/object pointers.
PlayerDataGlobalWraps the networked PlayerDataGlobal_t struct on a player controller - provides read access to stats like kills, gold, level, and damage.
PlayersStatic 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).
SchemaStringAccessorWrite-only schema accessor for CUtlSymbolLarge (string) fields. Calls native SetSchemaString.

Events​

TypeDescription
AbilityAttemptEventEvent fired before ability execution each think tick. Set BlockedButtons to prevent specific abilities from being cast.
AddModifierEventEvent data for the AddModifier hook. Modify properties and return HookResult.Stop to block or change the modifier application.
ChatCommandAttributeMarks a plugin method as a handler for a chat command. Can be applied multiple times.
ChatCommandContextProvides context for an invoked chat command, including the originating message, parsed command name, and arguments.
ChatMessageIncoming chat message from a player. Passed to IDeadworksPlugin.OnChatMessage.
CheckTransmitEventFired per-player during CheckTransmit. Use Hide to prevent entities from being networked to this player for the current tick.
ClientConCommandEventEvent data passed to IDeadworksPlugin.OnClientConCommand. Contains the controller pointer, command name, and parsed argument array.
ClientConnectEventFired when a client is connecting to the server. Passed to IDeadworksPlugin.OnClientConnect.
ClientDisconnectedEventPassed to IDeadworksPlugin.OnClientDisconnecting and IDeadworksPlugin.OnClientDisconnect.
ClientFullConnectEventFired when a client has fully connected and is in-game. Passed to IDeadworksPlugin.OnClientFullConnect.
ClientPutInServerEventFired when a client is put into the server (initial connection). Passed to IDeadworksPlugin.OnClientPutInServer.
EntityCreatedEventFired when a new entity is created. Passed to IDeadworksPlugin.OnEntityCreated.
EntityDeletedEventFired just before an entity is deleted. Passed to IDeadworksPlugin.OnEntityDeleted.
EntityInputEventPayload for an entity input dispatch, passed to handlers registered via EntityIO.HookInput or [EntityInputHook].
EntityInputHookAttributeMarks a method as an entity-input hook. The method is auto-registered on plugin load and dropped on unload.
EntityIOHooks 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.
EntityIOValueTyped accessor for the variant value carried by an entity I/O input or output hook.
EntityOutputEventPayload for an entity output fire (CEntityIOOutput::FireOutputInternal), passed to handlers registered via EntityIO.HookOutput or [EntityOutputHook].
EntityOutputHookAttributeMarks a method as an entity-output hook. The method is auto-registered on plugin load and dropped on unload.
EntitySpawnedEventFired when an entity has been fully spawned. Passed to IDeadworksPlugin.OnEntitySpawned.
EntityTouchEventFired when two entities start or stop touching. Passed to IDeadworksPlugin.OnEntityStartTouch and IDeadworksPlugin.OnEntityEndTouch.
GameEventRepresents a Source 2 game event fired by the engine. Read field values via Get* methods; write via Set* methods.
GameEventHandlerDelegate type for dynamic game event listener callbacks registered via GameEvents.
GameEventHandlerAttributeMarks a method to be auto-registered as a Source 2 game event handler for the named event.
GameEventsStatic API for registering/removing dynamic Source 2 game event listeners and creating new events.
GameEventWriterWraps a newly created IGameEvent for setting fields and firing.
HasModifierStateEventEvent 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.
ModifierAbilityEventDataPayload of the ability events.
ModifierDamageEventDataPayload of the damage events. Properties not carried by the current event return null or 0.
ModifierEventA modifier event (damage taken, ability cast, modifier gained/lost, ...) fired by the game. Passed to IDeadworksPlugin.OnModifierEvent. Observe-only.
ModifyCurrencyEventEvent data passed to IDeadworksPlugin.OnModifyCurrency. Contains the pawn, currency type, amount, and source of the change.
ProcessUsercmdsEventEvent data passed to IDeadworksPlugin.OnProcessUsercmds. Contains the player slot, parsed usercmd protobuf messages, and timing info.
TakeDamageEventEvent data passed to IDeadworksPlugin.OnTakeDamage. Contains the target entity and full damage info.

Commands​

TypeDescription
CommandAttributeRegisters a method as /name, !name, and dw_name with typed parameter binding.
CommandConvertersPer-type string parsers for CommandAttribute. Register from OnLoad.
CommandExceptionThrown from a CommandAttribute handler to send Exception.Message to the caller.

ConVars​

TypeDescription
ConCommandAttributeMarks a method as a console command handler with signature void Handler(ConCommandContext ctx).
ConCommandContextContext passed to [ConCommand] and [ConVar] handlers.
ConVarWraps a Source 2 console variable (cvar). Use Find to look up existing cvars or Create to register new ones.
ConVarAttributeMarks 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.
FCVarSource 2 console variable / console command flags, as the engine's tier0 names them.

Configuration​

TypeDescription
ConfigExtensions
IConfig
PluginConfigAttribute

Timers​

TypeDescription
DurationStrongly-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
IHandleA 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.
IStepSequence step context passed to ITimer.Sequence callbacks. Provides execution count and methods to control pacing.
ITimerPer-plugin timer service. Access via this.Timer in any IDeadworksPlugin.

Networking​

TypeDescription
IncomingMessageContext<T>Carries a client→server net message along with its sender. Passed to handlers registered via NetMessages.HookIncoming<T>.
NetMessageDirectionWhether the message is travelling from client→server (Incoming) or server→client (Outgoing).
NetMessageHandlerAttributeMarks a method as a handler for one or more net message types. Applied alongside NetMessages.HookIncoming<T> or NetMessages.HookOutgoing<T> registrations.
NetMessageRegistryMaps 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.
NetMessagesEntry 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>.
RecipientFilterBitmask of player slots that should receive a net message. Each bit position corresponds to a player slot index.

Sound​

TypeDescription
SoundEventBuilds and emits an SOS sound event to clients.
SoundsConvenience wrappers for the most common SoundEvent usages.

UI​

TypeDescription
AddonStateWhat 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.
FlowDirectionDirection of child layout in a UIContainer. Maps to the Panorama flow-children CSS property.
UIEntry 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
UIEventAn event dispatched from the panorama panel back to the server.
UIImage
UILabel
UINodeBase 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
UIPanelHandle 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).
UIUpdateFluent builder for batching multiple field updates and ops into a single logical send call. Use via UIPanel.Build.

Tracing​

TypeDescription
BBox_tAxis-aligned bounding box with min/max corners.
BoundingBoxAxis-aligned bounding box helpers.
CapsuleTraceShape data for a capsule trace between two center points with a radius.
CGameTraceResult of a VPhys2 shape trace. Check DidHit and inspect HitPoint, HitNormal, and HitEntity.
CollisionFunctionMask_tFlags controlling which collision callbacks are enabled on a physics object.
CollisionGroupCollision group that determines which objects interact with each other in the physics simulation.
CTraceFilterTrace 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.
CTransformPosition + orientation transform (translation and quaternion rotation).
HullTraceShape data for an AABB hull trace swept along a ray.
InteractionLayerInteraction 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.
LineTraceShape data for a line (ray) trace with an optional radius for a swept sphere.
MeshTraceShape data for a convex mesh trace with bounds and a vertex array.
NameMatchTypeString comparison mode used when matching entity designer names in trace results.
Ray_tUnion 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_tShape type used for VPhys2 trace queries.
RnCollisionAttr_tCollision attributes of a physics object. Read an entity's with CCollisionProperty.Attribute and a traced shape's with CGameTrace.ShapeAttributes.
RnQueryObjectSetBitmask controlling which object sets (static, dynamic, locatable) are included in a trace query.
RnQueryShapeAttr_tQuery 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).
SphereTraceShape data for a sphere trace at a fixed center point.
TraceStatic API for VPhys2 ray and shape casting. All methods are no-ops if the physics query system is not yet ready.
TraceResultSimplified trace result returned by Trace.Ray. Contains the hit position, fraction, and full CGameTrace data.

Zones and Helpers​

TypeDescription
PawnExtensionsCommon 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.
ZoneA 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​

TypeDescription
CameraSettingA camera setting that PlayerCamera can move or hold.
EAbilitySlotAbility slot indices matching EAbilitySlots_t from the game SDK.
ECitadelDamageTypeThe kind of damage being dealt (bullet, spirit, melee, ...). See CTakeDamageInfo.CitadelDamageType.
ECitadelGameMode
ECitadelMatchMode
ECurrencySourceReason a currency modification occurred (kill, orb, purchase, etc.).
ECurrencyTypeTypes of in-game currency (gold, ability points, etc.).
EGameState
EKnockDownTypesKnockdown animation type applied to a hero.
EModifierEventModifier event types. *Broadcast values are not delivered to IDeadworksPlugin.OnModifierEvent.
EModifierStateAll modifier state flags that can be toggled on an entity via CModifierProperty. Contains 308 values covering movement, visibility, combat, and hero-specific states.
EntityFlagsEngine-level flag bits stored in CBaseEntity.m_fFlags (on-ground, ducking, client, in-vehicle, godmode, etc.).
FieldTypeSource 2 datadesc field type — populated by the native variant_t carried by an entity I/O hook.
HeroesEnum of all Deadlock hero identities. Values match game hero IDs. Use HeroTypeExtensions to convert to/from hero name strings.
HookModeWhen an entity I/O hook fires relative to the original handler.
HookResultReturn value for hooks and event handlers. Stop blocks further processing; Handled signals the event was consumed.
HorizontalJustify
ImbueEffectsWhat 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.
ImbueResultOutcome of an imbue attempt. Every value other than Success leaves the pawn exactly as it was - a rejected imbue never grants the item.
InputButtonInput button bitmask flags (InputBitMask_t).
LaneColorTeam lane color used in Deadlock matches.
LifeStateEntity life-cycle state (alive, dying, dead, respawning).
MoveTypeHow an entity moves. Read it with CBaseEntity.MoveType and change it with CBaseEntity.SetMoveType.
ObserverMode_tObserver camera mode. Stored on CPlayer_ObserverServices as m_iObserverMode.
SolidFlagsSolid flags on an entity. See CCollisionProperty.SolidFlags.
SolidTypeThe shape an entity's physics body is built from. See CCollisionProperty.SolidType.
TakeDamageFlagsFlags that modify how damage is applied, processed, or reported (suppress effects, force death, crit immunity, etc.).
UpgradeFlags
VerticalJustify