Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

CreateRoom failed.

$
0
0
I'm trying to create a room, but I'm having an error. Where is the problem? using Photon.Pun; using Photon.Realtime; using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; public class Connect : MonoBehaviourPunCallbacks { [SerializeField] private GameObject connectingPanel; [SerializeField] private GameObject createRoomPanel; [SerializeField] private GameObject startGamePanel; [SerializeField] private GameObject adversaryPanel; [SerializeField] private TextMeshProUGUI mainServerText; [SerializeField] private TextMeshProUGUI mainUserText; [SerializeField] private TextMeshProUGUI otherServerText; [SerializeField] private TextMeshProUGUI otherUserText; [SerializeField] private TextMeshProUGUI infoServerText; private bool isConnecting = false; private const string gameVersion = "0.1"; private const int maxPlayersPerRoom = 2; [SerializeField] int correntNumber = 0; public void CreateServer() { createRoomPanel.SetActive(false); connectingPanel.SetActive(true); isConnecting = true; PhotonNetwork.ConnectUsingSettings(gameVersion); CreateARoom(); } public void CreateARoom() { RoomOptions roomOptions = new RoomOptions(); roomOptions.IsVisible = true; roomOptions.MaxPlayers = 2; PhotonNetwork.CreateRoom(mainServerText.text, roomOptions, TypedLobby.Default); correntNumber = 1; } public void JoinARoom() { PhotonNetwork.JoinRoom(mainServerText.text); correntNumber = 2; } public override void OnJoinedRoom() { int playerCount = PhotonNetwork.CurrentRoom.PlayerCount; Debug.Log(playerCount.ToString()); if (playerCount != maxPlayersPerRoom) { infoServerText.text = "Waiting for the opponent..."; } else { infoServerText.text = "You are connected!"; if (correntNumber == 1) { connectingPanel.SetActive(false); startGamePanel.SetActive(true); } else if (correntNumber == 2) { connectingPanel.SetActive(false); adversaryPanel.SetActive(true); } } } } Erro: CreateRoom failed. Client is on MasterServer (must be Master Server for matchmaking)but not ready for operations (State: ConnectingToNameServer). Wait for callback: OnJoinedLobby or OnConnectedToMaster.

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>