question

luunamten avatar image
luunamten asked

PlayFab multiplayer with Photon Fusion

I'm using Photon Fusion for Multiplayer in Unity, I follow steps for locally debugging PlayFab, GSDK, and it all works fine locally, I'm trying to deploy my Unity headless build on Playfab server, i did all set up, remote to the server and see the server build run normally in the container.

But from the client side, I can't connect to the server, the error logs say that it can not find the Game, I understand that the server build on the PlayFab server need to communicate with the Photon Cloud in order to create Game session. I guess, the server build on the PlayFab can not connect to Photon Cloud.

I also try putting the server build on some remote PC/machine outside my network, and all clients actually can connect to it. Which means there is something blocking the connection between server build on Playfab and Photon cloud, maybe relating to firewall or ports blocking.

Do I miss something? Or Is it related to firewall or port configuration?

Custom Game Serversmultiplayer
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

luunamten avatar image
luunamten answered

Hi again, I've solved the problem, the reason is my headless server build on PlayFab connects to Photon Cloud server from somewhere in US or EU and creates Game Session(Room) on it, but my clients are from Asia, they virtually connect to Photon Cloud server in Singapore, hence the clients can't find the Game Session created by the server. By default, Photon Fusion will choose the best region of Photon Cloud server for the server build and client build to connect to, so the idea is to configure both the server and client build to use the same region for Photon Cloud server.
You can change it from Unity: Fusion -> App Settings -> Fixed Region -> In my case I set it to asia (docs)

Or from the code by passing your custom AppSettings into StartGameArgs

Hope It will help.


capture.png (19.1 KiB)
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Gosen Gao avatar image Gosen Gao commented ·

Glad to know you've solved the issue and thanks for sharing.

1 Like 1 ·
Gosen Gao avatar image
Gosen Gao answered

You can check the server log to see which step blocks the connection from client. With the detailed error message, we can do some research.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bartosz avatar image Bartosz commented ·
For us it looks like photon relay client fails to connect to the photon cloud.


InvalidOperationException: Failed to bind socket to [Address Ip=52.169.46.148 Port=30001]
  at Fusion.Sockets.NetSocketNative.Bind (Fusion.Sockets.NetSocket socket, Fusion.Sockets.NetConfig config) [0x00053] in <ecc55ea9c66c4475927e65f8e8a1e73f>:0 
... Logger Garbage ...
at Fusion.NetworkRunner.StartGameModeCloud (Fusion.StartGameArgs args) [0x0063f] in <1183389d0c9e4ded918d1ae6754e300e>:0 ... Logger Garbage ... Fusion.Photon.Realtime.FusionRelayClient:OnEventHandler(EventData) Fusion.Photon.Realtime.LoadBalancingClient:OnEvent(EventData) ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(StreamBuffer) ExitGames.Client.Photon.TPeer:DispatchIncomingCommands() ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() ExitGames.Client.Photon.PhotonPeer:Service() Fusion.Photon.Realtime.LoadBalancingClient:Service() Fusion.Photon.Realtime.FusionRelayClient:Update() Fusion.CloudCommunicator:Service() Fusion.CloudServices:Update() Fusion.NetworkRunner:Update()
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.