private CompanionAppService() { Credentials = CompanionAppCredentials.Load(); // Need to work out our current state. //If we're missing username and password then we need to log in again /* * if (string.IsNullOrEmpty(Credentials.email) || string.IsNullOrEmpty(Credentials.password)) * { * CurrentState = State.NEEDS_LOGIN; * } * else */ if (string.IsNullOrEmpty(Credentials.machineId) || string.IsNullOrEmpty(Credentials.machineToken)) { CurrentState = State.NEEDS_LOGIN; } else if (string.IsNullOrEmpty(Credentials.appId)) { CurrentState = State.NEEDS_CONFIRMATION; } else { // Looks like we're ready but test it to find out CurrentState = State.READY; /* * try * { * Profile(); * } * catch (EliteDangerousCompanionAppException ex) * { * logger.log("Failed to obtain profile: " + ex.ToString()); * } */ } }