Client is on MasterServer (must be Master Server for matchmaking)
Options
This is the error that shows up:
JoinRandomRoom failed. Client is on MasterServer (must be Master Server for matchmaking) but not ready for operations (State: Joining). Wait for callback: OnJoinedLobby or OnConnectedToMaster.
I am currently on unity version 2019.1.11f1, and when i try to run my server in unity it crashes, but when i build and play it works perfectly fine. Any ideas on what could be causing this issue?
My Very Basic Script:
JoinRandomRoom failed. Client is on MasterServer (must be Master Server for matchmaking) but not ready for operations (State: Joining). Wait for callback: OnJoinedLobby or OnConnectedToMaster.
I am currently on unity version 2019.1.11f1, and when i try to run my server in unity it crashes, but when i build and play it works perfectly fine. Any ideas on what could be causing this issue?
My Very Basic Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Photon.Pun;
public class Launcher : MonoBehaviourPunCallbacks {
public GameObject ConnectText;
public GameObject OfflineText;
public void MultiplayerStart(){
ConnectText.SetActive(true);
PhotonNetwork.AutomaticallySyncScene = true;
Connect();
}
public void OfflineStart(){
PhotonNetwork.OfflineMode = true;
Create();
}
public override void OnConnectedToMaster(){
Join();
base.OnConnectedToMaster();
}
public override void OnJoinedRoom(){
StartGame();
base.OnJoinedRoom();
}
public override void OnJoinRandomFailed(short returnCode, string message){
Create();
base.OnJoinRandomFailed(returnCode,message);
}
public void Connect(){
PhotonNetwork.GameVersion = "0.0.0";
PhotonNetwork.ConnectUsingSettings();
}
public void Create(){
PhotonNetwork.CreateRoom("");
}
public void Join(){
PhotonNetwork.JoinRandomRoom();
}
public void StartGame(){
if(PhotonNetwork.CurrentRoom.PlayerCount == 1){
PhotonNetwork.LoadLevel(1);
}
}
}
0
Comments
-
Never-mind i just realized i accidentally placed the script somewhere else in my scene0