Skip to content

Photon/matchmaking/refactor/random2v2#1417

Open
Davetsa wants to merge 49 commits intomainfrom
Photon/matchmaking/refactor/Random2v2
Open

Photon/matchmaking/refactor/random2v2#1417
Davetsa wants to merge 49 commits intomainfrom
Photon/matchmaking/refactor/Random2v2

Conversation

@Davetsa
Copy link
Copy Markdown

@Davetsa Davetsa commented Apr 2, 2026

This pull request introduces several improvements and new features to the Photon networking code and the UI system. The main focus is on making Photon operations safer by adding connection checks, expanding matchmaking and queueing capabilities, and enhancing UI components.

Photon networking improvements and new features:

  • Added robust connection and readiness checks before modifying Photon custom properties for both Player and Room objects, preventing errors when the client is not ready or not in a room. These checks are now consistently applied across all relevant extension methods. [1] [2] [3] [4] [5] [6]
  • Introduced new matchmaking and queueing methods in PhotonRealtimeClient:
    • JoinRandomOrCreateRandom2v2Room for 2v2 matchmaking.
    • JoinOrCreateMatchmakingRoom for deterministic matchmaking room creation.
    • JoinOrCreateQueueRoom for creating/joining persistent queue rooms, with a new room property key IsQueueKey. [1] [2]
  • Added new Photon event codes for game countdown and canceling game start.
  • Added new properties to PhotonRealtimeClient for accessing player counts in rooms and the current room.
  • Improved safety of callback registration methods by adding null checks and exception handling to AddCallbackTarget and RemoveCallbackTarget. [1] [2]

UI enhancements:

  • Added a new prefab, "Mini Battle Popup", and integrated it into the UIOverlayPanel prefab. This includes adjustments to font sizes and RectTransform settings for improved UI appearance. [1] [2] [3] [4]

These changes collectively improve the robustness of Photon networking operations and expand the matchmaking/queueing system, while also enhancing the user interface with a new popup component.
This pull request introduces several improvements and new features to the Photon networking layer, focusing on safer property operations, enhanced matchmaking/queueing capabilities, and some UI prefab updates. The most significant changes are the addition of robust guard clauses for Photon property operations, new matchmaking/queue room join methods, and the integration of a new UI prefab.

Photon Networking Improvements

  • Added guard checks in all custom property operations (SetCustomProperty, RemoveCustomProperty, etc.) for both Player and Room objects, ensuring operations are only attempted when the Photon client is connected, ready, and in a room. This prevents errors and logs warnings if attempted when not ready. [1] [2] [3] [4] [5] [6]
  • Added null checks to GetCustomProperty<T>(this RoomInfo room, ...) to avoid null reference exceptions.

Matchmaking and Queueing Enhancements

  • Introduced new static methods in PhotonRealtimeClient for joining or creating random 2v2 rooms, deterministic matchmaking rooms, and persistent queue rooms. These methods use improved logic to prevent race conditions and support larger player queues.
  • Added a new custom room property key IsQueueKey to distinguish queue rooms from other room types.

Photon Client Utility Improvements

  • Improved AddCallbackTarget and RemoveCallbackTarget methods to handle cases when the Photon client is null and to log warnings on failure instead of throwing exceptions. [1] [2]
  • Exposed new properties: CountOfPlayersInRooms and CurrentRoomPlayerCount for easier access to player counts in the Photon client.
  • Added new Photon event byte constants for game countdown and cancellation.

UI Changes

  • Added the new Mini Battle Popup prefab to the project and integrated it into the UIOverlayPanel prefab. This includes adjustments to font sizes and anchor settings for proper display. [1] [2] [3] [4]

These changes collectively improve the reliability of networked property operations, expand the matchmaking and queueing system, and enhance the game's UI with new components.

Davetsa and others added 30 commits March 4, 2026 15:29
… and improve entity prototype handling for determinism
- Created a new prefab for the Mini Battle Popup in the UI components.
- Implemented MiniMatchmakingPanel script to manage matchmaking UI behavior, including visibility toggling and event handling for matchmaking events.
…g the game and adjust UI button behavior based on countdown state
- Added guards in PhotonExtensions to check if the Photon client is connected and ready before setting or removing custom properties for Players and Rooms. This prevents potential errors when the client is not in a valid state.
- Updated MiniMatchmakingPanel to properly handle the state when a game start is cancelled. The UI will now resume matchmaking if still in a matchmaking room, or hide the panel if the player has left matchmaking.
…per clearing of BattleID and improve error handling
… LobbyManager to prevent auto-join, follow leader, and requeue behaviors
Davetsa added 19 commits March 20, 2026 11:38
…oin-or-create and improving room change handling
…and JoinOrCreateQueueRoom methods, enhancing room management and player queue handling.
…nd implement RequeueToPersistentQueue for centralized queue-based matchmaking; update UI handling for persistent queue rooms.
…and stopping matchmaking; update matchmaking text based on room type; remove unused coroutines and methods.
…n matchmaking or queue room; improve UI interaction handling.
…r coroutine for non-master clients to handle insufficient human players.
… matchmaking text visibility for queue status in UI.
@Davetsa Davetsa requested a review from BillTheBeast April 2, 2026 07:56
@Davetsa Davetsa self-assigned this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant