public bool StartAsClient()
{
if (m_HostId != -1 || m_Running)
{
if (LogFilter.logWarn)
{
Debug.LogWarning("NetworkDiscovery StartAsClient already started");
}
return(false);
}
m_HostId = NetworkTransport.AddHost(m_DefaultTopology, m_BroadcastPort);
if (m_HostId == -1)
{
if (LogFilter.logError)
{
Debug.LogError("NetworkDiscovery StartAsClient - addHost failed");
}
return(false);
}
NetworkTransport.SetBroadcastCredentials(m_HostId, m_BroadcastKey, m_BroadcastVersion, m_BroadcastSubVersion, out byte _);
m_Running = true;
m_IsClient = true;
if (LogFilter.logDebug)
{
Debug.Log("StartAsClient Discovery listening");
}
return(true);
}