From 2150a5e86507992ec3fdd3b792058e13077b7a67 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 4 Jul 2015 13:02:10 +0100 Subject: [PATCH 1/5] Move ChooseInitialMap to MapCache. --- OpenRA.Game/Game.cs | 2 +- OpenRA.Game/Map/MapCache.cs | 12 ++++++++++++ OpenRA.Game/Widgets/WidgetUtils.cs | 12 ------------ OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs | 2 +- OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs | 8 ++++---- .../Widgets/Logic/ServerCreationLogic.cs | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index a3938158cb..425877fb82 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -402,7 +402,7 @@ namespace OpenRA { while (true) { - Settings.Server.Map = WidgetUtils.ChooseInitialMap(Settings.Server.Map); + Settings.Server.Map = ModData.MapCache.ChooseInitialMap(Settings.Server.Map); Settings.Save(); CreateServer(Settings.Server.Clone()); diff --git a/OpenRA.Game/Map/MapCache.cs b/OpenRA.Game/Map/MapCache.cs index a05bd954f3..367a1b0fb9 100644 --- a/OpenRA.Game/Map/MapCache.cs +++ b/OpenRA.Game/Map/MapCache.cs @@ -237,6 +237,18 @@ namespace OpenRA }); } + public string ChooseInitialMap(string initialUid) + { + if (string.IsNullOrEmpty(initialUid) || previews[initialUid].Status != MapStatus.Available) + { + var selected = previews.Values.Where(x => x.SuitableForInitialMap).RandomOrDefault(Game.CosmeticRandom) ?? + previews.Values.First(m => m.Status == MapStatus.Available && m.Visibility.HasFlag(MapVisibility.Lobby)); + return selected.Uid; + } + + return initialUid; + } + public MapPreview this[string key] { get { return previews[key]; } diff --git a/OpenRA.Game/Widgets/WidgetUtils.cs b/OpenRA.Game/Widgets/WidgetUtils.cs index acd01e4e77..7bf71d6b4c 100644 --- a/OpenRA.Game/Widgets/WidgetUtils.cs +++ b/OpenRA.Game/Widgets/WidgetUtils.cs @@ -248,18 +248,6 @@ namespace OpenRA.Widgets return trimmed; } - - public static string ChooseInitialMap(string initialUid) - { - if (string.IsNullOrEmpty(initialUid) || Game.ModData.MapCache[initialUid].Status != MapStatus.Available) - { - var selected = Game.ModData.MapCache.Where(x => x.SuitableForInitialMap).RandomOrDefault(Game.CosmeticRandom) ?? - Game.ModData.MapCache.First(m => m.Status == MapStatus.Available && m.Visibility.HasFlag(MapVisibility.Lobby)); - return selected.Uid; - } - - return initialUid; - } } public class CachedTransform diff --git a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs index 8150aebb37..7e97082330 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs @@ -380,7 +380,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic void StartSkirmishGame() { - var map = WidgetUtils.ChooseInitialMap(Game.Settings.Server.Map); + var map = Game.ModData.MapCache.ChooseInitialMap(Game.Settings.Server.Map); Game.Settings.Server.Map = map; Game.Settings.Save(); diff --git a/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs index 9d84fef4be..8ce3421e5a 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs @@ -126,12 +126,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (initialMap == null && tabMaps.Keys.Contains(initialTab) && tabMaps[initialTab].Any()) { - selectedUid = WidgetUtils.ChooseInitialMap(tabMaps[initialTab].Select(mp => mp.Uid).First()); + selectedUid = Game.ModData.MapCache.ChooseInitialMap(tabMaps[initialTab].Select(mp => mp.Uid).First()); currentTab = initialTab; } else { - selectedUid = WidgetUtils.ChooseInitialMap(initialMap); + selectedUid = Game.ModData.MapCache.ChooseInitialMap(initialMap); currentTab = tabMaps.Keys.FirstOrDefault(k => tabMaps[k].Select(mp => mp.Uid).Contains(selectedUid)); } @@ -313,7 +313,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic { modData.MapCache[map].Delete(); if (selectedUid == map) - selectedUid = WidgetUtils.ChooseInitialMap(tabMaps[currentTab].Select(mp => mp.Uid).FirstOrDefault()); + selectedUid = Game.ModData.MapCache.ChooseInitialMap(tabMaps[currentTab].Select(mp => mp.Uid).FirstOrDefault()); } catch (Exception ex) { @@ -348,7 +348,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic { maps.Do(m => DeleteMap(m)); if (after != null) - after(WidgetUtils.ChooseInitialMap(null)); + after(Game.ModData.MapCache.ChooseInitialMap(null)); }, confirmText: "Delete", onCancel: () => { }); diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs index 78f23e20d9..7e678638bd 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs @@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic this.onExit = onExit; var settings = Game.Settings; - preview = modData.MapCache[WidgetUtils.ChooseInitialMap(Game.Settings.Server.Map)]; + preview = modData.MapCache[modData.MapCache.ChooseInitialMap(Game.Settings.Server.Map)]; panel.Get("CREATE_BUTTON").OnClick = CreateAndJoin; From fee899f63dd40abbdeed553171b58f7f0d052b2a Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 29 Mar 2016 22:30:29 +0100 Subject: [PATCH 2/5] Fix unnecessary uses of Game.ModData. --- OpenRA.Game/Map/MapCache.cs | 2 +- OpenRA.Game/Server/Server.cs | 2 +- OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Game/Map/MapCache.cs b/OpenRA.Game/Map/MapCache.cs index 367a1b0fb9..b116df9d63 100644 --- a/OpenRA.Game/Map/MapCache.cs +++ b/OpenRA.Game/Map/MapCache.cs @@ -81,7 +81,7 @@ namespace OpenRA if (!modData.Manifest.Contains()) return; - var mapGrid = Game.ModData.Manifest.Get(); + var mapGrid = modData.Manifest.Get(); foreach (var kv in MapLocations) { foreach (var map in kv.Key.Contents) diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index a51f487910..6271ecdc01 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -418,7 +418,7 @@ namespace OpenRA.Server int latency = 1; if (!LobbyInfo.IsSinglePlayer) { - var gameSpeeds = Game.ModData.Manifest.Get(); + var gameSpeeds = ModData.Manifest.Get(); GameSpeed speed; if (gameSpeeds.Speeds.TryGetValue(LobbyInfo.GlobalSettings.GameSpeedType, out speed)) latency = speed.OrderLatency; diff --git a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs index 671cb96374..55a3731a8c 100644 --- a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs +++ b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs @@ -719,7 +719,7 @@ namespace OpenRA.Mods.Common.Server return true; } - var gameSpeeds = Game.ModData.Manifest.Get(); + var gameSpeeds = server.ModData.Manifest.Get(); GameSpeed speed; if (!gameSpeeds.Speeds.TryGetValue(s, out speed)) From b5c2703eba053b7f39f753aa20bbf6bc70f22a61 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 29 Mar 2016 22:36:48 +0100 Subject: [PATCH 3/5] Pass random to ChooseInitialMap. --- OpenRA.Game/Game.cs | 2 +- OpenRA.Game/Map/MapCache.cs | 5 +++-- OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs | 2 +- OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs | 10 ++++++---- .../Widgets/Logic/ServerCreationLogic.cs | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 425877fb82..373fb11504 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -402,7 +402,7 @@ namespace OpenRA { while (true) { - Settings.Server.Map = ModData.MapCache.ChooseInitialMap(Settings.Server.Map); + Settings.Server.Map = ModData.MapCache.ChooseInitialMap(Settings.Server.Map, CosmeticRandom); Settings.Save(); CreateServer(Settings.Server.Clone()); diff --git a/OpenRA.Game/Map/MapCache.cs b/OpenRA.Game/Map/MapCache.cs index b116df9d63..671f57d7f3 100644 --- a/OpenRA.Game/Map/MapCache.cs +++ b/OpenRA.Game/Map/MapCache.cs @@ -20,6 +20,7 @@ using System.Threading; using OpenRA.FileSystem; using OpenRA.Graphics; using OpenRA.Primitives; +using OpenRA.Support; namespace OpenRA { @@ -237,11 +238,11 @@ namespace OpenRA }); } - public string ChooseInitialMap(string initialUid) + public string ChooseInitialMap(string initialUid, MersenneTwister random) { if (string.IsNullOrEmpty(initialUid) || previews[initialUid].Status != MapStatus.Available) { - var selected = previews.Values.Where(x => x.SuitableForInitialMap).RandomOrDefault(Game.CosmeticRandom) ?? + var selected = previews.Values.Where(x => x.SuitableForInitialMap).RandomOrDefault(random) ?? previews.Values.First(m => m.Status == MapStatus.Available && m.Visibility.HasFlag(MapVisibility.Lobby)); return selected.Uid; } diff --git a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs index 7e97082330..835df544d2 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs @@ -380,7 +380,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic void StartSkirmishGame() { - var map = Game.ModData.MapCache.ChooseInitialMap(Game.Settings.Server.Map); + var map = Game.ModData.MapCache.ChooseInitialMap(Game.Settings.Server.Map, Game.CosmeticRandom); Game.Settings.Server.Map = map; Game.Settings.Save(); diff --git a/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs index 8ce3421e5a..f87535b3fc 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs @@ -126,12 +126,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (initialMap == null && tabMaps.Keys.Contains(initialTab) && tabMaps[initialTab].Any()) { - selectedUid = Game.ModData.MapCache.ChooseInitialMap(tabMaps[initialTab].Select(mp => mp.Uid).First()); + selectedUid = Game.ModData.MapCache.ChooseInitialMap(tabMaps[initialTab].Select(mp => mp.Uid).First(), + Game.CosmeticRandom); currentTab = initialTab; } else { - selectedUid = Game.ModData.MapCache.ChooseInitialMap(initialMap); + selectedUid = Game.ModData.MapCache.ChooseInitialMap(initialMap, Game.CosmeticRandom); currentTab = tabMaps.Keys.FirstOrDefault(k => tabMaps[k].Select(mp => mp.Uid).Contains(selectedUid)); } @@ -313,7 +314,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic { modData.MapCache[map].Delete(); if (selectedUid == map) - selectedUid = Game.ModData.MapCache.ChooseInitialMap(tabMaps[currentTab].Select(mp => mp.Uid).FirstOrDefault()); + selectedUid = Game.ModData.MapCache.ChooseInitialMap(tabMaps[currentTab].Select(mp => mp.Uid).FirstOrDefault(), + Game.CosmeticRandom); } catch (Exception ex) { @@ -348,7 +350,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic { maps.Do(m => DeleteMap(m)); if (after != null) - after(Game.ModData.MapCache.ChooseInitialMap(null)); + after(Game.ModData.MapCache.ChooseInitialMap(null, Game.CosmeticRandom)); }, confirmText: "Delete", onCancel: () => { }); diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs index 7e678638bd..1ced376947 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs @@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic this.onExit = onExit; var settings = Game.Settings; - preview = modData.MapCache[modData.MapCache.ChooseInitialMap(Game.Settings.Server.Map)]; + preview = modData.MapCache[modData.MapCache.ChooseInitialMap(Game.Settings.Server.Map, Game.CosmeticRandom)]; panel.Get("CREATE_BUTTON").OnClick = CreateAndJoin; From 706d3ae52a31d7fdb606d35ca2ee1eb0d53af516 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 4 Jul 2015 12:12:44 +0100 Subject: [PATCH 4/5] Move dedicated server code to OpenRA.Server.exe --- Makefile | 29 +++++- OpenRA.Game/Game.cs | 45 +-------- OpenRA.Game/Renderer.cs | 10 +- OpenRA.Game/Server/Server.cs | 17 ++-- OpenRA.Game/Settings.cs | 6 -- .../ServerTraits/PlayerPinger.cs | 2 +- OpenRA.Server/OpenRA.Server.csproj | 99 +++++++++++++++++++ OpenRA.Server/Program.cs | 58 +++++++++++ OpenRA.sln | 6 ++ launch-dedicated.sh | 4 +- launch-game.sh | 2 +- packaging/package-all.sh | 2 +- packaging/windows/OpenRA.nsi | 2 + 13 files changed, 212 insertions(+), 70 deletions(-) create mode 100644 OpenRA.Server/OpenRA.Server.csproj create mode 100644 OpenRA.Server/Program.cs diff --git a/Makefile b/Makefile index 17a7f27fdf..a9600dcb0f 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ INSTALL_PROGRAM = $(INSTALL) -m755 INSTALL_DATA = $(INSTALL) -m644 # program targets -CORE = pdefault pnull game utility +CORE = pdefault pnull game utility server TOOLS = gamemonitor VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`) @@ -231,6 +231,9 @@ check: utility mods @echo @echo "Checking for explicit interface violations..." @mono --debug OpenRA.Utility.exe all --check-explicit-interfaces + @echo + @echo "Checking for code style violations in OpenRA.Server..." + @mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.Server NUNIT_CONSOLE := $(shell test -f thirdparty/download/nunit3-console.exe && echo mono thirdparty/download/nunit3-console.exe || \ which nunit3-console 2>/dev/null || which nunit2-console 2>/dev/null || which nunit-console 2>/dev/null) @@ -286,6 +289,15 @@ utility_LIBS = $(COMMON_LIBS) $(utility_DEPS) thirdparty/download/ICSharpCode.Sh PROGRAMS += utility utility: $(utility_TARGET) +# Dedicated server +server_SRCS := $(shell find OpenRA.Server/ -iname '*.cs') +server_TARGET = OpenRA.Server.exe +server_KIND = exe +server_DEPS = $(game_TARGET) +server_LIBS = $(COMMON_LIBS) $(server_DEPS) +PROGRAMS += server +server: $(server_TARGET) + # Patches binary headers to work around a mono bug fixheader.exe: packaging/fixheader.cs @echo CSC fixheader.exe @@ -315,7 +327,7 @@ $(foreach prog,$(PROGRAMS),$(eval $(call BUILD_ASSEMBLY,$(prog)))) # default: core -core: game platforms mods utility +core: game platforms mods utility server tools: gamemonitor @@ -465,9 +477,22 @@ endif @$(INSTALL_PROGRAM) -m +rx openra "$(BIN_INSTALL_DIR)" @-$(RM) openra + @echo "#!/bin/sh" > openra-server + @echo 'cd "$(gameinstalldir)"' >> openra-server +ifeq ($(DEBUG), $(filter $(DEBUG),false no n off 0)) + @echo 'mono OpenRA.Server.exe "$$@"' >> openra-server +else + @echo 'mono --debug OpenRA.Server.exe "$$@"' >> openra-server +endif + + @$(INSTALL_DIR) "$(BIN_INSTALL_DIR)" + @$(INSTALL_PROGRAM) -m +rx openra-server "$(BIN_INSTALL_DIR)" + @-$(RM) openra-server + uninstall: @-$(RM_R) "$(DATA_INSTALL_DIR)" @-$(RM_F) "$(BIN_INSTALL_DIR)/openra" + @-$(RM_F) "$(BIN_INSTALL_DIR)/openra-server" @-$(RM_F) "$(DESTDIR)$(datadir)/applications/openra.desktop" @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/16x16/apps/openra.png" @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/openra.png" diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 373fb11504..64031fe1e3 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -279,7 +279,7 @@ namespace OpenRA } } - Sound = new Sound(Settings.Server.Dedicated ? "Null" : Settings.Sound.Engine); + Sound = new Sound(Settings.Sound.Engine); GlobalChat = new GlobalChat(); @@ -341,17 +341,11 @@ namespace OpenRA Sound.StopVideo(); - ModData = new ModData(mod, !Settings.Server.Dedicated); + ModData = new ModData(mod, true); using (new PerfTimer("LoadMaps")) ModData.MapCache.LoadMaps(); - if (Settings.Server.Dedicated) - { - RunDedicatedServer(); - Environment.Exit(0); - } - var installData = ModData.Manifest.Get(); var isModContentInstalled = installData.TestFiles.All(f => File.Exists(Platform.ResolvePath(f))); @@ -398,37 +392,6 @@ namespace OpenRA ModData.LoadScreen.StartGame(args); } - public static void RunDedicatedServer() - { - while (true) - { - Settings.Server.Map = ModData.MapCache.ChooseInitialMap(Settings.Server.Map, CosmeticRandom); - Settings.Save(); - CreateServer(Settings.Server.Clone()); - - while (true) - { - Thread.Sleep(100); - - if (server.State == Server.ServerState.GameStarted && server.Conns.Count < 1) - { - Console.WriteLine("No one is playing, shutting down..."); - server.Shutdown(); - break; - } - } - - if (Settings.Server.DedicatedLoop) - { - Console.WriteLine("Starting a new server instance..."); - ModData.MapCache.LoadMaps(); - continue; - } - - break; - } - } - public static void LoadEditor(string mapUid) { StartGame(mapUid, WorldType.Editor); @@ -811,7 +774,7 @@ namespace OpenRA public static void CreateServer(ServerSettings settings) { - server = new Server.Server(new IPEndPoint(IPAddress.Any, settings.ListenPort), settings, ModData); + server = new Server.Server(new IPEndPoint(IPAddress.Any, settings.ListenPort), settings, ModData, false); } public static int CreateLocalServer(string map) @@ -824,7 +787,7 @@ namespace OpenRA AllowPortForward = false }; - server = new Server.Server(new IPEndPoint(IPAddress.Loopback, 0), settings, ModData); + server = new Server.Server(new IPEndPoint(IPAddress.Loopback, 0), settings, ModData, false); return server.Port; } diff --git a/OpenRA.Game/Renderer.cs b/OpenRA.Game/Renderer.cs index 04232b179f..4690dae2e4 100644 --- a/OpenRA.Game/Renderer.cs +++ b/OpenRA.Game/Renderer.cs @@ -50,16 +50,12 @@ namespace OpenRA { var resolution = GetResolution(graphicSettings); - var rendererName = serverSettings.Dedicated ? "Null" : graphicSettings.Renderer; + var rendererName = graphicSettings.Renderer; var rendererPath = Platform.ResolvePath(Path.Combine(".", "OpenRA.Platforms." + rendererName + ".dll")); Device = CreateDevice(Assembly.LoadFile(rendererPath), resolution.Width, resolution.Height, graphicSettings.Mode); - - if (!serverSettings.Dedicated) - { - TempBufferSize = graphicSettings.BatchSize; - SheetSize = graphicSettings.SheetSize; - } + TempBufferSize = graphicSettings.BatchSize; + SheetSize = graphicSettings.SheetSize; WorldSpriteRenderer = new SpriteRenderer(this, Device.CreateShader("shp")); WorldRgbaSpriteRenderer = new SpriteRenderer(this, Device.CreateShader("rgba")); diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index 6271ecdc01..3806c40c84 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -38,6 +38,7 @@ namespace OpenRA.Server public readonly IPAddress Ip; public readonly int Port; public readonly MersenneTwister Random = new MersenneTwister(); + public readonly bool Dedicated; // Valid player connections public List Conns = new List(); @@ -117,7 +118,7 @@ namespace OpenRA.Server t.GameEnded(this); } - public Server(IPEndPoint endpoint, ServerSettings settings, ModData modData) + public Server(IPEndPoint endpoint, ServerSettings settings, ModData modData, bool dedicated) { Log.AddChannel("server", "server.log"); @@ -126,7 +127,7 @@ namespace OpenRA.Server var localEndpoint = (IPEndPoint)listener.LocalEndpoint; Ip = localEndpoint.Address; Port = localEndpoint.Port; - + Dedicated = dedicated; Settings = settings; Settings.Name = OpenRA.Settings.SanitizedServerName(Settings.Name); @@ -148,7 +149,7 @@ namespace OpenRA.Server RandomSeed = randomSeed, Map = settings.Map, ServerName = settings.Name, - Dedicated = settings.Dedicated, + Dedicated = dedicated, DisableSingleplayer = settings.DisableSinglePlayer, } }; @@ -380,7 +381,7 @@ namespace OpenRA.Server // Send initial ping SendOrderTo(newConn, "Ping", Game.RunTime.ToString(CultureInfo.InvariantCulture)); - if (Settings.Dedicated) + if (Dedicated) { var motdFile = Platform.ResolvePath("^", "motd.txt"); if (!File.Exists(motdFile)) @@ -490,7 +491,7 @@ namespace OpenRA.Server { DispatchOrdersToClients(null, 0, new ServerOrder("Message", text).Serialize()); - if (Settings.Dedicated) + if (Dedicated) Console.WriteLine("[{0}] {1}".F(DateTime.Now.ToString(Settings.TimestampFormat), text)); } @@ -587,7 +588,7 @@ namespace OpenRA.Server // Client was the server admin // TODO: Reassign admin for game in progress via an order - if (LobbyInfo.GlobalSettings.Dedicated && dropClient.IsAdmin && State == ServerState.WaitingPlayers) + if (Dedicated && dropClient.IsAdmin && State == ServerState.WaitingPlayers) { // Remove any bots controlled by the admin LobbyInfo.Clients.RemoveAll(c => c.Bot != null && c.BotControllerClientIndex == toDrop.PlayerIndex); @@ -607,10 +608,10 @@ namespace OpenRA.Server if (!Conns.Any()) TempBans.Clear(); - if (Conns.Any() || LobbyInfo.GlobalSettings.Dedicated) + if (Conns.Any() || Dedicated) SyncLobbyClients(); - if (!LobbyInfo.GlobalSettings.Dedicated && dropClient.IsAdmin) + if (!Dedicated && dropClient.IsAdmin) Shutdown(); } diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index ce24c64b20..6d9e967688 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -65,12 +65,6 @@ namespace OpenRA [Desc("Value in milliseconds when to terminate the game. Needs to be at least 10000 (10 s) to enable the timer.")] public int TimeOut = 0; - [Desc("Run in headless mode with an empty renderer and without sound output.")] - public bool Dedicated = false; - - [Desc("Automatically restart when a game ends. Disable this when something else already takes care about it.")] - public bool DedicatedLoop = true; - [Desc("Disallow games where only one player plays with bots.")] public bool DisableSinglePlayer = false; diff --git a/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs b/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs index 7374816316..a7cfd7db10 100644 --- a/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs +++ b/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs @@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Server lastPing = Game.RunTime; // Ignore client timeout in singleplayer games to make debugging easier - if (server.LobbyInfo.IsSinglePlayer && !server.Settings.Dedicated) + if (server.LobbyInfo.IsSinglePlayer && !server.Dedicated) foreach (var c in server.Conns.ToList()) server.SendOrderTo(c, "Ping", Game.RunTime.ToString()); else diff --git a/OpenRA.Server/OpenRA.Server.csproj b/OpenRA.Server/OpenRA.Server.csproj new file mode 100644 index 0000000000..8a40e94b90 --- /dev/null +++ b/OpenRA.Server/OpenRA.Server.csproj @@ -0,0 +1,99 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {76F621A1-3D8E-4A99-9F7E-B071EB657817} + Exe + Properties + OpenRA.Server + OpenRA.Server + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + ..\ + DEBUG;TRACE + prompt + false + AllRules.ruleset + x86 + true + + + true + ..\ + TRACE + true + pdbonly + x86 + false + prompt + AllRules.ruleset + true + + + + + 4.0 + + + + + + + + + {0DFB103F-2962-400F-8C6D-E2C28CCBA633} + OpenRA.Game + False + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/OpenRA.Server/Program.cs b/OpenRA.Server/Program.cs new file mode 100644 index 0000000000..b843618dde --- /dev/null +++ b/OpenRA.Server/Program.cs @@ -0,0 +1,58 @@ +#region Copyright & License Information +/* + * Copyright 2007-2016 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System; +using System.Net; +using System.Threading; +using OpenRA.Support; + +namespace OpenRA.Server +{ + class Program + { + static void Main(string[] args) + { + Log.AddChannel("debug", "dedicated-debug.log"); + Log.AddChannel("perf", "dedicated-perf.log"); + Log.AddChannel("server", "dedicated-server.log"); + + // HACK: The engine code assumes that Game.Settings is set. + // This isn't nearly as bad as ModData, but is still not very nice. + Game.InitializeSettings(new Arguments(args)); + var settings = Game.Settings.Server; + + // HACK: The engine code *still* assumes that Game.ModData is set + var mod = Game.Settings.Game.Mod; + var modData = Game.ModData = new ModData(mod, false); + modData.MapCache.LoadMaps(); + + settings.Map = modData.MapCache.ChooseInitialMap(settings.Map, new MersenneTwister()); + + Console.WriteLine("Starting dedicated server for mod: " + mod); + while (true) + { + var server = new Server(new IPEndPoint(IPAddress.Any, settings.ListenPort), settings, modData, true); + + while (true) + { + Thread.Sleep(1000); + if (server.State == ServerState.GameStarted && server.Conns.Count < 1) + { + Console.WriteLine("No one is playing, shutting down..."); + server.Shutdown(); + break; + } + } + + Console.WriteLine("Starting a new server instance..."); + } + } + } +} diff --git a/OpenRA.sln b/OpenRA.sln index 9d60c43a25..dd0679d53e 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Utility", "OpenRA.Ut EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Platforms.Null", "OpenRA.Platforms.Null\OpenRA.Platforms.Null.csproj", "{0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Server", "OpenRA.Server\OpenRA.Server.csproj", "{76F621A1-3D8E-4A99-9F7E-B071EB657817}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.D2k", "OpenRA.Mods.D2k\OpenRA.Mods.D2k.csproj", "{C0B0465C-6BE2-409C-8770-3A9BF64C4344}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.TS", "OpenRA.Mods.TS\OpenRA.Mods.TS.csproj", "{5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}" @@ -127,6 +129,10 @@ Global {F33337BE-CB69-4B24-850F-07D23E408DDF}.Debug|x86.Build.0 = Debug|x86 {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|x86.ActiveCfg = Release|x86 {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|x86.Build.0 = Release|x86 + {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|x86.ActiveCfg = Debug|x86 + {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|x86.Build.0 = Debug|x86 + {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|x86.ActiveCfg = Release|x86 + {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|x86.Build.0 = Release|x86 {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Debug|x86.ActiveCfg = Debug|x86 {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Debug|x86.Build.0 = Debug|x86 {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Release|x86.ActiveCfg = Release|x86 diff --git a/launch-dedicated.sh b/launch-dedicated.sh index 52505a9f67..747b651f25 100755 --- a/launch-dedicated.sh +++ b/launch-dedicated.sh @@ -8,15 +8,13 @@ Name="${Name:-"Dedicated Server"}" Mod="${Mod:-"ra"}" -Dedicated="True" -DedicatedLoop="True" ListenPort="${ListenPort:-"1234"}" ExternalPort="${ExternalPort:-"1234"}" AdvertiseOnline="${AdvertiseOnline:-"True"}" AllowPortForward="${AllowPortForward:-"False"}" while true; do - mono --debug OpenRA.Game.exe Game.Mod=$Mod Server.Dedicated=$Dedicated Server.DedicatedLoop=$DedicatedLoop \ + mono --debug OpenRA.Server.exe Game.Mod=$Mod \ Server.Name="$Name" Server.ListenPort=$ListenPort Server.ExternalPort=$ExternalPort \ Server.AdvertiseOnline=$AdvertiseOnline Server.AllowPortForward=$AllowPortForward done diff --git a/launch-game.sh b/launch-game.sh index 6bb036e790..72838f4d3f 100755 --- a/launch-game.sh +++ b/launch-game.sh @@ -1,6 +1,6 @@ #!/bin/sh # launch script (executed by Desura) -mono OpenRA.Game.exe Server.Dedicated=False Server.DedicatedLoop=False "$@" +mono OpenRA.Game.exe "$@" if [ $? != 0 -a $? != 1 ] then ZENITY=`which zenity` || echo "OpenRA needs zenity installed to display a graphical error dialog. See ~/.openra. for log files." diff --git a/packaging/package-all.sh b/packaging/package-all.sh index 1345600f1e..073477dc5d 100755 --- a/packaging/package-all.sh +++ b/packaging/package-all.sh @@ -31,7 +31,7 @@ markdown DOCUMENTATION.md > DOCUMENTATION.html markdown Lua-API.md > Lua-API.html # List of files that are packaged on all platforms -FILES=('OpenRA.Game.exe' 'OpenRA.Game.exe.config' 'OpenRA.Utility.exe' \ +FILES=('OpenRA.Game.exe' 'OpenRA.Game.exe.config' 'OpenRA.Utility.exe' 'OpenRA.Server.exe' \ 'OpenRA.Platforms.Default.dll' 'OpenRA.Platforms.Null.dll' \ 'lua' 'glsl' 'mods/common' 'mods/ra' 'mods/cnc' 'mods/d2k' 'mods/modchooser' \ 'AUTHORS' 'COPYING' 'README.html' 'CONTRIBUTING.html' 'DOCUMENTATION.html' 'CHANGELOG.html' \ diff --git a/packaging/windows/OpenRA.nsi b/packaging/windows/OpenRA.nsi index 87c7c7aef1..0d3a1379b7 100644 --- a/packaging/windows/OpenRA.nsi +++ b/packaging/windows/OpenRA.nsi @@ -85,6 +85,7 @@ Section "Game" GAME File "${SRCDIR}\OpenRA.Game.exe" File "${SRCDIR}\OpenRA.Game.exe.config" File "${SRCDIR}\OpenRA.Utility.exe" + File "${SRCDIR}\OpenRA.Server.exe" File "${SRCDIR}\OpenRA.Platforms.Null.dll" File "${SRCDIR}\OpenRA.Platforms.Default.dll" File "${SRCDIR}\ICSharpCode.SharpZipLib.dll" @@ -190,6 +191,7 @@ Function ${UN}Clean Delete $INSTDIR\OpenRA.Game.exe Delete $INSTDIR\OpenRA.Game.exe.config Delete $INSTDIR\OpenRA.Utility.exe + Delete $INSTDIR\OpenRA.Server.exe Delete $INSTDIR\OpenRA.Platforms.Null.dll Delete $INSTDIR\OpenRA.Platforms.Default.dll Delete $INSTDIR\ICSharpCode.SharpZipLib.dll From 345f91d3ec82f93528ae9d1863ed98250b4cf133 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 30 Mar 2016 19:35:12 +0100 Subject: [PATCH 5/5] Remove the null renderer. --- Makefile | 15 +-- OpenRA.Game/Sound/Sound.cs | 1 - OpenRA.Platforms.Null/NullGraphicsDevice.cs | 105 ------------------ OpenRA.Platforms.Null/NullPlatform.cs | 31 ------ OpenRA.Platforms.Null/NullSound.cs | 58 ---------- .../OpenRA.Platforms.Null.csproj | 98 ---------------- OpenRA.sln | 6 - packaging/package-all.sh | 6 +- packaging/windows/OpenRA.nsi | 2 - 9 files changed, 6 insertions(+), 316 deletions(-) delete mode 100644 OpenRA.Platforms.Null/NullGraphicsDevice.cs delete mode 100644 OpenRA.Platforms.Null/NullPlatform.cs delete mode 100644 OpenRA.Platforms.Null/NullSound.cs delete mode 100644 OpenRA.Platforms.Null/OpenRA.Platforms.Null.csproj diff --git a/Makefile b/Makefile index a9600dcb0f..5639dc2df3 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ INSTALL_PROGRAM = $(INSTALL) -m755 INSTALL_DATA = $(INSTALL) -m644 # program targets -CORE = pdefault pnull game utility server +CORE = pdefault game utility server TOOLS = gamemonitor VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`) @@ -119,14 +119,8 @@ pdefault_TARGET = OpenRA.Platforms.Default.dll pdefault_KIND = library pdefault_DEPS = $(game_TARGET) pdefault_LIBS = $(COMMON_LIBS) thirdparty/download/SDL2-CS.dll thirdparty/download/OpenAL-CS.dll $(pdefault_DEPS) - -pnull_SRCS := $(shell find OpenRA.Platforms.Null/ -iname '*.cs') -pnull_TARGET = OpenRA.Platforms.Null.dll -pnull_KIND = library -pnull_DEPS = $(game_TARGET) -pnull_LIBS = $(COMMON_LIBS) $(pnull_DEPS) -PROGRAMS += pdefault pnull -platforms: $(pdefault_TARGET) $(pnull_TARGET) +PROGRAMS += pdefault +platforms: $(pdefault_TARGET) # Mods Common mod_common_SRCS := $(shell find OpenRA.Mods.Common/ -iname '*.cs') @@ -202,9 +196,6 @@ check: utility mods @echo "Checking for code style violations in OpenRA.Platforms.Default..." @mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.Platforms.Default @echo - @echo "Checking for code style violations in OpenRA.Platforms.Null..." - @mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.Platforms.Null - @echo @echo "Checking for code style violations in OpenRA.GameMonitor..." @mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.GameMonitor @echo diff --git a/OpenRA.Game/Sound/Sound.cs b/OpenRA.Game/Sound/Sound.cs index 3b996ee329..4abfcee29b 100644 --- a/OpenRA.Game/Sound/Sound.cs +++ b/OpenRA.Game/Sound/Sound.cs @@ -94,7 +94,6 @@ namespace OpenRA { var defaultDevices = new[] { - new SoundDevice("Default", null, "Default Output"), new SoundDevice("Null", null, "Output Disabled") }; diff --git a/OpenRA.Platforms.Null/NullGraphicsDevice.cs b/OpenRA.Platforms.Null/NullGraphicsDevice.cs deleted file mode 100644 index 3535d97eeb..0000000000 --- a/OpenRA.Platforms.Null/NullGraphicsDevice.cs +++ /dev/null @@ -1,105 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2016 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. For more - * information, see COPYING. - */ -#endregion - -using System; -using System.Drawing; -using OpenRA.Graphics; - -namespace OpenRA.Platforms.Null -{ - public sealed class NullGraphicsDevice : IGraphicsDevice - { - public Size WindowSize { get; private set; } - - public NullGraphicsDevice(Size size, WindowMode window) - { - Console.WriteLine("Using Null renderer"); - WindowSize = size; - } - - public void Dispose() { } - - public void EnableScissor(int left, int top, int width, int height) { } - public void DisableScissor() { } - - public void EnableDepthBuffer() { } - public void DisableDepthBuffer() { } - - public void SetBlendMode(BlendMode mode) { } - - public void GrabWindowMouseFocus() { } - public void ReleaseWindowMouseFocus() { } - - public void Clear() { } - public void Present() { } - public Bitmap TakeScreenshot() { return new Bitmap(1, 1); } - - public string GetClipboardText() { return ""; } - public bool SetClipboardText(string text) { return false; } - public void PumpInput(IInputHandler ih) - { - Game.HasInputFocus = false; - ih.ModifierKeys(Modifiers.None); - } - - public void DrawPrimitives(PrimitiveType pt, int firstVertex, int numVertices) { } - - public IVertexBuffer CreateVertexBuffer(int size) { return new NullVertexBuffer(); } - public ITexture CreateTexture() { return new NullTexture(); } - public ITexture CreateTexture(Bitmap bitmap) { return new NullTexture(); } - public IFrameBuffer CreateFrameBuffer(Size s) { return new NullFrameBuffer(); } - public IShader CreateShader(string name) { return new NullShader(); } - - public IHardwareCursor CreateHardwareCursor(string name, Size size, byte[] data, int2 hotspot) { return null; } - public void SetHardwareCursor(IHardwareCursor cursor) { } - - public string GLVersion { get { return "(null)"; } } - } - - public class NullShader : IShader - { - public void SetBool(string name, bool value) { } - public void SetVec(string name, float x) { } - public void SetVec(string name, float x, float y) { } - public void SetVec(string name, float[] vec, int length) { } - public void SetTexture(string param, ITexture texture) { } - public void SetMatrix(string param, float[] mtx) { } - public void Render(Action a) { } - } - - public sealed class NullTexture : ITexture - { - public TextureScaleFilter ScaleFilter { get { return TextureScaleFilter.Nearest; } set { } } - public void SetData(Bitmap bitmap) { } - public void SetData(uint[,] colors) { } - public void SetData(byte[] colors, int width, int height) { } - public byte[] GetData() { return new byte[0]; } - public Size Size { get { return new Size(0, 0); } } - public void Dispose() { } - } - - public sealed class NullFrameBuffer : IFrameBuffer - { - public void Bind() { } - public void Unbind() { } - public ITexture Texture { get { return new NullTexture(); } } - public void Dispose() { } - } - - sealed class NullVertexBuffer : IVertexBuffer - { - public void Bind() { } - public void SetData(T[] vertices, int length) { } - public void SetData(T[] vertices, int start, int length) { } - public void SetData(IntPtr data, int start, int length) { } - public void Dispose() { } - } -} diff --git a/OpenRA.Platforms.Null/NullPlatform.cs b/OpenRA.Platforms.Null/NullPlatform.cs deleted file mode 100644 index f32b783273..0000000000 --- a/OpenRA.Platforms.Null/NullPlatform.cs +++ /dev/null @@ -1,31 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2016 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. For more - * information, see COPYING. - */ -#endregion - -using System.Drawing; -using OpenRA; - -[assembly: Platform(typeof(OpenRA.Platforms.Null.DeviceFactory))] - -namespace OpenRA.Platforms.Null -{ - public class DeviceFactory : IDeviceFactory - { - public IGraphicsDevice CreateGraphics(Size size, WindowMode windowMode) - { - return new NullGraphicsDevice(size, windowMode); - } - - public ISoundEngine CreateSound() - { - return new NullSoundEngine(); - } - } -} diff --git a/OpenRA.Platforms.Null/NullSound.cs b/OpenRA.Platforms.Null/NullSound.cs deleted file mode 100644 index 8401f216e8..0000000000 --- a/OpenRA.Platforms.Null/NullSound.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2016 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. For more - * information, see COPYING. - */ -#endregion - -using System; - -namespace OpenRA.Platforms.Null -{ - sealed class NullSoundEngine : ISoundEngine - { - public SoundDevice[] AvailableDevices() - { - return new[] { new SoundDevice("Null", null, "Output Disabled") }; - } - - public NullSoundEngine() - { - Console.WriteLine("Using Null sound engine which disables SFX completely"); - } - - public ISoundSource AddSoundSourceFromMemory(byte[] data, int channels, int sampleBits, int sampleRate) - { - return new NullSoundSource(); - } - - public ISound Play2D(ISoundSource sound, bool loop, bool relative, WPos pos, float volume, bool attenuateVolume) - { - return new NullSound(); - } - - public void PauseSound(ISound sound, bool paused) { } - public void StopSound(ISound sound) { } - public void SetAllSoundsPaused(bool paused) { } - public void StopAllSounds() { } - public void SetListenerPosition(WPos position) { } - public void SetSoundVolume(float volume, ISound music, ISound video) { } - - public float Volume { get; set; } - - public void Dispose() { } - } - - class NullSoundSource : ISoundSource { } - - class NullSound : ISound - { - public float Volume { get; set; } - public float SeekPosition { get { return 0; } } - public bool Playing { get { return false; } } - } -} diff --git a/OpenRA.Platforms.Null/OpenRA.Platforms.Null.csproj b/OpenRA.Platforms.Null/OpenRA.Platforms.Null.csproj deleted file mode 100644 index 56d84e16a0..0000000000 --- a/OpenRA.Platforms.Null/OpenRA.Platforms.Null.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981} - Library - Properties - OpenRA.Platforms.Null - OpenRA.Platforms.Null - 512 - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - ..\ - DEBUG;TRACE - x86 - prompt - AllRules.ruleset - true - - - true - ..\ - TRACE - true - pdbonly - x86 - prompt - AllRules.ruleset - true - - - - - - ..\thirdparty\download\Eluant.dll - - - - - - - - - - {0DFB103F-2962-400F-8C6D-E2C28CCBA633} - OpenRA.Game - False - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - \ No newline at end of file diff --git a/OpenRA.sln b/OpenRA.sln index dd0679d53e..a1e627ecd7 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -11,8 +11,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.Cnc", "OpenRA.M EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Utility", "OpenRA.Utility\OpenRA.Utility.csproj", "{F33337BE-CB69-4B24-850F-07D23E408DDF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Platforms.Null", "OpenRA.Platforms.Null\OpenRA.Platforms.Null.csproj", "{0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Server", "OpenRA.Server\OpenRA.Server.csproj", "{76F621A1-3D8E-4A99-9F7E-B071EB657817}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.D2k", "OpenRA.Mods.D2k\OpenRA.Mods.D2k.csproj", "{C0B0465C-6BE2-409C-8770-3A9BF64C4344}" @@ -133,10 +131,6 @@ Global {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|x86.Build.0 = Debug|x86 {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|x86.ActiveCfg = Release|x86 {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|x86.Build.0 = Release|x86 - {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Debug|x86.ActiveCfg = Debug|x86 - {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Debug|x86.Build.0 = Debug|x86 - {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Release|x86.ActiveCfg = Release|x86 - {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Release|x86.Build.0 = Release|x86 {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|x86.ActiveCfg = Debug|x86 {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|x86.Build.0 = Debug|x86 {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|x86.ActiveCfg = Release|x86 diff --git a/packaging/package-all.sh b/packaging/package-all.sh index 073477dc5d..6b2dc6fc98 100755 --- a/packaging/package-all.sh +++ b/packaging/package-all.sh @@ -31,9 +31,9 @@ markdown DOCUMENTATION.md > DOCUMENTATION.html markdown Lua-API.md > Lua-API.html # List of files that are packaged on all platforms -FILES=('OpenRA.Game.exe' 'OpenRA.Game.exe.config' 'OpenRA.Utility.exe' 'OpenRA.Server.exe' \ -'OpenRA.Platforms.Default.dll' 'OpenRA.Platforms.Null.dll' \ - 'lua' 'glsl' 'mods/common' 'mods/ra' 'mods/cnc' 'mods/d2k' 'mods/modchooser' \ +FILES=('OpenRA.Game.exe' 'OpenRA.Game.exe.config' 'OpenRA.Utility.exe' 'OpenRA.Server.exe' +'OpenRA.Platforms.Default.dll' \ +'lua' 'glsl' 'mods/common' 'mods/ra' 'mods/cnc' 'mods/d2k' 'mods/modchooser' \ 'AUTHORS' 'COPYING' 'README.html' 'CONTRIBUTING.html' 'DOCUMENTATION.html' 'CHANGELOG.html' \ 'global mix database.dat' 'GeoLite2-Country.mmdb.gz') diff --git a/packaging/windows/OpenRA.nsi b/packaging/windows/OpenRA.nsi index 0d3a1379b7..0eaffbcdc7 100644 --- a/packaging/windows/OpenRA.nsi +++ b/packaging/windows/OpenRA.nsi @@ -86,7 +86,6 @@ Section "Game" GAME File "${SRCDIR}\OpenRA.Game.exe.config" File "${SRCDIR}\OpenRA.Utility.exe" File "${SRCDIR}\OpenRA.Server.exe" - File "${SRCDIR}\OpenRA.Platforms.Null.dll" File "${SRCDIR}\OpenRA.Platforms.Default.dll" File "${SRCDIR}\ICSharpCode.SharpZipLib.dll" File "${SRCDIR}\FuzzyLogicLibrary.dll" @@ -192,7 +191,6 @@ Function ${UN}Clean Delete $INSTDIR\OpenRA.Game.exe.config Delete $INSTDIR\OpenRA.Utility.exe Delete $INSTDIR\OpenRA.Server.exe - Delete $INSTDIR\OpenRA.Platforms.Null.dll Delete $INSTDIR\OpenRA.Platforms.Default.dll Delete $INSTDIR\ICSharpCode.SharpZipLib.dll Delete $INSTDIR\FuzzyLogicLibrary.dll