Merge pull request #13141 from pchote/mod-urls

Move web urls from user config to mod config.
This commit is contained in:
Oliver Brakmann
2017-04-17 17:13:52 +02:00
committed by GitHub
11 changed files with 54 additions and 23 deletions

View File

@@ -113,7 +113,7 @@ namespace OpenRA
}
}
public void QueryRemoteMapDetails(IEnumerable<string> uids, Action<MapPreview> mapDetailsReceived = null, Action queryFailed = null)
public void QueryRemoteMapDetails(string repositoryUrl, IEnumerable<string> uids, Action<MapPreview> mapDetailsReceived = null, Action queryFailed = null)
{
var maps = uids.Distinct()
.Select(uid => previews[uid])
@@ -126,7 +126,7 @@ namespace OpenRA
foreach (var p in maps.Values)
p.UpdateRemoteSearch(MapStatus.Searching, null);
var url = Game.Settings.Game.MapRepository + "hash/" + string.Join(",", maps.Keys) + "/yaml";
var url = repositoryUrl + "hash/" + string.Join(",", maps.Keys) + "/yaml";
Action<DownloadDataCompletedEventArgs> onInfoComplete = i =>
{

View File

@@ -123,8 +123,8 @@ namespace OpenRA
}
static readonly CPos[] NoSpawns = new CPos[] { };
MapCache cache;
ModData modData;
readonly MapCache cache;
readonly ModData modData;
public readonly string Uid;
public IReadOnlyPackage Package { get; private set; }
@@ -416,7 +416,7 @@ namespace OpenRA
innerData = newData;
}
public void Install(Action onSuccess)
public void Install(string mapRepositoryUrl, Action onSuccess)
{
if (Status != MapStatus.DownloadAvailable || !Game.Settings.Game.AllowDownloading)
return;
@@ -431,12 +431,11 @@ namespace OpenRA
}
var mapInstallPackage = installLocation.Key as IReadWritePackage;
var modData = Game.ModData;
new Thread(() =>
{
// Request the filename from the server
// Run in a worker thread to avoid network delays
var mapUrl = Game.Settings.Game.MapRepository + Uid;
var mapUrl = mapRepositoryUrl + Uid;
var mapFilename = string.Empty;
try
{

View File

@@ -51,8 +51,6 @@ namespace OpenRA
[Desc("Locks the game with a password.")]
public string Password = "";
public string MasterServer = "http://master.openra.net/";
[Desc("Allow users to enable NAT discovery for external IP detection and automatic port forwarding.")]
public bool DiscoverNatDevices = false;
@@ -175,13 +173,11 @@ namespace OpenRA
public bool DrawTargetLine = true;
public bool AllowDownloading = true;
public string MapRepository = "http://resource.openra.net/map/";
public bool AllowZoom = true;
public Modifiers ZoomModifier = Modifiers.Ctrl;
public bool FetchNews = true;
public string NewsUrl = "http://master.openra.net/gamenews";
public MPGameFilters MPGameFilters = MPGameFilters.Waiting | MPGameFilters.Empty | MPGameFilters.Protected | MPGameFilters.Started;
}