Use a shared url for news updates. Fixes #5603.
This commit is contained in:
@@ -35,7 +35,6 @@ namespace OpenRA
|
||||
public readonly InstallData ContentInstaller;
|
||||
public readonly Dictionary<string, Pair<string, int>> Fonts;
|
||||
public readonly Size TileSize = new Size(24, 24);
|
||||
public readonly string NewsUrl;
|
||||
public readonly TileShape TileShape = TileShape.Rectangle;
|
||||
|
||||
public Manifest(string mod)
|
||||
@@ -97,9 +96,6 @@ namespace OpenRA
|
||||
compat.Add(c.Trim());
|
||||
|
||||
MapCompatibility = compat.ToArray();
|
||||
|
||||
if (yaml.ContainsKey("NewsUrl"))
|
||||
NewsUrl = yaml["NewsUrl"].Value;
|
||||
}
|
||||
|
||||
static string[] YamlList(Dictionary<string, MiniYaml> yaml, string key)
|
||||
|
||||
@@ -141,6 +141,7 @@ namespace OpenRA
|
||||
public string MapRepository = "http://resource.openra.net/map/";
|
||||
|
||||
public bool FetchNews = true;
|
||||
public string NewsUrl = "http://www.openra.net/gamenews";
|
||||
public DateTime NewsFetchedDate;
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
newsStatus = newsPanel.Get<LabelWidget>("NEWS_STATUS");
|
||||
SetNewsStatus("Loading news");
|
||||
|
||||
if (Game.modData.Manifest.NewsUrl != null)
|
||||
if (Game.Settings.Game.NewsUrl != null)
|
||||
{
|
||||
var cacheFile = GetNewsCacheFile();
|
||||
var cacheValid = File.Exists(cacheFile) && DateTime.Today.ToUniversalTime() <= Game.Settings.Game.NewsFetchedDate;
|
||||
@@ -155,7 +155,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
if (cacheValid)
|
||||
DisplayNews(ReadNews(File.ReadAllBytes(cacheFile)));
|
||||
else
|
||||
new Download(Game.modData.Manifest.NewsUrl, e => { }, NewsDownloadComplete);
|
||||
new Download(Game.Settings.Game.NewsUrl, e => { }, NewsDownloadComplete);
|
||||
}
|
||||
|
||||
var newsButton = newsBG.GetOrNull<DropDownButtonWidget>("NEWS_BUTTON");
|
||||
|
||||
@@ -201,5 +201,3 @@ Missions:
|
||||
mods/cnc/missions.yaml
|
||||
|
||||
SupportsMapsFrom: cnc
|
||||
|
||||
NewsUrl: http://www.openra.net/gamenews
|
||||
|
||||
@@ -176,5 +176,3 @@ LuaScripts:
|
||||
mods/common/lua/facing.lua
|
||||
|
||||
SupportsMapsFrom: d2k
|
||||
|
||||
NewsUrl: http://www.openra.net/gamenews
|
||||
@@ -196,5 +196,3 @@ Missions:
|
||||
mods/ra/missions.yaml
|
||||
|
||||
SupportsMapsFrom: ra
|
||||
|
||||
NewsUrl: http://www.openra.net/gamenews
|
||||
@@ -217,5 +217,3 @@ LuaScripts:
|
||||
mods/common/lua/facing.lua
|
||||
|
||||
SupportsMapsFrom: ts
|
||||
|
||||
NewsUrl: http://www.openra.net/gamenews
|
||||
|
||||
Reference in New Issue
Block a user