What's new in v1.2.8
Main Changes:
- Updated Naming API of BoltEntity
- New Disconnect Reasons
- Namespace Changes
- Dynamic Region List
- Bolt Core Package
- Join Room by Name
- Option to Disable the A2S Service [Bolt Pro]
For a full list of changes, check the log here.
Updated Naming API of BoltEntity
Several properties of the BoltEntity
class were refactored to comply with the C# Coding Guidelines. The old symbols are still present, but with an obsolete marking and will be removed in a future version. A full list of changes:
sceneGuid
toSceneGuid
;serializerGuid
toSerializerGuid
;prefabId
toPrefabId
;source
toSource
;attachToken
toAttachToken
;detachToken
toDetachToken
;controlGainedToken
toControlGainedToken
;controlLostToken
toControlLostToken
;networkId
toNetworkId
;canFreeze
toCanFreeze
;controller
toController
;isAttached
toIsAttached
;isControlled
toIsControlled
;isControllerOrOwner
toIsControllerOrOwner
;isFrozen
toIsFrozen
;isSceneObject
toIsSceneObject
;isOwner
toIsOwner
;hasControl
toHasControl
;hasControlWithPrediction
toHasControlWithPrediction
;persistsOnSceneLoad
toPersistsOnSceneLoad
;
And a new property was added, HasParent
, that signal if the BoltEntity
has a parent.
New Disconnect Reasons
When your peer is shutdown, it's possible to know the reason before the shutdown really happen. This is possible by the subscription of the BoltShutdownBegin
callback on any of your Bolt.GlobalEventListener
, as shown below:
C#
public class MyNetworkCallback : Bolt.GlobalEventListener
{
public override void BoltShutdownBegin(Bolt.AddCallback registerDoneCallback)
{
// Your shutdown behavior
}
public override void BoltShutdownBegin(Bolt.AddCallback registerDoneCallback, UdpKit.UdpConnectionDisconnectReason disconnectReason)
{
// Your shutdown behavior
}
}
As you can see, we offer two versions of BoltShutdownBegin
, the later one is where you can treat the disconnect reason. Along with the already existent reasons (Unknown
, Timeout
, Error
, Disconnected
), we've added two new types:
UdpConnectionDisconnectReason.Authentication
: that occurs when your peer was not able to authenticate with our Photon Servers. If you are using an invalid or unknown AppID for example.UdpConnectionDisconnectReason.MaxCCUReached
: this specific disconnect reason will show up when you've reached the max allowed Concurrent Users on the AppID used by the peer.
Namespace Changes
The following namespaces names were modified:
Bolt.photon
toBolt.Photon
;udpkit.platform.photon.photon
toudpkit.platform.photon
;
Dynamic Region List
Bolt is now compliant with the "Dashboard Regions Filtering" feature.
When selecting the Best Region
as the target region to connect, the Photon integration will test and select the region with the lowest ping available, considering only the regions selected on the dashboard for the specific AppId used by the peer (if you leave it empty, all regions will be considered).
This is useful when you want to aggregate more players in fewer regions and increase the matching between hosts and clients.
Bolt Core package
On this version, we've removed the necessity of installation of the Bolt Core
package. All files of this package were now incorporated into the main SDK package. When running the Bolt Wizard
window you will notice the new alert:
Join Room by Name
On Bolt 1.2.8, you will be able to join a specific session/room using only its name. As shown below, you still need to pass a PhotonSession
instance when connecting from a client, but now you are not limited to listen for the sessions using SessionListUpdated
and pick one to join, it's possible to build a new session using a known room name.
This can be useful if you have implemented your own matchmaking setup or prefer to use other ways to signal your clients which room to enter.
C#
// ...
public override void BoltStartDone()
{
if (BoltNetwork.IsServer)
{
BoltNetwork.SetServerInfo("mygame", null);
BoltNetwork.LoadScene("<my game scene>");
}
if (BoltNetwork.IsClient)
{
BoltNetwork.Connect(PhotonSession.Build("mygame"));
}
// ...
}
Option to Disable the A2S Service [Bolt Pro]
It was added an option to enable/disable the A2S Service on the Bolt Settings
window. This service can be used the recover information about the Game Host.