这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Runtime/Scripts/Internal/Proto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,15 @@ public enum VideoQuality
OFF = 3,
UNRECOGNIZED = -1,
}

public enum DisconnectReason {
UNKNOWN_REASON = 0,
CLIENT_INITIATED = 1,
DUPLICATE_IDENTITY = 2,
SERVER_SHUTDOWN = 3,
PARTICIPANT_REMOVED = 4,
ROOM_DELETED = 5,
STATE_MISMATCH = 6,
UNRECOGNIZED = -1,
}
}
13 changes: 10 additions & 3 deletions Runtime/Scripts/Room/Room.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Room : JSEventEmitter<RoomEvent>, IDisposable
{
public delegate void ReconnectingDelegate();
public delegate void ReconnectedDelegate();
public delegate void DisconnectedDelegate();
public delegate void DisconnectedDelegate(DisconnectReason? reason);
public delegate void StateChangedDelegate(ConnectionState state);
public delegate void MediaDevicesChangedDelegate();
public delegate void ParticipantConnectedDelegate(RemoteParticipant participant);
Expand Down Expand Up @@ -95,9 +95,16 @@ private static void EventReceived(IntPtr iptr)
room.Reconnected?.Invoke();
break;
case RoomEvent.Disconnected:
Log.Debug("Room: Received Disconnected");
room.Disconnected?.Invoke();
{
var pPtr = JSNative.ShiftStack();
DisconnectReason? reason = null;
if(JSNative.IsNumber(pPtr))
reason = (DisconnectReason?) JSNative.GetNumber(pPtr);

Log.Debug($"Room: Received Disconnected({reason})");
room.Disconnected?.Invoke(reason);
break;
}
case RoomEvent.StateChanged:
{
var str = JSNative.GetString(JSNative.ShiftStack());
Expand Down