Skip to content

ClientResource

Abstract class · Namespace OMX.ModAPI.Client · Assembly OMX.ModAPI.Client.dll

public abstract class ClientResource : IClientResource

Entry point for a client resource. OMX discovers the single public derived class, supplies a scoped runtime, wires lifecycle events and removes all subscriptions, timers, HUD and input state when the resource stops.

Implements: IClientResource

protected ClientResource();
protected IClientAudio Audio { get; }
protected IDriverView DriverView { get; }
protected IClientHud Hud { get; }
protected IClientInput Input { get; }
protected IPlayer? LocalPlayer { get; }
protected IResourceLog Log { get; }
protected IClientMessages Messages { get; }
protected IClientEvents Network { get; }
protected IPlayers Players { get; }
protected ResourceInfo Resource { get; }
protected IResourceBus Resources { get; }
protected IClientRuntime Runtime { get; }
protected IResourceScheduler Scheduler { get; }
protected IResourceStorage Storage { get; }
protected IClientVehicles Vehicles { get; }
protected IClientWorld World { get; }
protected virtual void OnMapLoaded(string mapName);

Parameters

  • mapName string
protected virtual void OnMapUnloaded(string mapName);

Parameters

  • mapName string
protected virtual void OnPlayerJoined(IPlayer player);

Parameters

protected virtual void OnPlayerLeft(IPlayer player);

Parameters

protected virtual void OnSessionChanged(SessionKind session);

Parameters

protected virtual ValueTask OnStartAsync(CancellationToken cancellationToken);

Parameters

Returns ValueTask

protected virtual ValueTask OnStopAsync(CancellationToken cancellationToken);

Parameters

Returns ValueTask

protected virtual void OnTick(TimeSpan delta);

Parameters

protected virtual void OnVehicleDespawned(IVehicle vehicle);

Parameters

protected virtual void OnVehicleSpawned(IVehicle vehicle);

Parameters

protected virtual void OnWeatherChanged(WorldWeather weather);

Parameters