Skip to content
Merged
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
24 changes: 12 additions & 12 deletions Assets/Plugins/Pun2Task/Pun2TaskNetwork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public static async UniTask ConnectToRegionAsync(string region, CancellationToke
if (winIndex == 0) return;
throw new ConnectionFailedException(disconnectCause);
}

/// <summary>
/// PhotonNetwork.Disconnect
/// </summary>
Expand All @@ -159,7 +159,7 @@ public static async UniTask DisconnectAsync()
PhotonNetwork.Disconnect();
await Pun2TaskCallback.OnDisconnectedAsync();
}

/// <summary>
/// PhotonNetwork.Reconnect
/// </summary>
Expand All @@ -184,7 +184,7 @@ public static async UniTask ReconnectAsync(CancellationToken token = default)
#endregion

#region RoomConnection

/// <summary>
/// PhotonNetwork.CreateRoom
/// </summary>
Expand Down Expand Up @@ -254,7 +254,7 @@ public static async UniTask<bool> JoinOrCreateRoomAsync(
_ => throw new FailedToJoinRoomException(createFailedCode, createFailedMessage)
};
}

/// <summary>
/// PhotonNetwork.JoinRoom
/// </summary>
Expand Down Expand Up @@ -317,7 +317,7 @@ public static async UniTask JoinRandomRoomAsync(
if (winIndex == 0) return;
throw new FailedToJoinRoomException(returnCode, message);
}

/// <summary>
/// PhotonNetwork.RejoinRoom
/// </summary>
Expand All @@ -338,7 +338,7 @@ public static async UniTask RejoinRoomAsync(string roomName, CancellationToken t
if (winIndex == 0) return;
throw new FailedToJoinRoomException(returnCode, message);
}

/// <summary>
/// PhotonNetwork.ReconnectAndRejoin
/// </summary>
Expand All @@ -358,22 +358,22 @@ public static async UniTask ReconnectAndRejoinAsync(CancellationToken token)
if (winIndex == 0) return;
throw new FailedToJoinRoomException(returnCode, message);
}

/// <summary>
/// PhotonNetwork.LeaveRoom
/// </summary>
/// <param name="becomeInactive"></param>
/// <exception cref="InvalidRoomOperationException">Throws when PhotonNetwork.LeaveRoom returns false.</exception>
public static async UniTask LeaveRoomAsync(bool becomeInactive = true)
public static async UniTask LeaveRoomAsync(bool becomeInactive = true, CancellationToken token = default)
{
if (!PhotonNetwork.LeaveRoom(becomeInactive))
{
throw new InvalidRoomOperationException("Failed to leave room.");
}

await Pun2TaskCallback.OnLeftRoomAsync();
await Pun2TaskCallback.OnLeftRoomAsync(token);
}

/// <summary>
/// PhotonNetwork.JoinLobby
/// </summary>
Expand All @@ -390,7 +390,7 @@ public static async UniTask JoinLobbyAsync(TypedLobby typedLobby = null,

await Pun2TaskCallback.OnJoinedLobbyAsync(token);
}

/// <summary>
/// PhotonNetwork.LeaveLobby
/// </summary>
Expand All @@ -407,7 +407,7 @@ public static async UniTask LeaveLobbyAsync(CancellationToken token = default)
}

#endregion

/// <summary>
/// PhotonNetwork.GetCustomRoomList
/// </summary>
Expand Down