I'm doing this tutorial and just wrote the first code block. The following is in the tutorial:
At this point, you can save the Launch Scene and hit Play. You should see in the Unity Console a good dozens of logs. Look specifically for "Connected to masterserver." log which indicated that indeed we are now connected and ready to join a room for example.
But I'm not getting any logs when running this line PhotonNetwork.ConnectUsingSettings(_gameVersion);
.
public class Launcher : MonoBehaviour
{
#region Public Variables
#endregion
#region Private Variables
/// <summary>
/// Client version number, this number seperates users
/// </summary>
string _gameVersion = "1";
#endregion
#region Monobehavior callbacks
/// <summary>
/// Eary init method of monobehavior
/// </summary>
void Awake()
{
// #NotImportant
// Force Full LogLevel
PhotonNetwork.logLevel = PhotonLogLevel.Full;
PhotonNetwork.networkingPeer.DebugOut = ExitGames.Client.Photon.DebugLevel.ALL; // <---------- added this later but still no logs.
// #Critical
// we don't join the lobby. There is no need to join a lobby to get the list of rooms.
PhotonNetwork.autoJoinLobby = false;
// #Critical
// this makes sure we can use PhotonNetwork.LoadLevel() on the master client and all clients in the same room sync their level automatically
PhotonNetwork.automaticallySyncScene = true;
}
// Use this for initialization
void Start()
{
Connect();
}
/// <summary>
/// Start the connection process.
/// - If already connected, we attempt joining a random room
/// - if not yet connected, Connect this application instance to Photon Cloud Network
/// </summary>
public void Connect()
{
// we check if we are connected or not, we join if we are , else we initiate the connection to the server.
if (PhotonNetwork.connected)
{
// #Critical we need at this point to attempt joining a Random Room. If it fails, we'll get notified in OnPhotonRandomJoinFailed() and we'll create one.
PhotonNetwork.JoinRandomRoom();
}
else
{
// #Critical, we must first and foremost connect to Photon Online Server.
PhotonNetwork.ConnectUsingSettings(_gameVersion);
// <----------------------------- This is reached!
}
}
// Update is called once per frame
void Update()
{
}
#endregion
}
How can I enable full logging?
yes, the latest version of PUN now features logging settings in the Photon Settings themselves. So set it there. The updated tutorial and code should be up very soon on the website.