Photon Bolt Engine API 1.3

Static Public Member Functions | Properties | List of all members
Photon.Bolt.Matchmaking.BoltMatchmaking Class Reference

Static Public Member Functions

static void CreateSession (string sessionID, IProtocolToken token=null, string sceneToLoad=null, IProtocolToken sceneToken=null)
 Creates a Session using the current running Platform. More...
 
static void JoinRandomSession (IProtocolToken token=null)
 Joins a Session in a random fashion. When not using the UdpKit.UdpSessionFilter, the client will try to enter in any available room. More...
 
static void JoinRandomSession (UdpSessionFilter sessionFilter, IProtocolToken token=null)
 Joins a Session in a random fashion. In order to filter the rooms the player can join, you can make use of the UdpKit.UdpSessionFilter class and pass custom parameters. More...
 
static void JoinSession (string sessionID, IProtocolToken token=null)
 Joins a Session by name. More...
 
static void JoinSession (UdpSession session, IProtocolToken token=null)
 Joins a Session using a UdpSession as reference. More...
 
static void UpdateSession (IProtocolToken token)
 Updates the current session configuration. The local peer need to be the Server in order to call this method. More...
 

Properties

static Dictionary< string, object > CurrentMetadata [get]
 Expose custom metadata information about the current platform and connection if a remove server. The information retrieved by this call depends on the current active platform and the current internal status of it. More...
 
static UdpSession CurrentSession [get]
 Gets the current session this peer is connected. More...
 

Member Function Documentation

◆ CreateSession()

static void Photon.Bolt.Matchmaking.BoltMatchmaking.CreateSession ( string  sessionID,
IProtocolToken  token = null,
string  sceneToLoad = null,
IProtocolToken  sceneToken = null 
)
inlinestatic

Creates a Session using the current running Platform.

Parameters
sessionIDSession identifier. This value will be public available and can be used by other players to join this specific session.
tokenUser custom data. This Token can be used to pass custom data to other players and/or to configure custom properties of the session. More information look at PhotonRoomProperties.
sceneToLoadTarget Scene to be loaded after the session creation procedure starts.
sceneTokenIProtocolToken that is passed on the SceneLoad callbacks.

Example: Creating a session with some custom properties.

void SetupSession(string map, int gameType)
{
if (BoltNetwork.IsServer)
{
string matchName = Guid.NewGuid().ToString();
PhotonRoomProperties props = new PhotonRoomProperties();
props["m"] = map;
props["t"] = gameType;
BoltMatchmaking.CreateSession(
sessionID: matchName,
sceneToLoad: map,
token: props
);
}
}

◆ JoinRandomSession() [1/2]

static void Photon.Bolt.Matchmaking.BoltMatchmaking.JoinRandomSession ( IProtocolToken  token = null)
inlinestatic

Joins a Session in a random fashion. When not using the UdpKit.UdpSessionFilter, the client will try to enter in any available room.

Parameters
token

Example: Joining a Random Session when Bolt is ready.

public override void BoltStartDone()
{
if (BoltNetwork.IsClient)
{
var token = new TestToken();
BoltMatchmaking.JoinRandomSession(token);
}
}

◆ JoinRandomSession() [2/2]

static void Photon.Bolt.Matchmaking.BoltMatchmaking.JoinRandomSession ( UdpSessionFilter  sessionFilter,
IProtocolToken  token = null 
)
inlinestatic

Joins a Session in a random fashion. In order to filter the rooms the player can join, you can make use of the UdpKit.UdpSessionFilter class and pass custom parameters.

Parameters
sessionFilterSession filter parameters
tokenJoin Token

Example:

public void Join(string map, int gameType)
{
if (BoltNetwork.IsClient)
{
var token = new TestToken();
UdpSessionFilter filter = new UdpSessionFilter();
filter.FillMode = UdpSessionFillMode.Random;
filter["m"] = map;
filter["t"] = gameType;
BoltMatchmaking.JoinRandomSession(filter, token);
}
}

◆ JoinSession() [1/2]

static void Photon.Bolt.Matchmaking.BoltMatchmaking.JoinSession ( string  sessionID,
IProtocolToken  token = null 
)
inlinestatic

Joins a Session by name.

Parameters
sessionIDSession name that you want to enter
tokenConnection Token

Example: Joining a session using the Session identifier.

void Join(string sessionID)
{
if (BoltNetwork.IsClient)
{
var token = new TokenTest();
BoltMatchmaking.JoinSession(sessionID, token);
}
}

◆ JoinSession() [2/2]

static void Photon.Bolt.Matchmaking.BoltMatchmaking.JoinSession ( UdpSession  session,
IProtocolToken  token = null 
)
inlinestatic

Joins a Session using a UdpSession as reference.

Parameters
sessionUdpSession that you want to enter
tokenConnection Token

Example: Joining a session using a UdpSession.

public override void SessionListUpdated(Map<Guid, UdpSession> sessionList)
{
foreach (var session in sessionList)
{
UdpSession udpSession = session.Value as UdpSession;
var token = new TestToken();
BoltMatchmaking.JoinSession(udpSession, token);
}
}

◆ UpdateSession()

static void Photon.Bolt.Matchmaking.BoltMatchmaking.UpdateSession ( IProtocolToken  token)
inlinestatic

Updates the current session configuration. The local peer need to be the Server in order to call this method.

Parameters
tokenSettings Token. This can be any IProtocolToken or a PhotonRoomProperties to setup a Photon Session.

Property Documentation

◆ CurrentMetadata

Dictionary<string, object> Photon.Bolt.Matchmaking.BoltMatchmaking.CurrentMetadata
staticget

Expose custom metadata information about the current platform and connection if a remove server. The information retrieved by this call depends on the current active platform and the current internal status of it.

◆ CurrentSession

UdpSession Photon.Bolt.Matchmaking.BoltMatchmaking.CurrentSession
staticget

Gets the current session this peer is connected.

The current session.

UdpKit.UdpSessionFillMode
UdpSessionFillMode
Determines how the Sessions are filled with new players when the peer joins the session in a random f...
Definition: SessionFilter.cs:13