Interface IGameEventService
Interface IGameEventService
Namespace: SwiftlyS2.Shared.GameEvents
Assembly: SwiftlyS2.CS2.dll
Plugin-scoped service for managing game events.
public interface IGameEventServiceMethods
Fire<T>()
Fires an event to all players.
Thread unsafe, use async variant instead for non-main thread context.
[ThreadUnsafe]
void Fire<T>() where T : IGameEvent<T>- T — The event type.
Fire<T>(Action<T>)
Fires an event to all players with a configured event.
Thread unsafe, use async variant instead for non-main thread context.
configureEvent: The action to configure the event.
[ThreadUnsafe]
void Fire<T>(Action<T> configureEvent) where T : IGameEvent<T>- configureEvent Action<T>
- T — The event type.
FireAsync<T>()
Fires an event to all players asynchronously.
Task FireAsync<T>() where T : IGameEvent<T>- T — The event type.
FireAsync<T>(Action<T>)
Fires an event to all players with a configured event asynchronously.
Task FireAsync<T>(Action<T> configureEvent) where T : IGameEvent<T>- configureEvent Action<T>
- T — The event type.
FireToPlayer<T>(int)
Fires an event to a player.
Thread unsafe, use async variant instead for non-main thread context.
[ThreadUnsafe]
void FireToPlayer<T>(int slot) where T : IGameEvent<T>- slot int — The player slot.
- T — The event type.
FireToPlayer<T>(int, Action<T>)
Fires an event to a player with a configured event.
Thread unsafe, use async variant instead for non-main thread context.
[ThreadUnsafe]
void FireToPlayer<T>(int slot, Action<T> configureEvent) where T : IGameEvent<T>- T — The event type.
FireToPlayerAsync<T>(int)
Fires an event to a player asynchronously.
Task FireToPlayerAsync<T>(int slot) where T : IGameEvent<T>- slot int — The player slot.
- T — The event type.
FireToPlayerAsync<T>(int, Action<T>)
Fires an event to a player with a configured event asynchronously.
Task FireToPlayerAsync<T>(int slot, Action<T> configureEvent) where T : IGameEvent<T>- T — The event type.
FireToServer<T>()
Fires an event to the server.
Thread unsafe, use async variant instead for non-main thread context.
[ThreadUnsafe]
void FireToServer<T>() where T : IGameEvent<T>- T
FireToServer<T>(Action<T>)
Fires an event to the server with a configured event.
Thread unsafe, use async variant instead for non-main thread context.
[ThreadUnsafe]
void FireToServer<T>(Action<T> configureEvent) where T : IGameEvent<T>- configureEvent Action<T> — The action to configure the event.
- T — The event type.
FireToServerAsync<T>()
Fires an event to the server asynchronously.
Task FireToServerAsync<T>() where T : IGameEvent<T>- T — The event type.
FireToServerAsync<T>(Action<T>)
Fires an event to the server with a configured event asynchronously.
Task FireToServerAsync<T>(Action<T> configureEvent) where T : IGameEvent<T>- configureEvent Action<T> — The action to configure the event.
- T — The event type.
HookPost<T>(GameEventHandler<T>)
Hooks a post-event callback.
Guid HookPost<T>(IGameEventService.GameEventHandler<T> callback) where T : IGameEvent<T>- callback IGameEventService.GameEventHandler<T> — The callback to hook.
- Guid — A GUID representing the hook. You can use this to unhook the callback later.
- T — The event type.
HookPre<T>(GameEventHandler<T>)
Hooks a pre-event callback.
Guid HookPre<T>(IGameEventService.GameEventHandler<T> callback) where T : IGameEvent<T>- callback IGameEventService.GameEventHandler<T> — The callback to hook.
- Guid — A GUID representing the hook. You can use this to unhook the callback later.
- T — The event type.
Unhook(Guid)
Unhooks a callback.
void Unhook(Guid guid)- guid Guid — The GUID of the hook to unhook.
UnhookPost<T>()
Unhooks all post-event callbacks.
void UnhookPost<T>() where T : IGameEvent<T>- T — The event type.
UnhookPre<T>()
Unhooks all pre-event callbacks.
void UnhookPre<T>() where T : IGameEvent<T>- T — The event type.