Can Clients From Different Cloud Regions Be In The Same ChatRegion?

pete
pete

Hi all,

We're having an issue where, despite making all my clients join the same Chat Region:

chatClient = new ChatClient(this);
chatClient.ChatRegion = "us";
chatClient.AddFriends(photonFriendArray);
chatClient.SetOnlineStatus(ChatUserStatus.Online);
chatClient.Connect(PhotonNetwork.PhotonServerSettings.AppSettings.AppIdChat, PhotonNetwork.AppVersion, new AuthenticationValues(myPhotonId));

Clients with different Cloud Regions don't see each other online.

Two clients in the US Cloud Region who run the above code can see and message eachother without issues, but if one client's Cloud Region (PhotonNetwork.CloudRegion) is EU, even if it sets the ChatClient ChatRegion to "us", it can't see the other clients with ChatRegion "us".


Is this a limitation of Photon, or is something wrong with our setup?

Thanks!


Tested on Photon Version 2.35, Unity Version 2021.3.9f1, Linux Editor

Answers

  • For completeness, here's what I see from logging:


    Client A: PhotonNetwork.CloudRegion = "us/", chatClient.ChatRegion = "us"

    Client B: PhotonNetwork.CloudRegion = "us/", chatClient.ChatRegion = "us"

    Here, A sees B as online, and B sees A as online


    Client A: PhotonNetwork.CloudRegion = "eu/", chatClient.ChatRegion = "us"

    Client B: PhotonNetwork.CloudRegion = "us/", chatClient.ChatRegion = "us"

    Here, A sees B as offline, and B sees A as offline

  • Yes, you can define different regions for Chat. Only users in the same region can find/see one another (be it Chat, Realtime, Fusion or any other).

    The slash character is about "clustering" (one region can be split into clusters if needs be) but usually there is only one (for the Public Photon Cloud, this is a given). So "us" and "us/" will be the same region.

    However, Chat does not provide all the regions, which are provided by PUN, Fusion, etc. So sometimes, clients have to chose another region for Chat, no matter what.

  • pete
    pete
    edited November 2022

    Hi Tobias, thanks for the reply. Just to be clear:

    you can define different regions for Chat. Only users in the same region can find/see one another (be it Chat, Realtime, Fusion or any other).

    Our users are all in the "us" chat region, so they should be seeing one another, but they're not unless they're in the same PhotonNetwork region. Does this sound like a Photon bug, or can you not connect to the "us" Chat server while in the "eu" PhotonNetwork server?

  • I think I don't get the question.

    PUN and Chat use separate connections. Each connection goes to some region and they can differ between PUN and Chat. Each region is separate from all others, so Chat via US region will only find users, who are also in that region (using the same AppId and AppVersion).

    For PUN, to match with someone, all these conditions need to be met.

  • pete
    pete
    edited November 2022

    so Chat via US region will only find users, who are also in that region

    There seems to be a bug with Photon in that case, since only users in BOTH the same PUN and Chat region can see each other

  • Looking closer at the code, it seems like I've made an architectural error.

     PhotonNetwork.NetworkingClient.OpFindFriends(friendsArray);

    My chat messaging is set up between friends, but friends can only be found on the PUN server.. What a shame

  • You can AddFriends in Chat and each client can set the current room name and region as status for their Chat Client. It duplicates a bit of work / data sent but should be ok.