public override void OnJoinRoomFailed(short returnCode, string message) { //base.OnJoinRoomFailed(returnCode, message); Debug.Log("Client failed to join the room. " + message); JoinPanelController jpc = JoinGamePanel.GetComponent <JoinPanelController>(); jpc.ResetStatus(); jpc.EnableCancelButton(); string errorMessage; if (!isMasterClient) { errorMessage = $"Could not join {NetworkController.OpponentName}'s match"; GUIController.Instance.DisplayErrorCanvas(errorMessage, () => GUIController.Instance.HideErrorCanvas()); } else { errorMessage = "Could not create match"; GUIController.Instance.DisplayErrorCanvas(errorMessage, () => { StartCoroutine(CancelMatchmaking()); GUIController.Instance.HideErrorCanvas(); }); } PhotonNetwork.JoinLobby(); }
public void OnRoomButtonClicked(string roomId, string opponentName) { JoinPanelController jpc = JoinGamePanel.GetComponent <JoinPanelController>(); jpc.SetJoiningStatus(); jpc.DisableCancelButton(); NetworkController.OpponentName = opponentName; GUIController.Opponent = GUIController.OpponentType.NETWORK; PhotonNetwork.JoinRoom(roomId); }
private void Start() { HostPanelController hpc = HostGamePanel.GetComponent <HostPanelController>(); hpc.OnCancel += CancelMatchmaking; JoinPanelController jpc = JoinGamePanel.GetComponent <JoinPanelController>(); jpc.OnCancel += CancelMatchmaking; rooms = new Dictionary <string, GameObject>(); }