
Untitled
By: a guest on
Apr 29th, 2012 | syntax:
C# | size: 0.89 KB | hits: 17 | expires: Never
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Schizophrenia
{
class PacketQueue
{
public System.Threading.Thread thread;
public List<int> packets;
public PacketQueue()
{
packets = new List<int>();
thread = new System.Threading.Thread(start);
thread.Start();
}
public void start()
{
while (true)
{
GameManager.MPCLIENT.ReadPacket();
packets.Add(BitConverter.ToInt16(GameManager.MPCLIENT._received, 0));
Console.WriteLine(packets[packets.Count - 1]);
}
}
public int getLatest()
{
int r = packets[packets.Count - 1];
packets.RemoveAt(packets.Count - 1);
return r;
}
}
}