Best Of
Re: About ending a game and disconnection
Hi,
We don't recommend using "BoltNetwork.ShutdownImmediate", but instead "BoltNetwork.Shutdown", as this will make the Server shutdown, but also send a Disconnect command to the clients, so they also shutdown naturally.
You can treat this using the "BoltShutdownBegin" callback.
- https://doc.photonengine.com/en-us/bolt/current/gameplay/global-callbacks
- https://doc-api.photonengine.com/en/bolt/current/class_bolt_network.html#a68730f5af4b8ae0e6ff058493c6c1803
Yes, once you shutdown, you will be disconnected from the Photon Cloud until you start Bolt again.
If there is no connection with Photon, no CCU is counted.
First of all, we suggest that you override all callbacks on both sides (server and client), and check their calls when you are playing your game, that is the best way to learn about how they work.
You will get "Disconnected" on the Server after the Connection Timeout.
You will get "Disconnected" on the clients followed by the "BoltShutdownBegin".
You will get "Disconnected" on the Server after the Connection Timeout.
--
Ramon Melo
Photon Bolt Team
1 What's the proper way to quit a session? Do I call `BoltNetwork.ShutdownImmediate();` directly or is there any recommended way to let server and clients get notification properly?
We don't recommend using "BoltNetwork.ShutdownImmediate", but instead "BoltNetwork.Shutdown", as this will make the Server shutdown, but also send a Disconnect command to the clients, so they also shutdown naturally.
You can treat this using the "BoltShutdownBegin" callback.
- https://doc.photonengine.com/en-us/bolt/current/gameplay/global-callbacks
- https://doc-api.photonengine.com/en/bolt/current/class_bolt_network.html#a68730f5af4b8ae0e6ff058493c6c1803
2 After ending in question1, are all the players in the room not counted as CCU?
Yes, once you shutdown, you will be disconnected from the Photon Cloud until you start Bolt again.
If there is no connection with Photon, no CCU is counted.
3 What's the callback links for ending session? I need to design a strategy to judge win/lose and prevent quitting game on purpose, so I need to know all the ending game related Bolt behaviors. I know `BoltShutdownBegin` on both sides will get called if the server call `BoltNetwork.ShutdownImmediate();`. What about other following cases?
First of all, we suggest that you override all callbacks on both sides (server and client), and check their calls when you are playing your game, that is the best way to learn about how they work.
- a - A client calls `BoltNetwork.ShutdownImmediate();`
You will get "Disconnected" on the Server after the Connection Timeout.
- b - Server lose internet connection or app is killed by player.
You will get "Disconnected" on the clients followed by the "BoltShutdownBegin".
- c - A client does `b`.
You will get "Disconnected" on the Server after the Connection Timeout.
--
Ramon Melo
Photon Bolt Team
Re: JoinRandomSession vs SessionListUpdated
Hi,
The "JoinRandomSession" will just try to join any available Session, if there is no one available, it will fail and you will get a callback for that. That is why, in the Getting Started Sample, we use the "SessionListUpdated" to look for the sessions for a period of time before starting as Server.
- https://github.com/BoltEngine/Bolt-Sample/blob/master/GettingStarted/Scripts/Menu.cs#L139
Take a look at our docs: https://doc.photonengine.com/en-us/bolt/current/gameplay/global-callbacks
Specially at "SessionConnectFailed" and "ConnectFailed".
--
Ramon Melo
Photon Bolt Team
1 It seems `SessionListUpdated` can fulfill my goal. But what about `JoinRandomSession`? Is `JoinRandomSession` a one time try or does it keep trying joining any new sessions available until it get canceled or timed out?
The "JoinRandomSession" will just try to join any available Session, if there is no one available, it will fail and you will get a callback for that. That is why, in the Getting Started Sample, we use the "SessionListUpdated" to look for the sessions for a period of time before starting as Server.
- https://github.com/BoltEngine/Bolt-Sample/blob/master/GettingStarted/Scripts/Menu.cs#L139
2 If there're several users trying to join the same session, some might fail due to the max players limit. What's the safe way to handle Joining sessions failure(for both `JoinRandomSession` and `JoinSession`)? I haven't found session fail related callbacks.
Take a look at our docs: https://doc.photonengine.com/en-us/bolt/current/gameplay/global-callbacks
Specially at "SessionConnectFailed" and "ConnectFailed".
--
Ramon Melo
Photon Bolt Team
Re: ue4 voice ?
Hi @radazen.
Yes, the Photon Voice C++ client is still not officially released yet.
We had to delay working on it for quite some time due to being very busy with adding support for the new console generations.
However by now the work on the initial release version of the Photon Voice C++ client is nearly finished and it should become available in the next couple of weeks.
Preview versions for Windows and consoles and an Unreal Engine integration demo are already available on request.
If you want access to them, please write us an email to the address in the contact section of our website.
Yes, the Photon Voice C++ client is still not officially released yet.
We had to delay working on it for quite some time due to being very busy with adding support for the new console generations.
However by now the work on the initial release version of the Photon Voice C++ client is nearly finished and it should become available in the next couple of weeks.
Preview versions for Windows and consoles and an Unreal Engine integration demo are already available on request.
If you want access to them, please write us an email to the address in the contact section of our website.
Re: CCU Limit Error
could it be that your free license expired?
please check logs in bin_Win64/log folder
you will see amount of players that is allowed with that license
best,
ilya
please check logs in bin_Win64/log folder
you will see amount of players that is allowed with that license
best,
ilya

