swiftlys2/docs/api/ai/
API Reference GameEvents

IGameEventAccessor

Interface
Namespace: SwiftlyS2.Shared.GameEvents · Assembly: SwiftlyS2.CS2.dll
public interface IGameEventAccessor : INativeHandle
Implements INativeHandle

A generic accessor to native IGameEvent.

View source

Properties

DontBroadcast

When true, the event will not be broadcast to clients.

bool DontBroadcast { get; set; }
Property Value

Methods

GetBool(string)

Gets a boolean field from the event payload.

bool GetBool(string key)
Parameters
Returns
Boolean value.

GetEntity<K>(string)

Gets an entity reference from the event payload.

K GetEntity<K>(string key) where K : CEntityInstance
Parameters
Returns
K
Entity instance.

GetEntityIndex(string)

Gets an entity index field from the event payload.

int GetEntityIndex(string key)
Parameters
Returns
Entity index.

GetFloat(string)

Gets a floating-point field from the event payload.

float GetFloat(string key)
Parameters
Returns
Float value.

GetInt32(string)

Gets an integer field from the event payload.

int GetInt32(string key)
Parameters
Returns
Integer value.

GetPawnEntityIndex(string)

Gets the pawn entity index referenced by the given field.

int GetPawnEntityIndex(string key)
Parameters
Returns
Pawn entity index.

GetPlayer(string)

Gets the player referenced by the given field.

IPlayer? GetPlayer(string key)
Parameters
Returns
Player.

GetPlayerController(string)

Gets the player controller referenced by the given field.

CCSPlayerController GetPlayerController(string key)
Parameters
Returns
Player controller.

GetPlayerPawn(string)

Gets the player pawn referenced by the given field.

CCSPlayerPawn GetPlayerPawn(string key)
Parameters
Returns
Player pawn.

GetPlayerSlot(string)

Gets a player slot field from the event payload.

int GetPlayerSlot(string key)
Parameters
Returns
Player slot.

GetPtr(string)

Gets a raw pointer value from the event payload.

nint GetPtr(string key)
Parameters
Returns
Pointer value.

GetString(string)

Gets a string field from the event payload.

string GetString(string key)
Parameters
Returns
String value.

GetUInt64(string)

Gets an unsigned 64-bit integer field from the event payload.

ulong GetUInt64(string key)
Parameters
Returns
Unsigned 64-bit value.

IsLocal()

Indicates whether the event is local to this server/client.

bool IsLocal()
Returns
True if local.

IsReliable()

Indicates whether the event is marked as reliable.

bool IsReliable()
Returns
True if reliable.

SetBool(string, bool)

Sets a boolean field on the event payload.

void SetBool(string key, bool value)
Parameters

SetEntity<K>(string, K)

Sets an entity reference on the event payload.

void SetEntity<K>(string key, K value) where K : CEntityInstance
Parameters
  • keystringField name.
  • valueKEntity instance.

SetEntityIndex(string, int)

Sets an entity index field on the event payload.

void SetEntityIndex(string key, int value)
Parameters

SetFloat(string, float)

Sets a floating-point field on the event payload.

void SetFloat(string key, float value)
Parameters

SetInt32(string, int)

Sets an integer field on the event payload.

void SetInt32(string key, int value)
Parameters

SetPlayerSlot(string, int)

Sets a player slot field on the event payload.

void SetPlayerSlot(string key, int value)
Parameters

SetPtr(string, nint)

Sets a raw pointer value on the event payload.

void SetPtr(string key, nint value)
Parameters

SetString(string, string)

Sets a string field on the event payload.

void SetString(string key, string value)
Parameters

SetUInt64(string, ulong)

Sets an unsigned 64-bit integer field on the event payload.

void SetUInt64(string key, ulong value)
Parameters