SwiftlyS2

IEngineService

Interface IEngineService

Namespace: SwiftlyS2.Shared.Services

Assembly: SwiftlyS2.CS2.dll

public interface IEngineService

Properties

CurrentTime

The time since the server started.

[Obsolete("Use GlobalVars.CurrentTime instead.")]
float CurrentTime { get; }
Property Value

GlobalVars

Gets a reference to the global variables structure.

ref CGlobalVars GlobalVars { get; }
Property Value

Map

Gets the map that the server is running

[Obsolete("Use GlobalVars.MapName instead.")]
string Map { get; }
Property Value

MaxPlayers

Gets the maximum number of players allowed in the game.

[Obsolete("Use GlobalVars.MaxClients instead.")]
int MaxPlayers { get; }
Property Value

ServerIP

The IP address of the server.

string? ServerIP { get; }
Property Value

TickCount

The number of simulation ticks that have occurred since the server started.

[Obsolete("Use GlobalVars.TickCount instead.")]
int TickCount { get; }
Property Value

WorkshopId

Gets the Workshop ID of the current map.

string WorkshopId { get; }
Property Value

Methods

DispatchParticleEffect(string, ParticleAttachment_t, byte, CUtlSymbolLarge, CRecipientFilter, bool, int, CBaseEntity?)

Dispatches a particle effect to the specified recipients.

Thread unsafe, use async variant instead for non-main thread context.

void DispatchParticleEffect(string particleName, ParticleAttachment_t attachmentType, byte attachmentPoint, CUtlSymbolLarge attachmentName, CRecipientFilter filter, bool resetAllParticlesOnEntity = false, int splitScreenSlot = 0, CBaseEntity? entity = null)
Parameters
  • particleName string — The name of the particle effect.
  • attachmentType ParticleAttachment_t — The type of attachment for the particle effect.
  • attachmentPoint byte — The attachment point for the particle effect.
  • attachmentName CUtlSymbolLarge — The name of the attachment for the particle effect.
  • filter CRecipientFilter — The recipient filter for the particle effect.
  • resetAllParticlesOnEntity bool — Whether to reset all particles on the entity.
  • splitScreenSlot int — The split screen slot for the particle effect.
  • entity CBaseEntity? — The entity to attach the particle effect to.

DispatchParticleEffectAsync(string, ParticleAttachment_t, byte, CUtlSymbolLarge, CRecipientFilter, bool, int, CBaseEntity?)

Dispatches a particle effect to the specified recipients asynchronously.

Task DispatchParticleEffectAsync(string particleName, ParticleAttachment_t attachmentType, byte attachmentPoint, CUtlSymbolLarge attachmentName, CRecipientFilter filter, bool resetAllParticlesOnEntity = false, int splitScreenSlot = 0, CBaseEntity? entity = null)
Parameters
  • particleName string — The name of the particle effect.
  • attachmentType ParticleAttachment_t — The type of attachment for the particle effect.
  • attachmentPoint byte — The attachment point for the particle effect.
  • attachmentName CUtlSymbolLarge — The name of the attachment for the particle effect.
  • filter CRecipientFilter — The recipient filter for the particle effect.
  • resetAllParticlesOnEntity bool — Whether to reset all particles on the entity.
  • splitScreenSlot int — The split screen slot for the particle effect.
  • entity CBaseEntity? — The entity to attach the particle effect to.
Returns
  • Task — A task representing the asynchronous operation.

ExecuteCommand(string)

Executes the specified command string in the current context.

void ExecuteCommand(string command)
Parameters
  • command string — The command to execute. Cannot be null or empty.

ExecuteCommandAsync(string)

Executes the specified command string in the current context asynchronously.

Task ExecuteCommandAsync(string command)
Parameters
  • command string — The command to execute. Cannot be null or empty.
Returns

ExecuteCommandWithBuffer(string, Action<string>)

Executes the specified command string in the current context.

void ExecuteCommandWithBuffer(string command, Action<string> bufferCallback)
Parameters
  • command string — The command to execute. Cannot be null or empty.
  • bufferCallback Action<string> — The callback to receive the output of the command.

ExecuteCommandWithBufferAsync(string, Action<string>)

Executes the specified command string in the current context with a buffer callback asynchronously.

Task ExecuteCommandWithBufferAsync(string command, Action<string> bufferCallback)
Parameters
  • command string — The command to execute. Cannot be null or empty.
  • bufferCallback Action<string> — The callback to receive the output of the command.
Returns

FindGameSystemByName(string)

Find a game system by name.

nint? FindGameSystemByName(string name)
Parameters
  • name string — The name of the game system.
Returns
  • nint? — The game system handle. Null if not found.

IsMapValid(string)

Determines whether the specified map string represents a valid map in server files.

bool IsMapValid(string map)
Parameters
  • map string — The map string to validate. It also supports Workshop ID.
Returns
  • bool — true if the map is valid; otherwise, false.

On this page