IEnumerator HeadlessClientLifecycle()
        {
            if (m_HeadlessShouldQos)
            {
                yield return(DoQosAsync());
            }

            if (m_HeadlessShouldMatchmake)
            {
                yield return(DoMatchmakingAsync());
            }

            if (m_HeadlessShouldPingServer)
            {
                yield return(DoPingAsync());
            }

            if (m_HeadlessShouldTerminateServer)
            {
                UdpPingWrapper.TryTerminateRemoteServer(m_CustomIp);
            }

            Debug.Log("Finished headless mode tasks, shutting down...");
            ShutDown(ExitCode.Ok);
        }
예제 #2
0
        void TerminateRemoteServer()
        {
            if (m_UdpPing != null)
            {
                m_UdpPing.TryTerminateRemoteServer();
                m_UdpPing.Dispose();
                m_UdpPing = null;
            }
            else
            {
                UdpPingWrapper.TryTerminateRemoteServer(m_PingServerEndpoint);
            }

            m_State = MatchmakingState.Idle;
        }