Table of Contents

Interface IRustPlus

Namespace
RustPlusApi.Interfaces
Assembly
RustPlusApi.dll

High-level Rust+ API contract — typed events and all supported server commands.

public interface IRustPlus : IRustPlusSocket, IDisposable, IAsyncDisposable
Inherited Members

Methods

CheckSubscriptionAsync(ulong, CancellationToken)

Checks whether the player is subscribed to push notifications from a smart alarm.

Task<Response<SubscriptionInfo?>> CheckSubscriptionAsync(ulong alarmId, CancellationToken cancellationToken = default)

Parameters

alarmId ulong

Entity ID of the smart alarm.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<SubscriptionInfo>>

GetAlarmInfoAsync(ulong, CancellationToken)

Returns the current state of a smart alarm entity.

Task<Response<AlarmInfo?>> GetAlarmInfoAsync(ulong entityId, CancellationToken cancellationToken = default)

Parameters

entityId ulong

Entity ID of the alarm.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<AlarmInfo>>

GetClanChatAsync(CancellationToken)

Returns recent clan chat messages.

Task<Response<ClanChatInfo?>> GetClanChatAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<ClanChatInfo>>

GetClanInfoAsync(CancellationToken)

Returns the full clan snapshot for the authenticated player's clan.

Task<Response<ClanInfo?>> GetClanInfoAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<ClanInfo>>

GetInfoAsync(CancellationToken)

Returns server metadata (name, map, player counts, etc.).

Task<Response<ServerInfo?>> GetInfoAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<ServerInfo>>

GetMapAsync(CancellationToken)

Returns the server map image and monument list.

Task<Response<ServerMap?>> GetMapAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<ServerMap>>

GetMapMarkersAsync(CancellationToken)

Returns all current map markers (players, cargo ship, vending machines, etc.).

Task<Response<MapMarkers?>> GetMapMarkersAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<MapMarkers>>

GetNexusAuthAsync(string, CancellationToken)

Obtains a Nexus cross-server authentication token.

Task<Response<NexusAuth?>> GetNexusAuthAsync(string appKey, CancellationToken cancellationToken = default)

Parameters

appKey string

The application key identifying the target Nexus server.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<NexusAuth>>

GetSmartSwitchInfoAsync(ulong, CancellationToken)

Returns the current state of a smart switch entity.

Task<Response<SmartSwitchInfo?>> GetSmartSwitchInfoAsync(ulong entityId, CancellationToken cancellationToken = default)

Parameters

entityId ulong

Entity ID of the smart switch.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<SmartSwitchInfo>>

GetStorageMonitorInfoAsync(ulong, CancellationToken)

Returns the current contents and protection state of a storage monitor.

Task<Response<StorageMonitorInfo?>> GetStorageMonitorInfoAsync(ulong entityId, CancellationToken cancellationToken = default)

Parameters

entityId ulong

Entity ID of the storage monitor.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<StorageMonitorInfo>>

GetTeamChatAsync(CancellationToken)

Returns recent team chat messages.

Task<Response<TeamChatInfo?>> GetTeamChatAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<TeamChatInfo>>

GetTeamInfoAsync(CancellationToken)

Returns the full team snapshot including all member statuses and map notes.

Task<Response<TeamInfo?>> GetTeamInfoAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<TeamInfo>>

GetTimeAsync(CancellationToken)

Returns the current in-game time and day/night cycle parameters.

Task<Response<TimeInfo?>> GetTimeAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<TimeInfo>>

PromoteToLeaderAsync(ulong, CancellationToken)

Promotes a team member to team leader.

Task<Response> PromoteToLeaderAsync(ulong steamId, CancellationToken cancellationToken = default)

Parameters

steamId ulong

Steam64 ID of the member to promote.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response>

SendCameraInputAsync(CameraButtons, float, float, CancellationToken)

Sends movement / action input to the currently subscribed camera.

Task<Response> SendCameraInputAsync(CameraButtons buttons, float mouseDeltaX = 0, float mouseDeltaY = 0, CancellationToken cancellationToken = default)

Parameters

buttons CameraButtons

Bitmask of buttons to press.

mouseDeltaX float

Horizontal mouse delta.

mouseDeltaY float

Vertical mouse delta.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response>

SendClanMessageAsync(string, CancellationToken)

Posts a message to the clan chat.

