Skip to content

Commit 3f0350a

Browse files
authored
Merge pull request #47 from Unity-Technologies/fix/disconnect-remote-client
fix: Fixes the function used to disconnect remote clients.
2 parents 05d8e5b + d54b6b9 commit 3f0350a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Transports/com.mlapi.contrib.transport.photon-realtime/Runtime/PhotonRealtimeTransport.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ namespace MLAPI.Transports.PhotonRealtime
1515
[DefaultExecutionOrder(-1000)]
1616
public partial class PhotonRealtimeTransport : NetworkTransport, IOnEventCallback
1717
{
18+
private static readonly ArraySegment<byte> s_EmptyArraySegment = new ArraySegment<byte>(Array.Empty<byte>());
19+
1820
[Tooltip("The nickname of the player in the Photon Room. This value is only relevant for other Photon Realtime features. Leaving it empty generates a random name.")]
1921
[SerializeField]
2022
private string m_NickName;
@@ -317,7 +319,7 @@ public override void DisconnectRemoteClient(ulong clientId)
317319
{
318320
if (m_Client.InRoom && this.m_Client.LocalPlayer.IsMasterClient)
319321
{
320-
ArraySegment<byte> payload = default;
322+
ArraySegment<byte> payload = s_EmptyArraySegment;
321323
RaisePhotonEvent(clientId, true, payload, this.m_KickEventCode);
322324
}
323325
}

0 commit comments

Comments
 (0)