diff --git a/moonlight-common/src/com/limelight/nvstream/http/ComputerDetails.java b/moonlight-common/src/com/limelight/nvstream/http/ComputerDetails.java index 512f99dc..31890de4 100644 --- a/moonlight-common/src/com/limelight/nvstream/http/ComputerDetails.java +++ b/moonlight-common/src/com/limelight/nvstream/http/ComputerDetails.java @@ -21,6 +21,7 @@ public class ComputerDetails { public PairingManager.PairState pairState; public String macAddress; public int runningGameId; + public String rawAppList; public ComputerDetails() { // Use defaults @@ -43,6 +44,7 @@ public class ComputerDetails { this.macAddress = details.macAddress; this.pairState = details.pairState; this.runningGameId = details.runningGameId; + this.rawAppList = details.rawAppList; } @Override diff --git a/moonlight-common/src/com/limelight/nvstream/http/NvApp.java b/moonlight-common/src/com/limelight/nvstream/http/NvApp.java index 70ef03ea..268df60a 100644 --- a/moonlight-common/src/com/limelight/nvstream/http/NvApp.java +++ b/moonlight-common/src/com/limelight/nvstream/http/NvApp.java @@ -17,6 +17,10 @@ public class NvApp { this.isRunning = isRunning.equals("1"); } + public void setIsRunningBoolean(boolean isRunning) { + this.isRunning = isRunning; + } + public String getAppName() { return this.appName; } diff --git a/moonlight-common/src/com/limelight/nvstream/http/NvHTTP.java b/moonlight-common/src/com/limelight/nvstream/http/NvHTTP.java index a8d3979b..34380522 100644 --- a/moonlight-common/src/com/limelight/nvstream/http/NvHTTP.java +++ b/moonlight-common/src/com/limelight/nvstream/http/NvHTTP.java @@ -304,13 +304,12 @@ public class NvHTTP { return pm.pair(uniqueId, pin); } - public LinkedList getAppList() throws GfeHttpResponseException, IOException, XmlPullParserException { - ResponseBody resp = openHttpConnection(baseUrl + "/applist?uniqueid=" + uniqueId, true); + public static LinkedList getAppListByReader(Reader r) throws XmlPullParserException, IOException { XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware(true); XmlPullParser xpp = factory.newPullParser(); - xpp.setInput(new InputStreamReader(resp.byteStream())); + xpp.setInput(r); int eventType = xpp.getEventType(); LinkedList appList = new LinkedList(); Stack currentTag = new Stack(); @@ -342,9 +341,18 @@ public class NvHTTP { } eventType = xpp.next(); } - + + return appList; + } + + public String getAppListRaw() throws MalformedURLException, IOException { + return openHttpConnectionToString(baseUrl + "/applist?uniqueid=" + uniqueId, true); + } + + public LinkedList getAppList() throws GfeHttpResponseException, IOException, XmlPullParserException { + ResponseBody resp = openHttpConnection(baseUrl + "/applist?uniqueid=" + uniqueId, true); + LinkedList appList = getAppListByReader(new InputStreamReader(resp.byteStream())); resp.close(); - return appList; }