Why appear this issue?

Options
Client is not on Master Server or not yet ready to call operations

void Start () {
if (!PhotonNetwork.connected){
conectionInfo.text = "Desconectado";
apertou = false;
_nomesala = "Sala" + Random.Range (1,999).ToString();
}
}

void Update () {


if (!PhotonNetwork.connected && apertou == true){

PhotonNetwork.ConnectUsingSettings ("1");
}

if (PhotonNetwork.connected){
conectionInfo.text = "Conectado";
conectionInfo.rectTransform.localPosition = new Vector3 (35,160,0);

if (PhotonNetwork.GetRoomList().Length == 0){
//PhotonNetwork.CreateRoom (_nomesala,true,true,2);

RoomOptions roomopt = new RoomOptions () {isVisible = false , maxPlayers = 2};
PhotonNetwork.JoinOrCreateRoom (_nomesala,roomopt,TypedLobby.Default);

}

int amount = 0;

foreach ( RoomInfo salas in PhotonNetwork.GetRoomList()){
amount ++;

Debug.Log ("Salas" + amount);
}
}
}
public void conectar (){
apertou = true;
}
void OnJoinedRoom (){
Application.LoadLevel ("Sala");
}
}

Comments

  • vadim
    Options
    Your connection workflow does not guarantee that client connected to master server when JoinOrCreateRoom called.
    Check demos for proper workflow.
    Use OnJoinedLobby() callback for instance. You can use master server operation there for sure.