diff --git a/OpenRA.Game/Server/MasterServerQuery.cs b/OpenRA.Game/Server/MasterServerQuery.cs index afdfbd3ac7..8131b36493 100755 --- a/OpenRA.Game/Server/MasterServerQuery.cs +++ b/OpenRA.Game/Server/MasterServerQuery.cs @@ -51,36 +51,6 @@ namespace OpenRA.Server }).Start(); } - public static void GetMOTD(string masterServerUrl) - { - var motd = Widget.RootWidget.GetWidget("MOTD_SCROLLER"); - - // Runs in a separate thread to prevent dns lookup hitches - new Thread(() => - { - if (motd != null) - { - try - { - string motdText = GetData(new Uri(masterServerUrl + "motd.php?v=" + ClientVersion)); - string[] p = motdText.Split('|'); - if (p.Length == 2 && p[1].Length == int.Parse(p[0])) - { - motd.SetText(p[1]); - motd.ResetScroll(); - } - } - catch - { - motd.SetText("Welcome to OpenRA. MOTD unable to be loaded from server."); - motd.ResetScroll(); - } - } - - ev.Set(); - }).Start(); - } - public static void Tick() { if (ev.WaitOne(TimeSpan.FromMilliseconds(0))) @@ -95,23 +65,6 @@ namespace OpenRA.Server var data = wc.DownloadData(uri); return Encoding.UTF8.GetString(data); } - - public static void GetCurrentVersion(string masterServerUrl) - { - new Thread(() => - { - try - { - ServerVersion = GetData(new Uri(masterServerUrl + "VERSION")); - } - catch - { - ServerVersion = ""; - } - - ev2.Set(); - }).Start(); - } } public class GameServer diff --git a/OpenRA.Mods.RA/Widgets/Delegates/MainMenuButtonsDelegate.cs b/OpenRA.Mods.RA/Widgets/Delegates/MainMenuButtonsDelegate.cs index 353e09fba3..93dcad4aee 100755 --- a/OpenRA.Mods.RA/Widgets/Delegates/MainMenuButtonsDelegate.cs +++ b/OpenRA.Mods.RA/Widgets/Delegates/MainMenuButtonsDelegate.cs @@ -31,30 +31,6 @@ namespace OpenRA.Mods.RA.Widgets.Delegates widget.GetWidget("MAINMENU_BUTTON_REPLAY_VIEWER").OnMouseUp = mi => { Widget.OpenWindow("REPLAYBROWSER_BG"); return true; }; widget.GetWidget("MAINMENU_BUTTON_QUIT").OnMouseUp = mi => { Game.Exit(); return true; }; - var version = widget.GetWidget("VERSION_STRING"); - - if (FileSystem.Exists("VERSION")) - { - var s = FileSystem.Open("VERSION"); - var versionFileContent = s.ReadAllText(); - version.Text = versionFileContent; - s.Close(); - - MasterServerQuery.OnVersion += v => - { - if (!string.IsNullOrEmpty(v)) - version.Text = versionFileContent + "\nLatest: " + v; - }; - MasterServerQuery.GetCurrentVersion(Game.Settings.Server.MasterServer); - } - else - { - version.Text = "Dev Build"; - } - MasterServerQuery.ClientVersion = version.Text; - - MasterServerQuery.GetMOTD(Game.Settings.Server.MasterServer); - if (FirstInit) { FirstInit = false; diff --git a/mods/cnc/chrome/mainmenu.yaml b/mods/cnc/chrome/mainmenu.yaml index a6d2eb1f82..7013d9b680 100644 --- a/mods/cnc/chrome/mainmenu.yaml +++ b/mods/cnc/chrome/mainmenu.yaml @@ -6,39 +6,6 @@ Background@MAINMENU_BG: Height:330 Delegate:MainMenuButtonsDelegate Children: - Background@MOTD_BG: - Id:MOTD_BG - X:0 - PARENT_LEFT + WINDOW_RIGHT/3 - Y:0 - PARENT_TOP + 44 - Width:WINDOW_RIGHT/3 - Height:30 - Background:dialog4 - Children: - ScrollingText@MOTD_SCROLLER: - Id:MOTD_SCROLLER - X:15 - Y:2 - Width:PARENT_RIGHT - 30 - Height:25 - ScrollRate:8 - Text:Welcome to OpenRA. Enjoy your stay. - Background@MOTD_LABEL_BG - Id:MOTD_LABEL_BG - X:0 - PARENT_LEFT + (WINDOW_RIGHT/16)*7 - Y:0 - PARENT_TOP + 15 - Width:(WINDOW_RIGHT/16)*2 - Height:30 - Background:dialog4 - Children: - Label@MOTD_LABEL - Id:MOTD_LABEL - X:0 - Y:2 - Width:(WINDOW_RIGHT/16)*2 - Height:25 - Text:Message of the Day - Align:Center - Bold:True Label@MAINMENU_LABEL_TITLE: Id:MAINMENU_LABEL_TITLE X:0 @@ -80,13 +47,13 @@ Background@MAINMENU_BG: Height:25 Text:Music Bold:True - Button@MAINMENU_BUTTON_REPLAY_VIEWER: - Id:MAINMENU_BUTTON_REPLAY_VIEWER - X:45 - Y:230 - Width:160 - Height:25 - Text: Replay Viewer + Button@MAINMENU_BUTTON_REPLAY_VIEWER: + Id:MAINMENU_BUTTON_REPLAY_VIEWER + X:45 + Y:230 + Width:160 + Height:25 + Text: Replay Viewer Bold: True Button@MAINMENU_BUTTON_QUIT: Id:MAINMENU_BUTTON_QUIT @@ -105,15 +72,6 @@ Background@MAINMENU_BG: Height:25 Text:Video Player Bold:True - Label@VERSION_STRING: - Id:VERSION_STRING - X:WINDOW_RIGHT - PARENT_LEFT - WIDTH - 15 - Y:WINDOW_BOTTOM - PARENT_TOP - 65 - Width:400 - Height:70 - Text: - Align:Right - Bold:True Background@PERF_BG: ClickThrough:true Id:PERF_BG diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index 0ec7d36481..3c923e886f 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -1,7 +1,7 @@ Metadata: Title: C&C Description: OpenRA Reimagining of the classic game - Version: a0001 + Version: {DEV_VERSION} Author: The OpenRA Developers Standalone: true Folders: diff --git a/mods/ra/chrome/mainmenu.yaml b/mods/ra/chrome/mainmenu.yaml index ac2b3d299d..713eff510c 100644 --- a/mods/ra/chrome/mainmenu.yaml +++ b/mods/ra/chrome/mainmenu.yaml @@ -6,39 +6,6 @@ Background@MAINMENU_BG: Height:330 Delegate:MainMenuButtonsDelegate Children: - Background@MOTD_BG: - Id:MOTD_BG - X:0 - PARENT_LEFT + WINDOW_RIGHT/3 - Y:0 - PARENT_TOP + 44 - Width:WINDOW_RIGHT/3 - Height:30 - Background:dialog4 - Children: - ScrollingText@MOTD_SCROLLER: - Id:MOTD_SCROLLER - X:15 - Y:2 - Width:PARENT_RIGHT - 30 - Height:25 - ScrollRate:8 - Text:Welcome to OpenRA. Enjoy your stay. - Background@MOTD_LABEL_BG - Id:MOTD_LABEL_BG - X:0 - PARENT_LEFT + (WINDOW_RIGHT/16)*7 - Y:0 - PARENT_TOP + 15 - Width:(WINDOW_RIGHT/16)*2 - Height:30 - Background:dialog4 - Children: - Label@MOTD_LABEL - Id:MOTD_LABEL - X:0 - Y:2 - Width:(WINDOW_RIGHT/16)*2 - Height:25 - Text:Message of the Day - Align:Center - Bold:True Label@MAINMENU_LABEL_TITLE: Id:MAINMENU_LABEL_TITLE X:0 @@ -105,15 +72,6 @@ Background@MAINMENU_BG: Height:25 Text:Video Player Bold:True - Label@VERSION_STRING: - Id:VERSION_STRING - X:WINDOW_RIGHT - PARENT_LEFT - WIDTH - 15 - Y:WINDOW_BOTTOM - PARENT_TOP - 65 - Width:400 - Height:70 - Text: - Align:Right - Bold:True Background@PERF_BG: ClickThrough:true Id:PERF_BG diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index 3b70eb98bc..b21791947a 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -1,7 +1,7 @@ Metadata: Title: Red Alert Description: OpenRA Reimagining of the classic game - Version: a0001 + Version: {DEV_VERSION} Author: The OpenRA Developers Standalone: true diff --git a/packaging/package-all.sh b/packaging/package-all.sh index 20c89fc546..1dccb5426d 100755 --- a/packaging/package-all.sh +++ b/packaging/package-all.sh @@ -18,7 +18,6 @@ OUTPUTDIR=$(readlink -f $2) cd "$SRCDIR" mkdir packaging/built mkdir packaging/built/mods -echo $1 > VERSION make package # Remove the mdb files that are created during `make` @@ -29,7 +28,7 @@ find . -path "*.mdb" -delete # they are now installed to the game directory instead of placed in the gac FILES="OpenRA.Launcher.exe OpenRA.Game.exe OpenRA.Editor.exe OpenRA.Utility.exe OpenRA.Renderer.Cg.dll \ OpenRA.Renderer.Gl.dll OpenRA.Renderer.Null.dll OpenRA.FileFormats.dll FreeSans.ttf FreeSansBold.ttf titles.ttf \ -cg glsl mods/ra mods/cnc VERSION COPYING HACKING INSTALL" +cg glsl mods/ra mods/cnc COPYING HACKING INSTALL" echo "Copying files..." for i in $FILES; do @@ -45,6 +44,11 @@ cp thirdparty/ICSharpCode.SharpZipLib.dll packaging/built # Copy game icon for windows package cp OpenRA.Game/OpenRA.ico packaging/built +# Update mod versions +sed -i "" "s/{DEV_VERSION}/$VERSION/" ./packaging/built/mods/ra/mod.yaml +sed -i "" "s/{DEV_VERSION}/$VERSION/" ./packaging/built/mods/cnc/mod.yaml + + # # Change into packaging directory and run the # platform-dependant packaging in parallel diff --git a/packaging/windows/OpenRA.nsi b/packaging/windows/OpenRA.nsi index c7e9b7209d..23b14e3eef 100644 --- a/packaging/windows/OpenRA.nsi +++ b/packaging/windows/OpenRA.nsi @@ -87,7 +87,6 @@ Section "Client" Client File "${SRCDIR}\HACKING" File "${SRCDIR}\INSTALL" File "${SRCDIR}\*.ttf" - File "${SRCDIR}\VERSION" File "${SRCDIR}\OpenRA.ico" File "${SRCDIR}\Tao.*.dll" @@ -293,7 +292,6 @@ Function ${UN}Clean Delete $INSTDIR\COPYING Delete $INSTDIR\HACKING Delete $INSTDIR\INSTALL - Delete $INSTDIR\VERSION Delete $INSTDIR\OpenRA.ico Delete $INSTDIR\*.ttf Delete $INSTDIR\settings-netplay-*.ini