diff --git a/OpenRA.Launcher.Mac/JSBridge.m b/OpenRA.Launcher.Mac/JSBridge.m index 552268113b..53c9b79be3 100644 --- a/OpenRA.Launcher.Mac/JSBridge.m +++ b/OpenRA.Launcher.Mac/JSBridge.m @@ -44,6 +44,7 @@ static JSBridge *SharedInstance; @"log", NSStringFromSelector(@selector(log:)), @"existsInMod", NSStringFromSelector(@selector(fileExists:inMod:)), @"metadata", NSStringFromSelector(@selector(metadata:forMod:)), + @"httpRequest", NSStringFromSelector(@selector(httpRequest:)), // File downloading @"registerDownload", NSStringFromSelector(@selector(registerDownload:withURL:filename:)), @@ -232,4 +233,12 @@ static JSBridge *SharedInstance; return @""; } +- (NSString *)httpRequest:(NSString *)url +{ + NSLog(@"Requesting url %@",url); + NSString *response = [NSString stringWithContentsOfURL:[NSURL URLWithString:url] encoding:NSASCIIStringEncoding error:NULL]; + NSLog(@"Response %@",response); + return response; +} + @end diff --git a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA index 5540a8c82d..f22171139b 100755 Binary files a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA and b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA differ diff --git a/mods/cnc/mod.html b/mods/cnc/mod.html index 01c6c750d5..6a07594b86 100644 --- a/mods/cnc/mod.html +++ b/mods/cnc/mod.html @@ -44,6 +44,7 @@ { text-align: justify; padding-left:50px; + padding-right:50px; overflow:hidden; } @@ -125,7 +126,12 @@ function onLoad() { refreshSections(); - document.getElementById("versionstring").innerHTML = window.external.metadata("VERSION", "cnc"); + var version = window.external.metadata("VERSION", "cnc"); + document.getElementById("installedversion").innerHTML = version; + document.getElementById("latestversion").innerHTML = window.external.httpRequest("http://master.open-ra.org/VERSION"); + motd = window.external.httpRequest("http://master.open-ra.org/motd.php?v="+version); + if (motd != undefined) + document.getElementById("motd").innerHTML = motd.substring(3); } function refreshSections() @@ -212,21 +218,14 @@
- +
+

Latest version: Unknown

+

+