private void listenThread()
{
try
{
while (true)
{
IFormatter formatter = new BinaryFormatter();
//NetworkStream nets = _tcpl.GetStream();
packet receiveobj = (packet)formatter.Deserialize(nets);
switch (receiveobj.Cmd)
{
case ("e"):
this.Invoke(new InvokeFunction(this.quit), new object[] { });
break;
case ("match"):
this.Invoke(new InvokeFunction2(this.GameStart), receiveobj);
//GameStart(receiveobj);
break;
case ("m"):
this.Invoke(new InvokeFunction(this.quit), new object[] { });
break;
case ("q"):
this.Invoke(new InvokeFunction3(this.GameOver), new object[] { "w" });
break;
case ("play"):
if (receiveobj.Name == username)
EnemyMove(receiveobj);
else
mymove(receiveobj);
break;
default:
break;
}
}
}
catch (ThreadAbortException e)
{ }
catch { quit(); }
}