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

Static Public Member Functions

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

Properties

static UdpSession CurrentSession [get]
 Gets the current session this peer is connected. More...
 

Member Function Documentation

◆ CreateDedicatedSession()

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

Set Session information on a dedicated server. Usage is similar to CreateSession(string, IProtocolToken, string).

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 Bolt.Photon.PhotonRoomProperties.
sceneToLoadTarget Scene to be loaded after the session creation procedure starts.

◆ CreateSession()

static void Bolt.Matchmaking.BoltMatchmaking.CreateSession ( string  sessionID,
IProtocolToken  token = null,
string  sceneToLoad = 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 Bolt.Photon.PhotonRoomProperties.
sceneToLoadTarget Scene to be loaded after the session creation procedure starts.

Example: Creating a session with some custom properties.

void SetupSession(string map, int gameType)
{
{
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 Bolt.Matchmaking.BoltMatchmaking.JoinRandomSession ( IProtocolToken  token = null)
inlinestatic

Join a Session in a random fashion. When not using the 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()
{
{
var token = new TestToken();
BoltMatchmaking.JoinRandomSession(token);
}
}

◆ JoinRandomSession() [2/2]

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

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

Parameters
sessionFilterSession filter parameters
tokenJoin Token

Example:

public void Join(string map, int gameType)
{
{
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 Bolt.Matchmaking.BoltMatchmaking.JoinSession ( string  sessionID,
IProtocolToken  token = null 
)
inlinestatic

Join 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)
{
{
var token = new TokenTest();
BoltMatchmaking.JoinSession(sessionID, token);
}
}

◆ JoinSession() [2/2]

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

Join 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 Bolt.Matchmaking.BoltMatchmaking.UpdateSession ( IProtocolToken  token)
inlinestatic

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

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

Property Documentation

◆ CurrentSession

UdpSession Bolt.Matchmaking.BoltMatchmaking.CurrentSession
staticget

Gets the current session this peer is connected.

The current session.