Problem with connecting to specific region

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.

Problem with connecting to specific region

Demonitized
2020-12-30 16:10:02

Hello!

I've come to a complete halt with this problem as I can't even connect the clients to the same room because they always tend to choose different regions when deciding for themselves. Therefore I use PhotonNetwork.ConnectToRegion("eu") right after PhotonNetwork.ConnectUsingSettings(). This have worked multiple times before but won't now for some reason. Now I get an error stating that it can't connect to the region because it has to be in the "disconnected" state which I totally understand. However when I remove the PhotonNetwork.ConnectUsingSettings() and replace it with ConnectToRegion I get another error stating "OperationResponse 230: ReturnCode: 32767 (Invalid application id). Parameters: {} Server: NameServer Address: ns.exitgames.com:5058". I don't understand what I have to do here to get this to work. If I cannot get the clients to connect to the same region I can't continue my work.

Thanks in advance!

Comments

JimNew
2020-12-31 09:41:49

Hi and Happy New Year. (and sorry for my english)

I had the same problem 2 yeaks ago and i solved it with this:

  1. In Unity Go to: Windows ---> Photon Unity Networking ---> PUN Wizard.
  2. Click on: Locate PhotonServer Settings.
  3. In the Inspector: expand the Server/Cloud Settings
  4. In Fixed Region write: eu

and in my code i wrote this:

// i use this for gameversion...
private string g_gameversion = "0.0.1";

//--- inside the: private void Start()

if (PhotonNetwork.IsConnected == false)
{
PhotonNetwork.GameVersion = g_gameversion;
PhotonNetwork.PhotonServerSettings.AppSettings.FixedRegion = "eu";
PhotonNetwork.ConnectUsingSettings();
}

I use this and the connection works fine.
Some times with the command only :
PhotonNetwork.PhotonServerSettings.AppSettings.FixedRegion = "eu";
didnt work... and i dont know why.

But with this way i solved this problem.

Try it and tell me if you are ok. (and sorry for my english again).

Happy New Year 2021.

Best regards
JimNew

Demonitized
2020-12-31 11:23:04

Hello!

Happy new years and thanks for the quick response! Your solution worked like
a charm and I'm happy to say that both my clients connect to the same region now.
Though for some reason they still won't see each others rooms.

Edit:
Found the remaining issue. I just forgot to connect to a lobby aswell

JimNew
2020-12-31 13:02:37

I am happy to hear it.
I know the problem and I remember how much confused I was with this.

The knoweledge is for all... and we are getting better when we are sharing it.

(sorry for my english)

Happy New Year.
Best Regards.
JimNew

Back to top