SwiftlyS2

IGameEventAccessor

Interface IGameEventAccessor

Namespace: SwiftlyS2.Shared.GameEvents

Assembly: SwiftlyS2.CS2.dll

A generic accessor to native IGameEvent.

public interface IGameEventAccessor : INativeHandle

Implements

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
  • bool — 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.
Type Parameters
  • K — Entity type derived from SwiftlyS2.Shared.SchemaDefinitions.CEntityInstance.

GetEntityIndex(string)

Gets an entity index field from the event payload.

int GetEntityIndex(string key)
Parameters
Returns
  • int — Entity index.

GetFloat(string)

Gets a floating-point field from the event payload.

float GetFloat(string key)
Parameters
Returns

GetInt32(string)

Gets an integer field from the event payload.

int GetInt32(string key)
Parameters
Returns
  • int — Integer value.

GetPawnEntityIndex(string)

Gets the pawn entity index referenced by the given field.

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

GetPlayer(string)

Gets the player referenced by the given field.

IPlayer GetPlayer(string key)
Parameters
Returns

GetPlayerController(string)

Gets the player controller referenced by the given field.

CCSPlayerController GetPlayerController(string key)
Parameters
Returns

GetPlayerPawn(string)

Gets the player pawn referenced by the given field.

CCSPlayerPawn GetPlayerPawn(string key)
Parameters
Returns

GetPlayerSlot(string)

Gets a player slot field from the event payload.

int GetPlayerSlot(string key)
Parameters
Returns
  • int — Player slot.

GetPtr(string)

Gets a raw pointer value from the event payload.

nint GetPtr(string key)
Parameters
Returns
  • nint — Pointer value.

GetString(string)

Gets a string field from the event payload.

string GetString(string key)
Parameters
Returns

GetUInt64(string)

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

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

IsLocal()

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

bool IsLocal()
Returns
  • bool — True if local.

IsReliable()

Indicates whether the event is marked as reliable.

bool IsReliable()
Returns
  • bool — True if reliable.

SetBool(string, bool)

Sets a boolean field on the event payload.

void SetBool(string key, bool value)
Parameters
  • key string — Field name.
  • value bool — Boolean value.

SetEntity<K>(string, K)

Sets an entity reference on the event payload.

void SetEntity<K>(string key, K value) where K : CEntityInstance
Parameters
  • key string — Field name.
  • value K — Entity instance.
Type Parameters
  • K — Entity type derived from SwiftlyS2.Shared.SchemaDefinitions.CEntityInstance.

SetEntityIndex(string, int)

Sets an entity index field on the event payload.

void SetEntityIndex(string key, int value)
Parameters
  • key string — Field name.
  • value int — Entity index.

SetFloat(string, float)

Sets a floating-point field on the event payload.

void SetFloat(string key, float value)
Parameters
  • key string — Field name.
  • value float — Float value.

SetInt32(string, int)

Sets an integer field on the event payload.

void SetInt32(string key, int value)
Parameters
  • key string — Field name.
  • value int — Integer value.

SetPlayerSlot(string, int)

Sets a player slot field on the event payload.

void SetPlayerSlot(string key, int value)
Parameters
  • key string — Field name.
  • value int — Player slot.

SetPtr(string, nint)

Sets a raw pointer value on the event payload.

void SetPtr(string key, nint value)
Parameters
  • key string — Field name.
  • value nint — Pointer value.

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
  • key string — Field name.
  • value ulong — Unsigned 64-bit value.

On this page