1
Re: RPC works for base classes?
Hi friuns,
I found a solution.
The unity photon plugin doesn't find the methods marked as RPC in a base class because it doesn't search for such methods up the in the class hierarchy. You can solve this problem doing the following:
- Inside the Plugins folder of the Photon Unity Networking open the NetworkingPeer.cs file.
- Search the line 1334. It looks like this.
So far everything is working alright for me, should I find a problem with this code change I'll post it here.
Bye!
I found a solution.
The unity photon plugin doesn't find the methods marked as RPC in a base class because it doesn't search for such methods up the in the class hierarchy. You can solve this problem doing the following:
- Inside the Plugins folder of the Photon Unity Networking open the NetworkingPeer.cs file.
- Search the line 1334. It looks like this.
MethodInfo[] myMethods = type.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance );- Delete the BindingFlags.DeclaredOnly. This flags specifies that only members declared at the level of the supplied type's hierarchy should be considered. Inherited members are not considered. Once deleted, it should look like this
MethodInfo[] myMethods = type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance );
So far everything is working alright for me, should I find a problem with this code change I'll post it here.
Bye!
Re: OnRoomPropertiesUpdate seems to be called on destroyed objects as well
In PUN 2, your code registers for callbacks but also has to unregister, when the callbacks are not needed anymore. So in your case, somehow the instance is not removed from the callback list.
Check if your scripts override OnEnable and OnDisable if you inherit MonoBehaviourPunCallbacks. Make sure to call base for both.
Check if your scripts override OnEnable and OnDisable if you inherit MonoBehaviourPunCallbacks. Make sure to call base for both.

1
Re: Unity editor freeze after room creation call
We are still discussing which changes to make but the problem is this:
The PhotonViewCollection uses photonViewList.Values, which creates a new iterator every time it's called.
This is by design, so you could iterate over the (current) Values.
If you go with
If you'd use your approach on a dictionary, it would look like this (more or less):
It's unfortunate that this is an infinite loop.
At the moment, we think maybe we just change the naming of PhotonViewCollection.
Sorry for the hassle.
Thanks for reporting this and not giving up on Photon instead!
The PhotonViewCollection uses photonViewList.Values, which creates a new iterator every time it's called.
This is by design, so you could iterate over the (current) Values.
If you go with
foreach (PhotonView view in PhotonNetwork.PhotonViewCollection), there is no problem.
If you'd use your approach on a dictionary, it would look like this (more or less):
while (dict.Values.GetEnumerator().MoveNext())and it would also fail in the same way.
It's unfortunate that this is an infinite loop.
At the moment, we think maybe we just change the naming of PhotonViewCollection.
Sorry for the hassle.
Thanks for reporting this and not giving up on Photon instead!

2
Re: Unity editor freeze after room creation call
You just need to use foreach( ), of if you want to loop yourself cache the iterator rather than getting a new one every loop.
Tobi tested this and it works correctly:
Tobi tested this and it works correctly:
var iterator = PhotonNetwork.PhotonViewCollection; while (iterator.MoveNext()) { }
Re: Muting a specific player
Think I found the answer myself, disabling the audiosource on the network instantiated prefab mutes the player. Is there a nicer way to do it, ~I could turn the volume to zero rather than disabling the audio source. Just wondering if this is the 'correct way'.

1
Re: IPv6 for Unity iOS Exports
PUN v1.91 is outdated even for PUN Classic.
For question about the Photon Server setup, you have to ask in the server subforum or mail us: [url="mailt://[email protected]"][email protected][/url].
Apple will reject multiplayer games frequently. The only known approach is to involve developer support. They usually get things tested properly and they pass. But do make sure your app passes the tests that are linked-to on the first page of this discussion. Setup a Mac with a WiFi, which only has IPv6 addresses for mobiles (but does support DNS64/NAT64, as described by Apple).
How to use the Alternative Ports is described on the docs.
Thanks!
PUN Update to 1.103.1,Use TCP.
We pass!