You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
🆕 Disconnection handler, when you got disconnected you automatic go back to the room
This commit is contained in:
@@ -8,6 +8,10 @@ export class NitroEventType
|
||||
public static readonly SOCKET_CLOSED = 'SOCKET_CLOSED';
|
||||
public static readonly SOCKET_ERROR = 'SOCKET_ERROR';
|
||||
public static readonly SOCKET_CONNECTED = 'SOCKET_CONNECTED';
|
||||
public static readonly SOCKET_RECONNECTING = 'SOCKET_RECONNECTING';
|
||||
public static readonly SOCKET_RECONNECTED = 'SOCKET_RECONNECTED';
|
||||
public static readonly SOCKET_RECONNECT_FAILED = 'SOCKET_RECONNECT_FAILED';
|
||||
public static readonly SOCKET_REAUTHENTICATED = 'SOCKET_REAUTHENTICATED';
|
||||
public static readonly AVATAR_ASSET_DOWNLOADED = 'AVATAR_ASSET_DOWNLOADED';
|
||||
public static readonly AVATAR_ASSET_LOADED = 'AVATAR_ASSET_LOADED';
|
||||
public static readonly AVATAR_EFFECT_DOWNLOADED = 'AVATAR_EFFECT_DOWNLOADED';
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import { NitroEvent } from './NitroEvent';
|
||||
|
||||
export class ReconnectEvent extends NitroEvent
|
||||
{
|
||||
private _attempt: number;
|
||||
private _maxAttempts: number;
|
||||
|
||||
constructor(type: string, attempt: number = 0, maxAttempts: number = 0)
|
||||
{
|
||||
super(type);
|
||||
|
||||
this._attempt = attempt;
|
||||
this._maxAttempts = maxAttempts;
|
||||
}
|
||||
|
||||
public get attempt(): number
|
||||
{
|
||||
return this._attempt;
|
||||
}
|
||||
|
||||
public get maxAttempts(): number
|
||||
{
|
||||
return this._maxAttempts;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
export * from './ConfigurationEvent';
|
||||
export * from './MessageEvent';
|
||||
export * from './NitroEvent';
|
||||
export * from './ReconnectEvent';
|
||||
export * from './SocketConnectionEvent';
|
||||
|
||||
Reference in New Issue
Block a user