PUN Disconnects
ssakthi
✭
Hi, We are using Photon Unity Networking FREE version and everything was working fine .Since yesterday we have noticed that once players join the room and the master performs some action that gets broadcast-ed to the room, Photon gets disconnected automatically for the master. OnDisconnectedFromPhoton callback from PhotonObserver class is invoked right after master raises event to other players.
Can anyone tell what is the issue ?
PUN Version : 1.87
Can anyone tell what is the issue ?
PUN Version : 1.87
0
Comments
-
Hi @ssakthi,
Thank you for choosing Photon!
I believe "PhotonObserver" is a custom class of yours.
I don't recall we have an internal class with the same name.
Can you explain what is the action done by the MasterClient?
RPC or RaiseEvent?
When do you perform that action? when ALL players are inside the room?
Does the Master Client only disconnects or all other players as well?
Anyways, it should not matter.
Can you tell log the disconnect cause? Use the following snippet:void OnFailedToConnectToPhoton (DisconnectCause cause) { Debug.LogWarningFormat(this, "OnFailedToConnectToPhoton, cause {0}", cause); } void OnConnectionFail(DisconnectCause cause) { Debug.LogWarningFormat(this, "OnConnectionFail, cause {0}", cause); }
0 -
Thanks for replying back! Yes PhotonObserver is a custom class which extends PUNBehaviour .
Master Client sends PhotonNetwork.RaiseEvent with eventContent and option as EventCaching.AddToRoomCacheGlobal . I send the event irrespective of players inside the room or not. But master client disconnects only if the event has been raised and at the same time there is one more player in room .If master is the only one present in the room is no problem. Yes it disconnects only for the master.
The reason behind disconnect was given as " DisconnectByServerLogic "
Can you tell us the reason ?
0 -
I just saw the thread posted by you.Sorry it is not the same issue we are facing..
After deep digging we found that Raise event was not the culprit. It was the serialized data that we send in "OnWrite" which makes the photon disconnect for master.
We serialize using Protocol.Serialize and Protocol.Deserialize methods
Is there any limit over sending data via serialized objects ?0 -
Just to be clear:
You and @EPGames work together and are reporting the same issue by email and on the two forum discussions. I'd like to merge all support channels into one.
Most things PUN does are RaiseEvent under the hood.
Do you register custom types?
If yes, what custom type code were you using to register "NetworkEndLevel" custom type?
If not, you need to register custom types before using it.
Everything you need to know about Photon Serialization can be found here.0 -
PhotonPeer.RegisterType(typeof(PhotonMessagePacket), 255,SerializePhotonMessageType,DeSerializePhotonMessageType);
This is how I register to the custom data which I send and all of these were working fine until last week.This was a sudden breakage0 -
Please change 255 to another value from 0 to 254.0
-
OK then my bad!
Ignore what I've said previously.
We are sorry for the inconvenience.
The fix for the 255 custom type code might take some time (days, weeks) to be deployed. For the time being we advise you to use a different one.
We will investigate how this happened and we will take measures to avoid such issues in the future.0 -
Thanks for the quick response And ya changing to 0 solved the issue.0