Task<Response> SendClanMessageAsync(string message, CancellationToken cancellationToken = default)

Parameters

message string

The message text to send.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response>

SendTeamMessageAsync(string, CancellationToken)

Posts a message to the team chat.

Task<Response<TeamMessage?>> SendTeamMessageAsync(string message, CancellationToken cancellationToken = default)

Parameters

message string

The message text to send.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<TeamMessage>>

SetClanMotdAsync(string, CancellationToken)

Sets the clan's message of the day.

Task<Response> SetClanMotdAsync(string message, CancellationToken cancellationToken = default)

Parameters

message string

The new MOTD text.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response>

SetSmartSwitchValueAsync(ulong, bool, CancellationToken)

Sets a smart switch to a specific on/off state.

Task<Response<SmartSwitchInfo?>> SetSmartSwitchValueAsync(ulong smartSwitchId, bool smartSwitchValue, CancellationToken cancellationToken = default)

Parameters

smartSwitchId ulong

Entity ID of the smart switch.

smartSwitchValue bool

true to turn on, false to turn off.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<SmartSwitchInfo>>

SetSubscriptionAsync(ulong, bool, CancellationToken)

Subscribes or unsubscribes from push notifications for a smart alarm.

Task<Response> SetSubscriptionAsync(ulong entityId, bool doSubscribe = true, CancellationToken cancellationToken = default)

Parameters

entityId ulong

Entity ID of the alarm.

doSubscribe bool

true to subscribe, false to unsubscribe.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response>

StrobeSmartSwitchAsync(ulong, int, bool, CancellationToken)

Pulses a smart switch on then off (or off then on) with the specified delay, implementing a simple strobe / one-shot trigger pattern.

Task<Response<SmartSwitchInfo?>> StrobeSmartSwitchAsync(ulong entityId, int timeoutMilliseconds = 1000, bool value = true, CancellationToken cancellationToken = default)

Parameters

entityId ulong

Entity ID of the smart switch.

timeoutMilliseconds int

Duration to hold the initial state before reverting, in milliseconds.

value bool

Initial state to pulse the switch to.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<SmartSwitchInfo>>

SubscribeToCameraAsync(string, CancellationToken)

Subscribes to a camera's ray stream and returns its info.

Task<Response<CameraInfo?>> SubscribeToCameraAsync(string cameraId, CancellationToken cancellationToken = default)

Parameters

cameraId string

In-game identifier of the camera entity.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<CameraInfo>>

ToggleSmartSwitchAsync(ulong, CancellationToken)

Toggles a smart switch — turns it on if off, or off if on.

Task<Response<SmartSwitchInfo?>> ToggleSmartSwitchAsync(ulong entityId, CancellationToken cancellationToken = default)

Parameters

entityId ulong

Entity ID of the smart switch.

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response<SmartSwitchInfo>>

UnsubscribeFromCameraAsync(CancellationToken)

Unsubscribes from the currently subscribed camera.

Task<Response> UnsubscribeFromCameraAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to observe for cancellation requests.

Returns

Task<Response>

Events

OnCameraRaysReceived

Raised when a camera rays broadcast is received for the subscribed camera.

event EventHandler<CameraRaysEventArg>? OnCameraRaysReceived

Event Type

EventHandler<CameraRaysEventArg>

OnClanChanged

Raised when the clan snapshot changes.

event EventHandler<ClanChangedEventArg>? OnClanChanged

Event Type

EventHandler<ClanChangedEventArg>

OnClanChatReceived

Raised when a new clan chat message arrives.

event EventHandler<ClanMessageEventArg>? OnClanChatReceived

Event Type

EventHandler<ClanMessageEventArg>

OnSmartSwitchTriggered

Raised when a subscribed smart switch changes state.

event EventHandler<SmartSwitchEventArg>? OnSmartSwitchTriggered

Event Type

EventHandler<SmartSwitchEventArg>

OnStorageMonitorTriggered

Raised when a subscribed storage monitor reports a change.

event EventHandler<StorageMonitorEventArg>? OnStorageMonitorTriggered

Event Type

EventHandler<StorageMonitorEventArg>

OnTeamChatReceived

Raised when a new team chat message arrives.

event EventHandler<TeamMessageEventArg>? OnTeamChatReceived

Event Type

EventHandler<TeamMessageEventArg>