BoltNetwork.SessionsList empty

Nick89Nick89
edited May 4 in BOLT Engine
Hello.
I am developing a multiplayer project using Bolt's matchmaking, with session creation on the server-side, and session joining on the client-side. Basically i am creating a GUI, where i publish a session on the server-side, and join listed sessions on the client-side.
Here is the code snippet to publish a session:
if (BoltNetwork.isServer)
{
if (GUILayout.Button("Publish HostInfo And Load Map"))
{
BoltNetwork.SetHostInfo("MyPhotonGame", null);
BoltNetwork.LoadScene("main");
}
}


And here is the code snippet to list sessions and create buttons to join the sessions:

if (BoltNetwork.isRunning && BoltNetwork.isClient)
{
GUILayout.Label("Session List");

foreach (var session in BoltNetwork.SessionList)
{
if (GUILayout.Button(session.Value.Source + " / " + session.Value.HostName + " (" + session.Value.Id + ")" ))
{

BoltNetwork.Connect(session.Value);
}
}
}


The problem is that BoltNetwork.SessionList is always empty !! In fact, if i try to print the number of elements in it, it always print 0.

Just for completness, my accept mode in Bolt Settings->Connections is set to "Manual," i have and AppId in the Relay settings, as wall as a region, and set the connection mode to "Photon Cloud", and enabled NAT punchtrough.

Is there something i am missing or doing wrong ?

Thank you in advance.


Sign In or Register to comment.