AutoReconnect
AutoReconnect
Events
event Action<AutoReconnect, WillConnectArgs> willConnect
Event triggered before attempting to reconnect to the room.
event Func<AutoReconnect, WillConnectArgs, Task> willConnectAsync
Event triggered before attempting to reconnect to the room.
This event is asynchronous and is awaited. It allows for custom logic to be executed before the reconnection attempt, such as updating a room name to connect to a different lobby.
event Action<AutoReconnect> didConnect
Event triggered after a successful connection to the room.
event Action<AutoReconnect, DidDisconnectArgs> didDisconnect
Event triggered after being disconnected from the room.
event Action<AutoReconnect> didCancel
Event triggered when the user cancels the reconnect attempt.
event Action<AutoReconnect, int> reconnectTimerDidUpdate
Event triggered when the reconnect timer updates, providing the remaining time before the next connection attempt in seconds.
Properties
Realtime realtime { get; }
The Realtime component used for connecting to the room.
bool isReconnecting { get; }
Whether an auto-reconnect is currently in progress.
float waitTime { get; }
The time in seconds before the next connection attempt.
float remainingTime { get; }
The time remaining in seconds before the next connection attempt.
int retryCount { get; }
The number of reconnect attempts made since the last successful connection.
int maxRetries { get; }
The maximum number of reconnect attempts before giving up.
string roomName { get; set; }
The room name used to connect.
string quickmatchRoomGroupName { get; set; }
The room group name used when connecting with Quickmatch.
int? quickmatchRoomCapacity { get; set; }
The room capacity used when connecting with Quickmatch.
ConnectOptions connectOptions { get; set; }
The connection options used to connect.
ReconnectMode reconnectMode { get; set; }
How the next reconnect attempt will try to join a room.
Methods
void Reconnect()
Reconnect using the last known room name and connection options.
void CancelReconnect()
Cancel any pending reconnect attempts.