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