I am recieving an error Game Does Not Exist

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

I am recieving an error "Game Does Not Exist"

callthecowvalry
2019-04-18 14:51:20

I am working on a game with Photon. I'm using PUN2. I am trying to create a room with a name that is generated by the masterclient. They then share the room name with a friend, who enters it into a text field, and that is used to join the room. I had been working on the game, and this technique had worked previously. All of a sudden, I start receiving the message that "Game Does Not Exist". I've set the console to confirm the client that creates the game, and to confirm the name of the game created. I still get this error from any other client that attempts to join. I am including a copy of my script.


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon;
using Photon.Pun;
using Photon.Realtime;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class TicTacPhotonController : MonoBehaviourPunCallbacks
{

public GameObject mainPanel;  
public GameObject createGamePanel;  
public GameObject joinGamePanel;

public Text createFailText;  
public Text joinFailText;

[SerializeField]  
string gameName;

// Start is called before the first frame update  
void Start()  
{  
    mainPanel.SetActive(false);  
    createGamePanel.SetActive(false);  
    joinGamePanel.SetActive(false);

    PhotonNetwork.ConnectUsingSettings();  
}

public override void OnConnectedToMaster()  
{  
    Debug.Log("Connection To Photon Succeeded");  
     
    mainPanel.SetActive(true);  
    createGamePanel.SetActive(false);  
    joinGamePanel.SetActive(false);  
}

#region Panel Navigation  
public void OnClickCreateGame()  
{  
    mainPanel.SetActive(false);  
    createGamePanel.SetActive(true);  
    joinGamePanel.SetActive(false);  
}

public void BackToMainPanel()  
{  
    mainPanel.SetActive(true);  
    createGamePanel.SetActive(false);  
    joinGamePanel.SetActive(false);  
}

public void OnClickJoinGame()  
{  
    mainPanel.SetActive(false);  
    createGamePanel.SetActive(false);  
    joinGamePanel.SetActive(true);  
}  
#endregion 

public void GetGameName(string gameNameIn)  
{  
    gameName = gameNameIn;  
}

#region Create Game  
public void CreateNewGame()  
{  
    PhotonNetwork.AutomaticallySyncScene = true;  
    RoomOptions myRoomOptions = new RoomOptions { MaxPlayers = 2, IsOpen = true, IsVisible = true };  
    PhotonNetwork.CreateRoom(gameName.ToString(), myRoomOptions, TypedLobby.Default);

}

override public void OnCreatedRoom()  
{  
    Debug.Log("Game Created");  
    Debug.Log(PhotonNetwork.CurrentRoom.Name);  
    SceneManager.LoadScene("TicTacWaiting");  
}  
override public void OnCreateRoomFailed(short returnCode, string message)  
{  
    createFailText.text = "Failed to create game, try again";  
    Debug.Log(message);  
}  
#endregion

#region Join Game  
public void JoinGame()  
{  
    PhotonNetwork.AutomaticallySyncScene = true;  
      
    PhotonNetwork.JoinRoom(gameName.ToString());  
}  

public override void OnJoinRoomFailed(short returnCode, string message)  
{  
    joinFailText.text = "Failed to join game, try again";  
    Debug.Log(message);  
}

public override void OnJoinedRoom()  
{  
    Debug.Log("Game Joined");  
    Debug.Log(PhotonNetwork.CurrentRoom.Name);  
}  
#endregion

}

Comments

JohnTube
2019-04-18 16:54:06

Hi @callthecowvalry,

Thank you for choosing Photon!

Go through our "Matchmaking Checklist" especially "Best Region Considerations".

Back to top