Table of Contents

Class RustPlusFcm

Namespace
RustPlusApi.Fcm
Assembly
RustPlusApi.Fcm.dll

Represents a RustPlus FCM listener, which processes FCM notifications for RustPlus. Inherits from RustPlusFcmSocket.

public class RustPlusFcm : RustPlusFcmSocket, IRustPlusFcm, IRustPlusFcmSocket, IDisposable, IAsyncDisposable
Inheritance
RustPlusFcm
Implements
Inherited Members

Constructors

RustPlusFcm(Credentials, ICollection<string>?, RustPlusFcmSocketOptions?, ILoggerFactory?)

Represents a RustPlus FCM listener, which processes FCM notifications for RustPlus. Inherits from RustPlusFcmSocket.

public RustPlusFcm(Credentials credentials, ICollection<string>? persistentIds = null, RustPlusFcmSocketOptions? options = null, ILoggerFactory? loggerFactory = null)

Parameters

credentials Credentials

The Credentials used for authentication.

persistentIds ICollection<string>

The collection of persistent IDs as ICollection<T> of string.

options RustPlusFcmSocketOptions

Tuning options (heartbeat interval, inactivity timeout); defaults are used when null.

loggerFactory ILoggerFactory

Routes the client's diagnostics into your logging stack; logging is disabled (a no-op NullLogger) when null.

Methods

ParseNotification(FcmMessage)

Parses an incoming FcmMessage and dispatches events based on its channel.

protected override void ParseNotification(FcmMessage message)

Parameters

message FcmMessage

The FcmMessage to parse.

Remarks

Invokes OnPairing, OnAlarmTriggered, and calls ParsePairing(Body) as appropriate.

Events

OnAlarmTriggered

Occurs when an alarm event is triggered.

public event EventHandler<AlarmEvent?>? OnAlarmTriggered

Event Type

EventHandler<AlarmEvent>

Remarks

The event data is an AlarmEvent.

OnEntityPairing

Occurs when an entity pairing notification is received.

public event EventHandler<Notification<EntityEvent?>>? OnEntityPairing

Event Type

EventHandler<Notification<EntityEvent>>

Remarks

The event data is a Notification<T> containing an EntityEvent.

OnPairing

Occurs when a pairing FcmMessage is received.

public event EventHandler<FcmMessage>? OnPairing

Event Type

EventHandler<FcmMessage>

OnServerPairing

Occurs when a server pairing notification is received.

public event EventHandler<Notification<ServerEvent?>>? OnServerPairing

Event Type

EventHandler<Notification<ServerEvent>>

Remarks

The event data is a Notification<T> containing a ServerEvent.

OnSmartAlarmPairing

Occurs when a smart alarm pairing notification is received.

public event EventHandler<Notification<int?>>? OnSmartAlarmPairing

Event Type

EventHandler<Notification<int?>>

Remarks

The event data is a Notification<T> containing an int entity ID.

OnSmartSwitchPairing

Occurs when a smart switch pairing notification is received.

public event EventHandler<Notification<int?>>? OnSmartSwitchPairing

Event Type

EventHandler<Notification<int?>>

Remarks

The event data is a Notification<T> containing an int entity ID.

OnStorageMonitorPairing

Occurs when a storage monitor pairing notification is received.

public event EventHandler<Notification<int?>>? OnStorageMonitorPairing

Event Type

EventHandler<Notification<int?>>

Remarks

The event data is a Notification<T> containing an int entity ID.