BoltNetwork.SessionList empty
Options
Nick89
✭
Hello. I am using Bolt's matchmaking for my multiplayer project, but i am having an issue with retrieving sessions created with Bolt Engine.
Here is the server-side code, where i create a session and then load a room:
BoltNetwork.SetHostInfo("MyPhotonGame", null);
BoltNetwork.LoadScene("main");
And here is the client-side code, where i retrieve the sessions, create a button for each one, and join the one associated with the button i clicked
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 the buttons are never created, because BoltNetwork.SessionList is always empty ! In fact, if i try to print on console BoltNetwork.SessionList.Count, it always returns 0.
Just for completeness, i have inserted my PhotonCloud AppId in Windows->Bolt->Settings->Photon Relay, enabled NAT punchthrough, set connection mode to PhotonCloud and region to eu (which is my App's region), and set Accept Mode to "Manual" in Window->Bolt->Settings->Connections.
I am also trying to update sessions list with BoltNetwork.UpdateSessionList(), even if i am not sure this is the right way to use this method, as i have found anything about it in the documentation.
Is there something i am missing or doing wrong ?
Thank you very much in advance.
Here is the server-side code, where i create a session and then load a room:
BoltNetwork.SetHostInfo("MyPhotonGame", null);
BoltNetwork.LoadScene("main");
And here is the client-side code, where i retrieve the sessions, create a button for each one, and join the one associated with the button i clicked
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 the buttons are never created, because BoltNetwork.SessionList is always empty ! In fact, if i try to print on console BoltNetwork.SessionList.Count, it always returns 0.
Just for completeness, i have inserted my PhotonCloud AppId in Windows->Bolt->Settings->Photon Relay, enabled NAT punchthrough, set connection mode to PhotonCloud and region to eu (which is my App's region), and set Accept Mode to "Manual" in Window->Bolt->Settings->Connections.
I am also trying to update sessions list with BoltNetwork.UpdateSessionList(), even if i am not sure this is the right way to use this method, as i have found anything about it in the documentation.
Is there something i am missing or doing wrong ?
Thank you very much in advance.
0
Comments
-
Take a look at the example in the scene PhotonTutorial0
-
Thank you for your answer ! Actually the solution was simpler than expected : i was testing two instances of the app on the same computer. When i tested on two different machines, it worked :-)0