From b5b6b47e955ce3f39feb0131c55fe8b5f646663c Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 24 Dec 2010 12:13:28 +1300 Subject: [PATCH] Implement metadata and httpRequest in the windows launcher. Untested. --- OpenRA.Launcher/JSBridge.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OpenRA.Launcher/JSBridge.cs b/OpenRA.Launcher/JSBridge.cs index 268918e43a..e9c0ea90a4 100644 --- a/OpenRA.Launcher/JSBridge.cs +++ b/OpenRA.Launcher/JSBridge.cs @@ -6,6 +6,7 @@ using System.IO; using System.Diagnostics; using System.Text.RegularExpressions; using System.Windows.Forms; +using System.Net; namespace OpenRA.Launcher { @@ -148,5 +149,20 @@ namespace OpenRA.Launcher return true; } + + public string metadata(string field, string mod) + { + if (field == "VERSION") + return allMods[mod].Version; + + return ""; + } + + public string httpRequest(string url) + { + var wc = new WebClient(); + var data = wc.DownloadData(new Uri(url)); + return Encoding.UTF8.GetString(data); + } } }