public void revcMsgFromGameManager(Pika.Game.Control sendmsg) { byte [] buf; using(var ms = new MemoryStream()) { Serializer.Serialize<Pika.Game.Control>(ms, sendmsg); buf = ms.ToArray(); sendmsg = null; } q.Enqueue(buf); network_bytes += buf.Length; //sock.SendTo(buf, ep); }
public MotionType GetPlayerMotionType(Pika.Game.Control.MotionType mt) { if(mt == Pika.Game.Control.MotionType.WALK) return MotionType.WALK; else if(mt == Pika.Game.Control.MotionType.JUMP) return MotionType.JUMP; else if(mt == Pika.Game.Control.MotionType.SLIDE) return MotionType.SLIDE; else if(mt == Pika.Game.Control.MotionType.SPIKE) return MotionType.SPIKE; else if(mt == Pika.Game.Control.MotionType.WIN) return MotionType.WIN; else return MotionType.LOSE; }
public void GetP2Info(Pika.Game.Control msg) { rcvMsg = msg; if(msg.time >= receiveTime) { receiveTime = msg.time; } else { return; } SetP2Moving(); }