Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 686 Bytes

README.md

File metadata and controls

33 lines (27 loc) · 686 Bytes

XboxKonnect

Usage

private ConsoleScanner _xboxKonnect;

private void InitializeXboxKonnect()
{
  _xboxKonnect = new ConsoleScanner
  {
    ScanFrequency = new TimeSpan(0, 0, 1),
    DisconnectTimeout = new TimeSpan(0, 0, 3),
    RemoveOnDisconnect = true,
  }.StartScanning();

  _xboxKonnect.AddConnectionEvent += delegate (object sender, OnAddConnectionEventArgs e)
  {
    var con = _xboxManager.OpenConsole(e.XboxConnection.IP.Address.ToString());

    try
    {
      e.XboxConnection.CPUKey = CPUKey.Parse(con.GetCPUKey());
    }
    catch (Exception ex)
    {
      Trace.WriteLine(ex);
    }

    Debug.WriteLine("Connection found: " + e.XboxConnection);
  };
}