Пример #1
0
    public static void Disconnect()
    {
        if (!m_ActiveConnection)
        {
            return;
        }

        try
        {
            if (m_XboxConsole.DebugTarget.IsDebuggerConnected(out string debuggerName, out string userName))
            {
                m_XboxConsole.DebugTarget.DisconnectAsDebugger();
            }

            if (m_XboxConnection != 0)
            {
                m_XboxConsole.CloseConnection(m_XboxConnection);
                m_ActiveConnection = false;
            }
        }
        catch (Exception)
        {
            throw new Exception("Could not disconnect from console: " + m_XboxConsole.Name);
        }
    }