server stuff

This commit is contained in:
Chris Forbes
2009-11-30 21:18:50 +13:00
parent fa02e9d45c
commit 2913c3310d
7 changed files with 163 additions and 50 deletions

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.IO;
namespace OpenRA.Server
{
class Connection
{
public Socket socket;
public List<byte> data = new List<byte>();
public ReceiveState State = ReceiveState.Header;
public int ExpectLength = 8;
public int Frame = 0;
public byte[] PopBytes(int n)
{
var result = data.GetRange(0, n);
data.RemoveRange(0, n);
return result.ToArray();
}
}
enum ReceiveState { Header, Data };
}