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
alarmIdulongEntity ID of the smart alarm.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
GetAlarmInfoAsync(ulong, CancellationToken)
Returns the current state of a smart alarm entity.
Task<Response<SmartDeviceInfo?>> GetAlarmInfoAsync(ulong entityId, CancellationToken cancellationToken = default)
Parameters
entityIdulongEntity ID of the alarm.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
Remarks
The underlying getEntityInfo request also subscribes this connection to the
entity's EntityChanged broadcasts server-side — even when the read itself fails on a
type mismatch.
GetClanChatAsync(CancellationToken)
Returns recent clan chat messages.
Task<Response<ClanChatInfo?>> GetClanChatAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
GetClanInfoAsync(CancellationToken)
Returns the full clan snapshot for the authenticated player's clan.
Task<Response<ClanInfo?>> GetClanInfoAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
GetInfoAsync(CancellationToken)
Returns server metadata (name, map, player counts, etc.).
Task<Response<ServerInfo?>> GetInfoAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
GetMapAsync(CancellationToken)
Returns the server map image and monument list.
Task<Response<ServerMap?>> GetMapAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
GetMapMarkersAsync(CancellationToken)
Returns all current map markers (players, cargo ship, vending machines, etc.).
Task<Response<MapMarkers?>> GetMapMarkersAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
GetNexusAuthAsync(string, CancellationToken)
Obtains a Nexus cross-server authentication token.
Task<Response<NexusAuth?>> GetNexusAuthAsync(string appKey, CancellationToken cancellationToken = default)
Parameters
appKeystringThe application key identifying the target Nexus server.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
GetSmartDeviceInfoAsync(ulong, CancellationToken)
Returns the state of a binary-state smart device (a smart switch or a smart alarm), whichever of the two types the entity actually is.
Task<Response<SmartDeviceInfo?>> GetSmartDeviceInfoAsync(ulong entityId, CancellationToken cancellationToken = default)
Parameters
entityIdulongEntity ID of the smart device.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
Remarks
The underlying getEntityInfo request also subscribes this connection to the
entity's EntityChanged broadcasts server-side — even when the read itself fails on a
type mismatch.
GetSmartSwitchInfoAsync(ulong, CancellationToken)
Returns the current state of a smart switch entity.
Task<Response<SmartDeviceInfo?>> GetSmartSwitchInfoAsync(ulong entityId, CancellationToken cancellationToken = default)
Parameters
entityIdulongEntity ID of the smart switch.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
Remarks
The underlying getEntityInfo request also subscribes this connection to the
entity's EntityChanged broadcasts server-side — even when the read itself fails on a
type mismatch.
GetStorageMonitorInfoAsync(ulong, CancellationToken)
Returns the current contents and protection state of a storage monitor.
Task<Response<StorageMonitorInfo?>> GetStorageMonitorInfoAsync(ulong entityId, CancellationToken cancellationToken = default)
Parameters
entityIdulongEntity ID of the storage monitor.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
Remarks
The underlying getEntityInfo request also subscribes this connection to the
entity's EntityChanged broadcasts server-side — even when the read itself fails on a
type mismatch.
GetTeamChatAsync(CancellationToken)
Returns recent team chat messages.
Task<Response<TeamChatInfo?>> GetTeamChatAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
GetTeamInfoAsync(CancellationToken)
Returns the full team snapshot including all member statuses and map notes.
Task<Response<TeamInfo?>> GetTeamInfoAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
GetTimeAsync(CancellationToken)
Returns the current in-game time and day/night cycle parameters.
Task<Response<TimeInfo?>> GetTimeAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
KickFromTeamAsync(ulong, CancellationToken)
Kicks a member out of the team.
Task<Response> KickFromTeamAsync(ulong steamId, CancellationToken cancellationToken = default)
Parameters
steamIdulongSteam64 ID of the member to kick.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
PromoteToLeaderAsync(ulong, CancellationToken)
Promotes a team member to team leader.
Task<Response> PromoteToLeaderAsync(ulong steamId, CancellationToken cancellationToken = default)
Parameters
steamIdulongSteam64 ID of the member to promote.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
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
buttonsCameraButtonsBitmask of buttons to press.
mouseDeltaXfloatHorizontal mouse delta.
mouseDeltaYfloatVertical mouse delta.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
SendClanMessageAsync(string, CancellationToken)
Posts a message to the clan chat.
Task<Response> SendClanMessageAsync(string message, CancellationToken cancellationToken = default)
Parameters
messagestringThe message text to send.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
SendTeamMessageAsync(string, CancellationToken)
Posts a message to the team chat.
Task<Response<TeamMessage?>> SendTeamMessageAsync(string message, CancellationToken cancellationToken = default)
Parameters
messagestringThe message text to send.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
SetClanMotdAsync(string, CancellationToken)
Sets the clan's message of the day.
Task<Response> SetClanMotdAsync(string message, CancellationToken cancellationToken = default)
Parameters
messagestringThe new MOTD text.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
SetSmartSwitchValueAsync(ulong, bool, CancellationToken)
Sets a smart switch to a specific on/off state.
Task<Response<SmartDeviceInfo?>> SetSmartSwitchValueAsync(ulong smartSwitchId, bool smartSwitchValue, CancellationToken cancellationToken = default)
Parameters
smartSwitchIdulongEntity ID of the smart switch.
smartSwitchValueboolcancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
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
entityIdulongEntity ID of the alarm.
doSubscribeboolcancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
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<SmartDeviceInfo?>> StrobeSmartSwitchAsync(ulong entityId, int timeoutMilliseconds = 1000, bool value = true, CancellationToken cancellationToken = default)
Parameters
entityIdulongEntity ID of the smart switch.
timeoutMillisecondsintDuration to hold the initial state before reverting, in milliseconds.
valueboolInitial state to pulse the switch to.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
SubscribeToCameraAsync(string, CancellationToken)
Subscribes to a camera's ray stream and returns its info.
Task<Response<CameraInfo?>> SubscribeToCameraAsync(string cameraId, CancellationToken cancellationToken = default)
Parameters
cameraIdstringIn-game identifier of the camera entity.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
ToggleSmartSwitchAsync(ulong, CancellationToken)
Toggles a smart switch — turns it on if off, or off if on.
Task<Response<SmartDeviceInfo?>> ToggleSmartSwitchAsync(ulong entityId, CancellationToken cancellationToken = default)
Parameters
entityIdulongEntity ID of the smart switch.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
UnsubscribeFromCameraAsync(CancellationToken)
Unsubscribes from the currently subscribed camera.
Task<Response> UnsubscribeFromCameraAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
Events
OnCameraRaysReceived
Raised when a camera rays broadcast is received for the subscribed camera.
event EventHandler<CameraRaysEventArg>? OnCameraRaysReceived
Event Type
OnClanChanged
Raised when the clan snapshot changes.
event EventHandler<ClanChangedEventArg>? OnClanChanged
Event Type
OnClanChatReceived
Raised when a new clan chat message arrives.
event EventHandler<ClanMessageEventArg>? OnClanChatReceived
Event Type
OnEntityChanged
Raised for every EntityChanged broadcast, before any device-type heuristic,
with the full raw payload. The broadcast carries no entity type; consumers that know their
paired entity ids should route on Id.
event EventHandler<EntityChangedEventArg>? OnEntityChanged
Event Type
OnSmartDeviceTriggered
Occurs when an EntityChanged broadcast is classified as a binary-state smart device
(a smart switch or a smart alarm): the payload carries no container state (no items, no
capacity, no protection). The broadcast omits the entity type, so a storage broadcast whose
payload is only value is indistinguishable from a switch and lands here too — route on
OnEntityChanged with your paired entity ids when that matters.
event EventHandler<SmartDeviceEventArg>? OnSmartDeviceTriggered
Event Type
OnStorageMonitorTriggered
Occurs when an EntityChanged broadcast is classified as a storage monitor: the payload
carries items, a capacity, or tool-cupboard protection. Storage broadcasts with
value == true and no items carry no contents snapshot and are NOT raised here (they
remain observable via OnEntityChanged). Tool-cupboard broadcasts are sometimes
partial — capacity may be absent and only the protection flag identifies them.
event EventHandler<StorageMonitorEventArg>? OnStorageMonitorTriggered
Event Type
OnTeamChanged
Raised when the team snapshot changes.
event EventHandler<TeamChangedEventArg>? OnTeamChanged
Event Type
OnTeamChatReceived
Raised when a new team chat message arrives.
event EventHandler<TeamMessageEventArg>? OnTeamChatReceived