PhotonNetwork.ConnectUsingSettings issue

Options
I am connecting to the server by using PhotonNetwork.ConnectUsingSettings. When I first launch the game it pings the servers and then connects to the best available server. I then go in a game, and when I quit (by using photonnetwork.disonnect and then loading my main menu) it shows that it is connected to a server but does not list a region it is connected to and I can not join a game anymore. If I specify the region it reconnects just fine.

Is there something else I can use here.

How can I get the region code for the region I am connected to? I know there is PhotonNetwork.CloudRegion but how can I get the region code that I am connected to that way I store it somewhere and reconnect to it.

Any help would be appreciated as I just purchased Pun and was planning on releasing my game and noticed this issue.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Yous,

    Thank you for choosing Photon!

    PUN automatically saves a summary string after pinging all available regions.
    This summary is used to avoid pinging all regions every time and instead use the same best region from last time.
    I need to check when this summary expires and when we automatically calculate a new one though.
    This summary can be cleared manually/explicitly. There is even an Editor shortcut for this from the PhotonServerSettings.

    If you want to have control on the fly without having to modify client code, read about "Dashboard Regions Filtering".

    In general, Photon clients can communicate only when connected to the same region (servers) and virtual application (AppId, AppVersion). Read our "Matchmaking Checklist".
  • Yous
    Options
    Thanks for the reply @JohnTube. So there isn't anyway to get the region code of the server I am connected to. something like PhotonNetwork.CloudRegion but instead of getting the region name get the region code?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Yous,

    PhotonNetwork.CloudRegion returns region token/code and not the region name.
  • Yous
    Options
    Thanks again, I might have used something else then. One last question if you don't mind, I have set up the usernames for the players from their playerfab username. Is there a way to see all the names of the users connected to the server at the same time? Or anything else that I can do to block same usernames from connecting to the server at the same time? Thanks again @JohnTube
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Yous,

    By username do you mean UserId (PlayFabId) or Nickname (PlayFab DisplayName or PlayFab Username)?

    Is there a way to see all the names of the users connected to the server at the same time?
    From Photon no.

    Or anything else that I can do to block same usernames from connecting to the server at the same time?
    In case you missed it, by default now in latest client SDKs, Photon rooms do not allow two players with the same UserId to be joined at the same time. Other than that, you need to use custom authentication to manually track player sessions.
  • Yous
    Options
    The userid. I did not see that there was an update to photon, I will update it and take a look at it, there should not be anything that I would need to change after the update, correct? Thanks a lot @JohnTube
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hey @Yous,

    When I said latest I did not mean "the" latest.
    If you use PUN you are fine.