diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index 225e8ded86..71246c54cf 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Linq; -using System.Net.Sockets; using IjwFramework.Types; using OpenRa.FileFormats; using OpenRa.GameRules; @@ -110,7 +109,7 @@ namespace OpenRa { var orderSources = (string.IsNullOrEmpty(Settings.NetworkHost)) ? new IOrderSource[] { new LocalOrderSource() } - : new IOrderSource[] { new LocalOrderSource(), new NetworkOrderSource(new TcpClient(Settings.NetworkHost, Settings.NetworkPort)) }; + : new IOrderSource[] { new LocalOrderSource(), new NetworkOrderSource(Settings.NetworkHost, Settings.NetworkPort) }; orderManager = new OrderManager(orderSources, "replay.rep"); } } diff --git a/OpenRa.Game/Orders/NetworkOrderSource.cs b/OpenRa.Game/Orders/NetworkOrderSource.cs index f6f4ea1a3f..052bd3643c 100644 --- a/OpenRa.Game/Orders/NetworkOrderSource.cs +++ b/OpenRa.Game/Orders/NetworkOrderSource.cs @@ -13,9 +13,9 @@ namespace OpenRa.Orders Dictionary> orderBuffers = new Dictionary>(); Dictionary gotEverything = new Dictionary(); - public NetworkOrderSource(TcpClient socket) + public NetworkOrderSource(string host, int port) { - this.socket = socket; + socket = new TcpClient(host, port); this.socket.NoDelay = true; var reader = new BinaryReader(socket.GetStream());