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<AlarmInfo?>> GetAlarmInfoAsync(ulong entityId, CancellationToken cancellationToken = default)
Parameters
entityIdulongEntity ID of the alarm.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
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
GetSmartSwitchInfoAsync(ulong, CancellationToken)
Returns the current state of a smart switch entity.
Task<Response<SmartSwitchInfo?>> GetSmartSwitchInfoAsync(ulong entityId, CancellationToken cancellationToken = default)
Parameters
entityIdulongEntity ID of the smart switch.
cancellationTokenCancellationTokenA token to observe for cancellation requests.
Returns
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
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
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<SmartSwitchInfo?>> 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<SmartSwitchInfo?>> 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<SmartSwitchInfo?>> 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
OnSmartSwitchTriggered
Raised when a subscribed smart switch changes state.
event EventHandler<SmartSwitchEventArg>? OnSmartSwitchTriggered
Event Type
OnStorageMonitorTriggered
Raised when a subscribed storage monitor reports a change.
event EventHandler<StorageMonitorEventArg>? OnStorageMonitorTriggered
Event Type
OnTeamChatReceived
Raised when a new team chat message arrives.
event EventHandler<TeamMessageEventArg>? OnTeamChatReceived