Unity Editor and Build Cant find each others room

edited September 2018 in Photon Server
My project was connecting fine about 3 hours ago when suddenly my Editor build and exported build were no longer able to join the same room.

To connect to photon I use
 public void ConnectToPhoton()
        {
            PhotonNetwork.GameVersion = gameVersion;
            PhotonNetwork.ConnectUsingSettings();
            Debug.Log("ConnectToPhoton");
        }

        public override void OnConnectedToMaster()
        {
            PhotonNetwork.JoinLobby();
            Debug.Log("OnConnectedToMaster");
            //PhotonNetwork.JoinRandomRoom(null,0);
        }

        public override void OnJoinedLobby()
        {
            Debug.Log("OnJoinedLobby");
            //PhotonNetwork.JoinRandomRoom(null, 0);
            PhotonNetwork.JoinRandomRoom(null, 0);

        }
        public override void OnJoinRandomFailed(short returnCode, string message)
        {
            print(message + " " + returnCode);
            Debug.Log("OnPhotonRandomJoinFailed() was called by PUN. No random room available, so we create one. Calling: PhotonNetwork.CreateRoom(null, new RoomOptions() {maxPlayers = 4}, null);");
            PhotonNetwork.CreateRoom(null, new RoomOptions() { MaxPlayers = 4 }, null);
        }
The error code from OnRandomJoinFailed gives me 32760 No rooms
Typically I was able to use either the exported build or the Editor build to host. At the time I was working i wasnt affecting any code related to this. I have even gone back to my previous git pull and am still unable to get my builds to connect to each other. I can't seem to find the cause and would be glad to help.

Comments

  • Hi, @lilcolombian

    are you sure that you have same versions in your builds? are you sure that you are connecting to the same region? What version of PUN are you using?

    best,
    ilya
  • @chvetsov Thanks for the reply i meant to edit last night, it was caused by the region. Unity suddenly decided that the region in the build/ editor was gonna be different. I found a post talking about hardsetting the region and it did the trick. Still dont know why i happened though. Lost like 3 hours looking for an answer.
  • great that you managed to fix it

    best,
    ilya
  • Very old post but... why is this? I was smashing my head on the keyboard trying to understand why my clients (editor x build) couldn't see each other but then I added a label to know which cloud region each was connected to and I found that they are in two different regions even though they are running in the same machine... The editor is running on the region SA but the build is in US. The correct should be SA. The windows build is incorrect but the mobile and editor is ok.
  • It's getting weirder, I decided to use a fixed region, now if I try to join a random room (where the other room was created by another instance of mine in the same machine), the second player trying to join the room simply fails to do it. No response error or anything...
  • hi, @Rodolfo_Rubens
    please ask you question in client side part of the forum

    best,
    ilya
  • Hi. I'm getting the same problem right now but in my case, the build and the editor are on the same region (asia) but they still can't see each other. I tried toasting every step and I figured out that one of them can't find the existing room. Any help?
  • hi, @RawkStar

    there are few reasons for this:
    - different region
    - different appId
    - different app version

    try to join same room using predefined name (sometimes users use random)

    provide us detailed logs from client side

    best,
    ilya
Sign In or Register to comment.