From cddefb3919086bb25ff4773134eb6ce19eaacd1b Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 9 Mar 2010 19:04:05 +1300 Subject: [PATCH 1/8] Game loads to main menu; "Connect to server" connects to localhost:1234. "Quit" quits. --- OpenRA.Game/Chrome.cs | 29 +++++++++++++++++++++++++++++ OpenRA.Game/Game.cs | 12 +++++++----- OpenRA.Game/Graphics/Viewport.cs | 3 +++ OpenRA.Game/Network/Connection.cs | 5 +++-- 4 files changed, 42 insertions(+), 7 deletions(-) diff --git a/OpenRA.Game/Chrome.cs b/OpenRA.Game/Chrome.cs index 530ba350b5..37cb70f1b1 100644 --- a/OpenRA.Game/Chrome.cs +++ b/OpenRA.Game/Chrome.cs @@ -411,6 +411,35 @@ namespace OpenRA } + public void DrawMainMenu( World world ) + { + buttons.Clear(); + + var w = 250; + var h = 200; + var r = new Rectangle( (Game.viewport.Width - w) / 2, (Game.viewport.Height - h) / 2, w, h ); + DrawDialogBackground(r, "dialog"); + DrawCentered("OpenRA Main Menu", new int2(r.Left + w / 2, r.Top + 20), Color.White); + + AddUiButton(new int2(r.Left + w/2, r.Top + 70), "Join Server", + _ => + { + Game.JoinServer("localhost", 1234); + }); + + AddUiButton(new int2(r.Left + w/2, r.Top + 105), "Create Server", + _ => + { + + }); + + AddUiButton(new int2(r.Left + w/2, r.Top + 140), "Quit", + _ => + { + Game.Exit(); + }); + } + public void DrawLobby( World world ) { buttons.Clear(); diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 9a0a770089..97cf78a9c2 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -125,19 +125,21 @@ namespace OpenRA PerfHistory.items["batches"].hasNormalTick = false; PerfHistory.items["text"].hasNormalTick = false; Game.controller = controller; - + ChangeMap(mapName); if (Settings.Replay != "") throw new NotImplementedException(); else { - var connection = (string.IsNullOrEmpty(Settings.NetworkHost)) - ? new EchoConnection() - : new NetworkConnection( Settings.NetworkHost, Settings.NetworkPort ); - orderManager = new OrderManager(connection, "replay.rep"); + orderManager = new OrderManager(new EchoConnection()); } } + + internal static void JoinServer(string host, int port) + { + orderManager = new OrderManager(new NetworkConnection( host, port ), "replay.rep"); + } static int lastTime = Environment.TickCount; diff --git a/OpenRA.Game/Graphics/Viewport.cs b/OpenRA.Game/Graphics/Viewport.cs index ba235b448e..12c5eeec3c 100644 --- a/OpenRA.Game/Graphics/Viewport.cs +++ b/OpenRA.Game/Graphics/Viewport.cs @@ -85,6 +85,9 @@ namespace OpenRA.Graphics switch( Game.orderManager.Connection.ConnectionState ) { + case ConnectionState.PreConnecting: + Game.chrome.DrawMainMenu( world ); + break; case ConnectionState.Connecting: Game.chrome.DrawDialog("Connecting to {0}:{1}...".F( Game.Settings.NetworkHost, Game.Settings.NetworkPort )); break; diff --git a/OpenRA.Game/Network/Connection.cs b/OpenRA.Game/Network/Connection.cs index a6b3533bc0..7df72e25fb 100755 --- a/OpenRA.Game/Network/Connection.cs +++ b/OpenRA.Game/Network/Connection.cs @@ -1,4 +1,4 @@ -#region Copyright & License Information +#region Copyright & License Information /* * Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford. * This file is part of OpenRA. @@ -29,6 +29,7 @@ namespace OpenRA.Network { enum ConnectionState { + PreConnecting, NotConnected, Connecting, Connected, @@ -58,7 +59,7 @@ namespace OpenRA.Network public virtual ConnectionState ConnectionState { - get { return ConnectionState.Connected; } + get { return ConnectionState.PreConnecting; } } public virtual void Send( byte[] packet ) From 9d139d43a8c05a832b304bf2cb71dffa161ee902 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 9 Mar 2010 19:57:34 +1300 Subject: [PATCH 2/8] Spawn a server process from ingame --- OpenRA.Game/Chrome.cs | 28 ++++++++++++++++++++++------ OpenRA.Game/Game.cs | 28 ++++++++++++++++++++++++++-- OpenRA.Game/Graphics/Viewport.cs | 3 ++- 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/OpenRA.Game/Chrome.cs b/OpenRA.Game/Chrome.cs index 37cb70f1b1..36fe190b7c 100644 --- a/OpenRA.Game/Chrome.cs +++ b/OpenRA.Game/Chrome.cs @@ -231,14 +231,30 @@ namespace OpenRA public void DrawDialog(string text) { - var w = renderer.BoldFont.Measure(text).X + 120; - var h = 100; + DrawDialog(text, null, _ => { }, null, _ => { }); + } + + public void DrawDialog(string text, string button1String, Action button1Action, string button2String, Action button2Action) + { + var w = Math.Max(renderer.BoldFont.Measure(text).X + 120, 400); + var h = (button1String == null) ? 100 : 140; var r = new Rectangle((Game.viewport.Width - w) / 2, (Game.viewport.Height - h) / 2, w, h); DrawDialogBackground(r, "dialog"); - DrawCentered(text, new int2(Game.viewport.Width / 2, Game.viewport.Height / 2 - 8), Color.White); + DrawCentered(text, new int2(Game.viewport.Width / 2, Game.viewport.Height / 2 - ((button1String == null) ? 8 : 28)), Color.White); // don't allow clicks through the dialog AddButton(r, _ => { }); + + if (button1String != null) + { + AddUiButton(new int2(r.Right - 300, r.Bottom - 40),button1String, button1Action); + } + + if (button2String != null) + { + AddUiButton(new int2(r.Right - 100, r.Bottom - 40),button2String, button2Action); + } + } class MapInfo @@ -421,16 +437,16 @@ namespace OpenRA DrawDialogBackground(r, "dialog"); DrawCentered("OpenRA Main Menu", new int2(r.Left + w / 2, r.Top + 20), Color.White); - AddUiButton(new int2(r.Left + w/2, r.Top + 70), "Join Server", + AddUiButton(new int2(r.Left + w/2, r.Top + 70), "Join Game", _ => { Game.JoinServer("localhost", 1234); }); - AddUiButton(new int2(r.Left + w/2, r.Top + 105), "Create Server", + AddUiButton(new int2(r.Left + w/2, r.Top + 105), "Create Game", _ => { - + Game.CreateServer(); }); AddUiButton(new int2(r.Left + w/2, r.Top + 140), "Quit", diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 97cf78a9c2..97daa78499 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -32,6 +32,7 @@ using OpenRA.Traits; using Timer = OpenRA.Support.Timer; using System.Runtime.InteropServices; using System.IO; +using System.Diagnostics; namespace OpenRA { @@ -54,6 +55,8 @@ namespace OpenRA static string mapName; internal static Session LobbyInfo = new Session(); static bool changePending; + + internal static Process Server; public static void LoadModPackages(Manifest manifest) { @@ -132,7 +135,7 @@ namespace OpenRA throw new NotImplementedException(); else { - orderManager = new OrderManager(new EchoConnection()); + JoinLocal(); } } @@ -140,7 +143,25 @@ namespace OpenRA { orderManager = new OrderManager(new NetworkConnection( host, port ), "replay.rep"); } - + + internal static void JoinLocal() + { + orderManager = new OrderManager(new EchoConnection()); + } + + internal static void CreateServer() + { + Server = new Process(); + Server.StartInfo.FileName = "OpenRA.Server.exe"; + Server.StartInfo.Arguments = string.Join(" ",Game.LobbyInfo.GlobalSettings.Mods); + Server.Start(); + } + + internal static void CloseServer() + { + Server.Kill(); + } + static int lastTime = Environment.TickCount; public static void ResetTimer() @@ -420,6 +441,9 @@ namespace OpenRA public static void Exit() { + if (Server != null) + CloseServer(); + quit = true; } } diff --git a/OpenRA.Game/Graphics/Viewport.cs b/OpenRA.Game/Graphics/Viewport.cs index 12c5eeec3c..de5f31ee1b 100644 --- a/OpenRA.Game/Graphics/Viewport.cs +++ b/OpenRA.Game/Graphics/Viewport.cs @@ -92,7 +92,8 @@ namespace OpenRA.Graphics Game.chrome.DrawDialog("Connecting to {0}:{1}...".F( Game.Settings.NetworkHost, Game.Settings.NetworkPort )); break; case ConnectionState.NotConnected: - Game.chrome.DrawDialog("Connection failed."); + // Todo: Hook these up + Game.chrome.DrawDialog("Connection failed.", "Retry", _ => {}, "Cancel",_ => {}); break; case ConnectionState.Connected: Game.chrome.DrawLobby( world ); From b2df8d3b0e18daa5881e942f46b771e44c3745b0 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 9 Mar 2010 20:50:59 +1300 Subject: [PATCH 3/8] inproc server --- OpenRA.Game/Game.cs | 19 ++++++---------- OpenRA.Game/OpenRA.Game.csproj | 6 ++++- OpenRA.Server/OpenRA.Server.csproj | 6 ++++- OpenRA.Server/Server.cs | 35 +++++++++++++++++++++++++----- OpenRA.sln | 3 +++ 5 files changed, 50 insertions(+), 19 deletions(-) diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 97daa78499..6be9ef9059 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -20,7 +20,9 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Drawing; +using System.IO; using System.Linq; using System.Windows.Forms; using OpenRA.FileFormats; @@ -30,9 +32,7 @@ using OpenRA.Network; using OpenRA.Support; using OpenRA.Traits; using Timer = OpenRA.Support.Timer; -using System.Runtime.InteropServices; -using System.IO; -using System.Diagnostics; +using OpenRA.Server; namespace OpenRA { @@ -56,7 +56,7 @@ namespace OpenRA internal static Session LobbyInfo = new Session(); static bool changePending; - internal static Process Server; + public static void LoadModPackages(Manifest manifest) { @@ -151,15 +151,13 @@ namespace OpenRA internal static void CreateServer() { - Server = new Process(); - Server.StartInfo.FileName = "OpenRA.Server.exe"; - Server.StartInfo.Arguments = string.Join(" ",Game.LobbyInfo.GlobalSettings.Mods); - Server.Start(); + // todo: LobbyInfo is the wrong place for this. + InprocServer.Start(Game.LobbyInfo.GlobalSettings.Mods); } internal static void CloseServer() { - Server.Kill(); + InprocServer.Stop(); } static int lastTime = Environment.TickCount; @@ -441,9 +439,6 @@ namespace OpenRA public static void Exit() { - if (Server != null) - CloseServer(); - quit = true; } } diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj index 16c5c88344..999bca3237 100644 --- a/OpenRA.Game/OpenRA.Game.csproj +++ b/OpenRA.Game/OpenRA.Game.csproj @@ -1,4 +1,4 @@ - + Debug @@ -277,6 +277,10 @@ {BDAEAB25-991E-46A7-AF1E-4F0E03358DAA} OpenRA.FileFormats + + {76F621A1-3D8E-4A99-9F7E-B071EB657817} + OpenRA.Server + diff --git a/OpenRA.Server/OpenRA.Server.csproj b/OpenRA.Server/OpenRA.Server.csproj index d3e07b5e65..f045247896 100644 --- a/OpenRA.Server/OpenRA.Server.csproj +++ b/OpenRA.Server/OpenRA.Server.csproj @@ -6,7 +6,7 @@ 9.0.30729 2.0 {76F621A1-3D8E-4A99-9F7E-B071EB657817} - Exe + Library Properties OpenRA.Server OpenRA.Server @@ -68,4 +68,8 @@ --> + + + + \ No newline at end of file diff --git a/OpenRA.Server/Server.cs b/OpenRA.Server/Server.cs index 2cc907f41c..55cbdfc14c 100644 --- a/OpenRA.Server/Server.cs +++ b/OpenRA.Server/Server.cs @@ -27,6 +27,7 @@ using System.Net; using System.Net.Sockets; using System.Security.Cryptography; using OpenRA.FileFormats; +using System.Threading; namespace OpenRA.Server { @@ -38,16 +39,17 @@ namespace OpenRA.Server = new Dictionary>(); static Session lobbyInfo; static bool GameStarted = false; - static string[] defaultMods = new string[] { "ra" }; + static string[] initialMods; const int DownloadChunkInterval = 20000; const int DownloadChunkSize = 16384; - public static int Main(string[] args) + public static int ServerMain(string[] mods, AutoResetEvent e) { - if (args.Length > 0) defaultMods = args; + initialMods = mods; + lobbyInfo = new Session(); - lobbyInfo.GlobalSettings.Mods = defaultMods; + lobbyInfo.GlobalSettings.Mods = mods; Console.WriteLine("Initial mods: "); foreach( var m in lobbyInfo.GlobalSettings.Mods ) @@ -63,6 +65,8 @@ namespace OpenRA.Server Console.WriteLine("Server failed to start."); return 1; } + + e.Set(); // we're done starting up for (; ; ) { @@ -510,7 +514,7 @@ namespace OpenRA.Server Console.WriteLine("Server emptied out; doing a bit of housekeeping to prepare for next game.."); inFlightFrames.Clear(); lobbyInfo = new Session(); - lobbyInfo.GlobalSettings.Mods = defaultMods; + lobbyInfo.GlobalSettings.Mods = initialMods; GameStarted = false; } @@ -538,4 +542,25 @@ namespace OpenRA.Server new ServerOrder("SyncInfo", clientData.WriteToString()).Serialize()); } } + + // temporary threaded inproc server wrapper. + public static class InprocServer + { + static Thread t; + + public static void Start( string[] mods ) + { + var e = new AutoResetEvent(false); + t = new Thread(() => Server.ServerMain(mods, e)) { IsBackground = true }; + + t.Start(); + e.WaitOne(); // when the event is signaled, the server is finished initializing + } + + public static void Stop() + { + if (t != null) + t.Abort(); + } + } } diff --git a/OpenRA.sln b/OpenRA.sln index a3e27d272f..54edd52e8d 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 10.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.FileFormats", "OpenRA.FileFormats\OpenRA.FileFormats.csproj", "{BDAEAB25-991E-46A7-AF1E-4F0E03358DAA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Game", "OpenRA.Game\OpenRA.Game.csproj", "{0DFB103F-2962-400F-8C6D-E2C28CCBA633}" + ProjectSection(ProjectDependencies) = postProject + {76F621A1-3D8E-4A99-9F7E-B071EB657817} = {76F621A1-3D8E-4A99-9F7E-B071EB657817} + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SequenceEditor", "SequenceEditor\SequenceEditor.csproj", "{230F65CE-A6DE-4235-8B38-13A3D606C7F7}" EndProject From fec037414df2e9997c280b795d2d7ddf82762de3 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 9 Mar 2010 20:52:51 +1300 Subject: [PATCH 4/8] remove dead HandleKeyDown --- OpenRA.Game/Game.cs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 6be9ef9059..0780c18bb6 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -333,15 +333,6 @@ namespace OpenRA throw new InvalidOperationException( "Desync in DispatchMouseInput" ); } - public static void HandleKeyDown( KeyEventArgs e ) - { - //int sync = Game.world.SyncHash(); - - - //if( sync != Game.world.SyncHash() ) - // throw new InvalidOperationException( "Desync in OnKeyDown" ); - } - public static bool IsHost { get { return orderManager.Connection.LocalClientId == 0; } From a28010917ea8fa1c1470dec735030eeca3f1b6e2 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 9 Mar 2010 20:56:59 +1300 Subject: [PATCH 5/8] automatically join the server --- OpenRA.Game/Game.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 0780c18bb6..082c772581 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -33,6 +33,7 @@ using OpenRA.Support; using OpenRA.Traits; using Timer = OpenRA.Support.Timer; using OpenRA.Server; +using System.Net; namespace OpenRA { @@ -153,6 +154,7 @@ namespace OpenRA { // todo: LobbyInfo is the wrong place for this. InprocServer.Start(Game.LobbyInfo.GlobalSettings.Mods); + JoinServer(IPAddress.Loopback.ToString(), 1234); } internal static void CloseServer() From 7d257cd8eb0e002ddf6490406543a6dc9d4c5c13 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 9 Mar 2010 21:12:42 +1300 Subject: [PATCH 6/8] moved OpenRA.Server.* into main exe --- OpenRA.Game/OpenRA.Game.csproj | 8 ++++---- {OpenRA.Server => OpenRA.Game/Server}/Connection.cs | 0 {OpenRA.Server => OpenRA.Game/Server}/Exts.cs | 0 {OpenRA.Server => OpenRA.Game/Server}/Server.cs | 0 .../Server}/ServerOrder.cs | 0 OpenRA.Server/OpenRA.Server.csproj | 4 ---- OpenRA.sln | 13 ------------- 7 files changed, 4 insertions(+), 21 deletions(-) rename {OpenRA.Server => OpenRA.Game/Server}/Connection.cs (100%) rename {OpenRA.Server => OpenRA.Game/Server}/Exts.cs (100%) mode change 100755 => 100644 rename {OpenRA.Server => OpenRA.Game/Server}/Server.cs (100%) rename {OpenRA.Server => OpenRA.Game/Server}/ServerOrder.cs (100%) diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj index 999bca3237..5065c891b2 100644 --- a/OpenRA.Game/OpenRA.Game.csproj +++ b/OpenRA.Game/OpenRA.Game.csproj @@ -102,6 +102,10 @@ + + + + @@ -277,10 +281,6 @@ {BDAEAB25-991E-46A7-AF1E-4F0E03358DAA} OpenRA.FileFormats - - {76F621A1-3D8E-4A99-9F7E-B071EB657817} - OpenRA.Server - diff --git a/OpenRA.Server/Connection.cs b/OpenRA.Game/Server/Connection.cs similarity index 100% rename from OpenRA.Server/Connection.cs rename to OpenRA.Game/Server/Connection.cs diff --git a/OpenRA.Server/Exts.cs b/OpenRA.Game/Server/Exts.cs old mode 100755 new mode 100644 similarity index 100% rename from OpenRA.Server/Exts.cs rename to OpenRA.Game/Server/Exts.cs diff --git a/OpenRA.Server/Server.cs b/OpenRA.Game/Server/Server.cs similarity index 100% rename from OpenRA.Server/Server.cs rename to OpenRA.Game/Server/Server.cs diff --git a/OpenRA.Server/ServerOrder.cs b/OpenRA.Game/Server/ServerOrder.cs similarity index 100% rename from OpenRA.Server/ServerOrder.cs rename to OpenRA.Game/Server/ServerOrder.cs diff --git a/OpenRA.Server/OpenRA.Server.csproj b/OpenRA.Server/OpenRA.Server.csproj index f045247896..7000149649 100644 --- a/OpenRA.Server/OpenRA.Server.csproj +++ b/OpenRA.Server/OpenRA.Server.csproj @@ -48,11 +48,7 @@ - - - - diff --git a/OpenRA.sln b/OpenRA.sln index 54edd52e8d..2ca505c31f 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -4,14 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 10.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.FileFormats", "OpenRA.FileFormats\OpenRA.FileFormats.csproj", "{BDAEAB25-991E-46A7-AF1E-4F0E03358DAA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Game", "OpenRA.Game\OpenRA.Game.csproj", "{0DFB103F-2962-400F-8C6D-E2C28CCBA633}" - ProjectSection(ProjectDependencies) = postProject - {76F621A1-3D8E-4A99-9F7E-B071EB657817} = {76F621A1-3D8E-4A99-9F7E-B071EB657817} - EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SequenceEditor", "SequenceEditor\SequenceEditor.csproj", "{230F65CE-A6DE-4235-8B38-13A3D606C7F7}" 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.RA", "OpenRA.Mods.RA\OpenRA.Mods.RA.csproj", "{4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.Aftermath", "OpenRA.Mods.Aftermath\OpenRA.Mods.Aftermath.csproj", "{2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}" @@ -51,14 +46,6 @@ Global {230F65CE-A6DE-4235-8B38-13A3D606C7F7}.Release|Any CPU.Build.0 = Release|Any CPU {230F65CE-A6DE-4235-8B38-13A3D606C7F7}.Release|Mixed Platforms.ActiveCfg = Release|x86 {230F65CE-A6DE-4235-8B38-13A3D606C7F7}.Release|Mixed Platforms.Build.0 = Release|x86 - {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Any CPU.Build.0 = Debug|Any CPU - {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|Any CPU.ActiveCfg = Release|Any CPU - {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|Any CPU.Build.0 = Release|Any CPU - {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|Mixed Platforms.Build.0 = Release|Any CPU {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Debug|Any CPU.Build.0 = Debug|Any CPU {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU From c419127d7ed1cdb57803f58693a6600140fc793a Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 9 Mar 2010 22:38:11 +1300 Subject: [PATCH 7/8] Remove server from makefile/packaging scripts --- Makefile | 9 +-------- packaging/osx/package.sh | 3 --- packaging/osx/package_dmg.sh | 5 +---- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index ebe3b6244a..156c3df0d3 100644 --- a/Makefile +++ b/Makefile @@ -44,12 +44,6 @@ aftermath_KIND = library aftermath_DEPS = $(fileformats_TARGET) $(game_TARGET) aftermath_LIBS = $(COMMON_LIBS) $(aftermath_DEPS) -server_SRCS = $(shell find OpenRA.Server/ -iname '*.cs') -server_TARGET = OpenRA.Server.exe -server_KIND = winexe -server_DEPS = $(fileformats_TARGET) -server_LIBS = $(COMMON_LIBS) $(server_DEPS) - seqed_SRCS = $(shell find SequenceEditor/ -iname '*.cs') seqed_TARGET = SequenceEditor.exe seqed_KIND = winexe @@ -83,9 +77,8 @@ clean: @-rm *.exe *.dll *.mdb mods/**/*.dll mods/**/*.mdb mods: $(ra_TARGET) $(cnc_TARGET) $(aftermath_TARGET) -server: $(server_TARGET) seqed: $(seqed_TARGET) -all: $(fileformats_TARGET) $(gl_TARGET) $(game_TARGET) $(ra_TARGET) $(cnc_TARGET) $(aftermath_TARGET) $(server_TARGET) $(seqed_TARGET) +all: $(fileformats_TARGET) $(gl_TARGET) $(game_TARGET) $(ra_TARGET) $(cnc_TARGET) $(aftermath_TARGET) $(seqed_TARGET) dist-osx: packaging/osx/package.sh diff --git a/packaging/osx/package.sh b/packaging/osx/package.sh index 33c78bf8cb..e5c87eb3c8 100755 --- a/packaging/osx/package.sh +++ b/packaging/osx/package.sh @@ -54,9 +54,6 @@ export AS="as -arch i386" export CC="gcc -arch i386 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk" export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig/ -# Package the server binary -mkbundle --deps --static -z -o openra_server OpenRA.Server.exe OpenRA.FileFormats.dll thirdparty/Tao/Tao.Sdl.dll - # Package the game binary mkbundle --deps --static -z -o OpenRA OpenRA.Game.exe OpenRA.Gl.dll OpenRA.FileFormats.dll thirdparty/Tao/Tao.Cg.dll thirdparty/Tao/Tao.OpenGl.dll thirdparty/Tao/Tao.OpenAl.dll thirdparty/Tao/Tao.FreeType.dll thirdparty/Tao/Tao.Sdl.dll diff --git a/packaging/osx/package_dmg.sh b/packaging/osx/package_dmg.sh index 40f03f699e..fefa706756 100755 --- a/packaging/osx/package_dmg.sh +++ b/packaging/osx/package_dmg.sh @@ -3,7 +3,6 @@ title=OpenRA size=70m dmgName=OpenRA.dmg -mv openra_server ${source} mv OpenRA.app ${source} hdiutil create -srcfolder "${source}" -volname "${title}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${size} temp.dmg @@ -23,7 +22,6 @@ echo ' set background picture of theViewOptions to file ".background:bg.png" make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"} set position of item "OpenRA.app" of container window to {100, 90} - set position of item "openra_server" of container window to {100, 210} set position of item "Applications" of container window to {375, 150} close open @@ -38,5 +36,4 @@ sync hdiutil detach ${device} hdiutil convert "./temp.dmg" -format UDZO -imagekey zlib-level=9 -o "${dmgName}" rm -f ./temp.dmg -rm -rf ${source}OpenRA.app -rm -f ${source}openra_server \ No newline at end of file +rm -rf ${source}OpenRA.app \ No newline at end of file From 5370c92f10dd741764a7f524ba4316451fee0b6b Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 9 Mar 2010 22:41:51 +1300 Subject: [PATCH 8/8] Connect to the server defined in settings.ini --- OpenRA.Game/Chrome.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/Chrome.cs b/OpenRA.Game/Chrome.cs index 36fe190b7c..6f5426e3cc 100644 --- a/OpenRA.Game/Chrome.cs +++ b/OpenRA.Game/Chrome.cs @@ -440,7 +440,7 @@ namespace OpenRA AddUiButton(new int2(r.Left + w/2, r.Top + 70), "Join Game", _ => { - Game.JoinServer("localhost", 1234); + Game.JoinServer(Game.Settings.NetworkHost, Game.Settings.NetworkPort); }); AddUiButton(new int2(r.Left + w/2, r.Top + 105), "Create Game",