IEngineService
Interface IEngineService
Namespace: SwiftlyS2.Shared.Services
Assembly: SwiftlyS2.CS2.dll
public interface IEngineServiceProperties
CurrentTime
The time since the server started.
[Obsolete("Use GlobalVars.CurrentTime instead.")]
float CurrentTime { get; }GlobalVars
Gets a reference to the global variables structure.
ref CGlobalVars GlobalVars { get; }Map
Gets the map that the server is running
[Obsolete("Use GlobalVars.MapName instead.")]
string Map { get; }MaxPlayers
Gets the maximum number of players allowed in the game.
[Obsolete("Use GlobalVars.MaxClients instead.")]
int MaxPlayers { get; }ServerIP
The IP address of the server.
string? ServerIP { get; }TickCount
The number of simulation ticks that have occurred since the server started.
[Obsolete("Use GlobalVars.TickCount instead.")]
int TickCount { get; }WorkshopId
Gets the Workshop ID of the current map.
string WorkshopId { get; }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)- 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)- 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.
- Task — A task representing the asynchronous operation.
ExecuteCommand(string)
Executes the specified command string in the current context.
void ExecuteCommand(string command)- 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)- command string — The command to execute. Cannot be null or empty.
ExecuteCommandWithBuffer(string, Action<string>)
Executes the specified command string in the current context.
void ExecuteCommandWithBuffer(string command, Action<string> bufferCallback)- 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)- command string — The command to execute. Cannot be null or empty.
- bufferCallback Action<string> — The callback to receive the output of the command.
FindGameSystemByName(string)
Find a game system by name.
nint? FindGameSystemByName(string name)- name string — The name of the game system.
- 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)- map string — The map string to validate. It also supports Workshop ID.
- bool — true if the map is valid; otherwise, false.