Use engine version for master server queries.
This commit is contained in:
committed by
Oliver Brakmann
parent
49f0e35bd7
commit
f7db7e3308
@@ -57,6 +57,8 @@ namespace OpenRA
|
|||||||
|
|
||||||
public static GlobalChat GlobalChat;
|
public static GlobalChat GlobalChat;
|
||||||
|
|
||||||
|
public static string EngineVersion { get; private set; }
|
||||||
|
|
||||||
static Task discoverNat;
|
static Task discoverNat;
|
||||||
|
|
||||||
public static OrderManager JoinServer(string host, int port, string password, bool recordReplay = true)
|
public static OrderManager JoinServer(string host, int port, string password, bool recordReplay = true)
|
||||||
@@ -246,6 +248,18 @@ namespace OpenRA
|
|||||||
{
|
{
|
||||||
Console.WriteLine("Platform is {0}", Platform.CurrentPlatform);
|
Console.WriteLine("Platform is {0}", Platform.CurrentPlatform);
|
||||||
|
|
||||||
|
// Load the engine version as early as possible so it can be written to exception logs
|
||||||
|
try
|
||||||
|
{
|
||||||
|
EngineVersion = File.ReadAllText(Platform.ResolvePath(Path.Combine(".", "VERSION"))).Trim();
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(EngineVersion))
|
||||||
|
EngineVersion = "Unknown";
|
||||||
|
|
||||||
|
Console.WriteLine("Engine version is {0}", EngineVersion);
|
||||||
|
|
||||||
// Special case handling of Game.Mod argument: if it matches a real filesystem path
|
// Special case handling of Game.Mod argument: if it matches a real filesystem path
|
||||||
// then we use this to override the mod search path, and replace it with the mod id
|
// then we use this to override the mod search path, and replace it with the mod id
|
||||||
var modID = args.GetValue("Game.Mod", null);
|
var modID = args.GetValue("Game.Mod", null);
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
// Send the mod and engine version to support version-filtered news (update prompts)
|
// Send the mod and engine version to support version-filtered news (update prompts)
|
||||||
newsURL += "?version={0}&mod={1}&modversion={2}".F(
|
newsURL += "?version={0}&mod={1}&modversion={2}".F(
|
||||||
Uri.EscapeUriString(Game.Mods["modcontent"].Metadata.Version),
|
Uri.EscapeUriString(Game.EngineVersion),
|
||||||
Uri.EscapeUriString(Game.ModData.Manifest.Id),
|
Uri.EscapeUriString(Game.ModData.Manifest.Id),
|
||||||
Uri.EscapeUriString(Game.ModData.Manifest.Metadata.Version));
|
Uri.EscapeUriString(Game.ModData.Manifest.Metadata.Version));
|
||||||
|
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
};
|
};
|
||||||
|
|
||||||
var queryURL = services.ServerList + "games?version={0}&mod={1}&modversion={2}".F(
|
var queryURL = services.ServerList + "games?version={0}&mod={1}&modversion={2}".F(
|
||||||
Uri.EscapeUriString(Game.Mods["modcontent"].Metadata.Version),
|
Uri.EscapeUriString(Game.EngineVersion),
|
||||||
Uri.EscapeUriString(Game.ModData.Manifest.Id),
|
Uri.EscapeUriString(Game.ModData.Manifest.Id),
|
||||||
Uri.EscapeUriString(Game.ModData.Manifest.Metadata.Version));
|
Uri.EscapeUriString(Game.ModData.Manifest.Metadata.Version));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user