httpRequest in win launcher uses utility program. Clean up usings and add missing license notices.

This commit is contained in:
Matthew Bowra-Dean
2010-12-31 14:40:38 +13:00
committed by Chris Forbes
parent de5d9abec3
commit a4493f48d5
6 changed files with 37 additions and 24 deletions

View File

@@ -1,9 +1,15 @@
using System; #region Copyright & License Information
using System.Collections.Generic; /*
using System.Linq; * Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
using System.Text; * This file is part of OpenRA, which is free software. It is made
using System.IO; * available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see LICENSE.
*/
#endregion
using System;
using System.ComponentModel; using System.ComponentModel;
using System.IO;
using System.IO.Pipes; using System.IO.Pipes;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Windows.Forms; using System.Windows.Forms;
@@ -166,7 +172,6 @@ namespace OpenRA.Launcher
void DoExtraction(object sender, DoWorkEventArgs e) void DoExtraction(object sender, DoWorkEventArgs e)
{ {
var bgWorker = sender as BackgroundWorker;
string[] args = e.Argument as string[]; string[] args = e.Argument as string[];
string zipFile = args[0]; string zipFile = args[0];
string destPath = args[1]; string destPath = args[1];

View File

@@ -1,12 +1,19 @@
using System; #region Copyright & License Information
/*
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see LICENSE.
*/
#endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics; using System.Diagnostics;
using System.IO;
using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Windows.Forms; using System.Windows.Forms;
using System.Net;
namespace OpenRA.Launcher namespace OpenRA.Launcher
{ {
@@ -160,9 +167,7 @@ namespace OpenRA.Launcher
public string httpRequest(string url) public string httpRequest(string url)
{ {
var wc = new WebClient(); return UtilityProgram.CallSimpleResponse("--download-url", url);
var data = wc.DownloadData(new Uri(url));
return Encoding.UTF8.GetString(data);
} }
} }
} }

View File

@@ -120,7 +120,7 @@ namespace OpenRA.Launcher
using (var response = new StreamReader(pipe)) using (var response = new StreamReader(pipe))
{ {
string s = response.ReadToEnd(); response.ReadToEnd();
} }
RefreshMods(); RefreshMods();

View File

@@ -1,7 +1,13 @@
using System; #region Copyright & License Information
using System.Collections.Generic; /*
using System.Linq; * Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
using System.Text; * This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see LICENSE.
*/
#endregion
using System;
namespace OpenRA.Launcher namespace OpenRA.Launcher
{ {

View File

@@ -9,9 +9,6 @@
#endregion #endregion
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows.Forms; using System.Windows.Forms;

View File

@@ -12,8 +12,8 @@ using System;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Text;
using System.IO.Pipes; using System.IO.Pipes;
using System.Text;
namespace OpenRA.Launcher namespace OpenRA.Launcher
{ {
@@ -81,7 +81,7 @@ namespace OpenRA.Launcher
public static string CallSimpleResponse(string command, params string[] args) public static string CallSimpleResponse(string command, params string[] args)
{ {
var p = Call(command, args); Call(command, args);
string responseString; string responseString;
NamedPipeClientStream pipe = new NamedPipeClientStream(".", "OpenRA.Utility", PipeDirection.In); NamedPipeClientStream pipe = new NamedPipeClientStream(".", "OpenRA.Utility", PipeDirection.In);
pipe.Connect(); pipe.Connect();