Removed the connecton approval callback missing warning when running as client

This commit is contained in:
Albin Corén 2018-01-06 12:52:53 +01:00
parent 3169ce5ead
commit 30d219dd4d

View File

@ -197,7 +197,7 @@ namespace MLAPI
spawnedObjects = new Dictionary<uint, NetworkedObject>();
spawnedObjectIds = new List<uint>();
releasedNetworkObjectIds = new Stack<uint>();
if(NetworkConfig.HandleObjectSpawning)
if (NetworkConfig.HandleObjectSpawning)
{
NetworkedObject[] sceneObjects = FindObjectsOfType<NetworkedObject>();
for (int i = 0; i < sceneObjects.Length; i++)
@ -208,14 +208,6 @@ namespace MLAPI
}
}
if (NetworkConfig.ConnectionApproval)
{
if(NetworkConfig.ConnectionApprovalCallback == null)
{
Debug.LogWarning("MLAPI: No ConnectionApproval callback defined. Connection approval will timeout");
}
}
NetworkTransport.Init();
ConnectionConfig cConfig = new ConnectionConfig();
@ -249,6 +241,14 @@ namespace MLAPI
public void StartServer(NetworkingConfiguration netConfig)
{
if (NetworkConfig.ConnectionApproval)
{
if (NetworkConfig.ConnectionApprovalCallback == null)
{
Debug.LogWarning("MLAPI: No ConnectionApproval callback defined. Connection approval will timeout");
}
}
SceneManager.LoadScene(PlaySceneIndex);
ConnectionConfig cConfig = Init(netConfig);
HostTopology hostTopology = new HostTopology(cConfig, NetworkConfig.MaxConnections);
@ -273,6 +273,14 @@ namespace MLAPI
public void StartHost(NetworkingConfiguration netConfig)
{
if (NetworkConfig.ConnectionApproval)
{
if (NetworkConfig.ConnectionApprovalCallback == null)
{
Debug.LogWarning("MLAPI: No ConnectionApproval callback defined. Connection approval will timeout");
}
}
SceneManager.LoadScene(PlaySceneIndex);
ConnectionConfig cConfig = Init(netConfig);
HostTopology hostTopology = new HostTopology(cConfig, NetworkConfig.MaxConnections);