pushed TcpClient crap into NetworkOrderSource
This commit is contained in:
@@ -2,7 +2,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Sockets;
|
|
||||||
using IjwFramework.Types;
|
using IjwFramework.Types;
|
||||||
using OpenRa.FileFormats;
|
using OpenRa.FileFormats;
|
||||||
using OpenRa.GameRules;
|
using OpenRa.GameRules;
|
||||||
@@ -110,7 +109,7 @@ namespace OpenRa
|
|||||||
{
|
{
|
||||||
var orderSources = (string.IsNullOrEmpty(Settings.NetworkHost))
|
var orderSources = (string.IsNullOrEmpty(Settings.NetworkHost))
|
||||||
? new IOrderSource[] { new LocalOrderSource() }
|
? 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");
|
orderManager = new OrderManager(orderSources, "replay.rep");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ namespace OpenRa.Orders
|
|||||||
Dictionary<int, List<byte[]>> orderBuffers = new Dictionary<int, List<byte[]>>();
|
Dictionary<int, List<byte[]>> orderBuffers = new Dictionary<int, List<byte[]>>();
|
||||||
Dictionary<int, bool> gotEverything = new Dictionary<int, bool>();
|
Dictionary<int, bool> gotEverything = new Dictionary<int, bool>();
|
||||||
|
|
||||||
public NetworkOrderSource(TcpClient socket)
|
public NetworkOrderSource(string host, int port)
|
||||||
{
|
{
|
||||||
this.socket = socket;
|
socket = new TcpClient(host, port);
|
||||||
this.socket.NoDelay = true;
|
this.socket.NoDelay = true;
|
||||||
var reader = new BinaryReader(socket.GetStream());
|
var reader = new BinaryReader(socket.GetStream());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user