public AskPredict(FetchQuery fetchQuery) { centerPoint = fetchQuery.centerPoint; speedVec = fetchQuery.speedVec; viewRadius = fetchQuery.viewRadius; RTT = fetchQuery.RTT; }
public void FetchObjects(ConcurQueue<int> queue, int[] keys) { BinaryFormatter bf = new BinaryFormatter (); MemoryStream ms = new MemoryStream (); byte[] instream = new byte[100000]; Socket socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.Connect (new IPEndPoint(IPAddress.Parse("10.9.169.218"), 1234)); FetchQuery fq = new FetchQuery(new float[]{0, 0}, keys); bf.Serialize (ms, fq); socket.Send (ms.ToArray()); instream = new byte[100000]; socket.Receive (instream); ms = new MemoryStream (instream); object obj2 = bf.Deserialize (ms); if (obj2 is ObjectResult) { ObjectResult or = (ObjectResult) obj2; foreach(AskObject askobject in or.askObjects){ queue.Enqueue (askobject.objectId); } } else { Debug.Log("Wrong kind of object."); } }