question

bbekec avatar image
bbekec asked

Photon Disconnecton & Error Logs

Hello, In my realtime 4 player card game, I use Photon & Playfab together. After Playfab client logged his account, account is authanticated with Photon Network.

In the game, There are lots of disconnection issues and currently I can't find any solution to this. Photon advised me to log the disconnection cause. So is there anyway to log Photon disconnection cause for each client individually on Playfab? That is, when a player disconnected, that player will send the data which provided by Photon and includes disconnection cause string to Playfab as log.

Thanks.

Player Dataphotondata
10 |1200

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

Hernando avatar image
Hernando answered

To log the disconnection causes, you should enable the SupportLogger for your project. The SupportLogger is a MonoBehaviour, you can add this component to any GameObject and set the LoadBalancingClient for it.

In this component, there is an OnDisconnected() function that will be called after disconnecting from the Photon server and the reason for this disconnect is provided as DisconnectCause, therefore you can call WriteTelemetryEvents() to report this as an event to PlayFab in this function body.

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.

Hamza Lazaar avatar image Hamza Lazaar commented ·

PUN already supports enabling SupportLogger automatically via PhotonServerSettings option.

0 Likes 0 ·
bbekec avatar image
bbekec answered

Hernando, thanks for your help. If player disconnects, I will catch the DisconnectCause string via OnDisconnect() function, then I will create an event which includes the DisconnectCause string in Playfab. right?

Hamza, sorry that I am a bit confused. I already authenticate the Playfab user to Photon. So, Can I see the disconnection cause string by enabling SupportLogger in Playfab? if yes, it will save my time greatly.

Edit:

May be I am totally confused. Can I see Disconnection cause logs in Photon Dashboard without Playfab if I enable it in Photon Properties?

I want to ask that; I don't know users playing my game. So, if a user disconnects, showing the disconnection issue to the player is not meaning anything. So I have to access this disconnection cause. In order to understand why that user is disconnected, I need to send the data to Playfab or something else. Or, Photon may be logging this but I don't have an idea how I can access that log and why disconnection happened. :) If Photon logs, may I access to this log in Photon Dashboard?

Regards

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.

Hernando avatar image Hernando commented ·

> If player disconnects, I will catch the DisconnectCause string via OnDisconnect() function, then I will create an event which includes the DisconnectCause string in Playfab. right?

Yes, it is in the right direction.

> May be I am totally confused. Can I see Disconnection cause logs in Photon Dashboard without Playfab if I enable it in Photon Properties?

Since the client has disconnected from the Photon server, it cannot send logs to Photon. If the client can still maintain a connection with the PlayFab server at thisspecial time, it can send the disconnection cause to Playfab Server through an event.

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.