Exemplo n.º 1
0
    public void OnStateRecieved(NetworkMessage ClientStateDataMessage)
    {
        //Run on server, recieves what new state should be from client
        ExperimentalState ClientData = ClientStateDataMessage.ReadMessage <ExperimentalState> ();

        trialManager.SetOrderIndex(ClientData._trialNumber);
        ReOrienterAndTester parentTest = parent.GetComponent <ReOrienterAndTester> ();

        parentTest.UpdateTrial("");
        framesSinceContact = 0;
    }
Exemplo n.º 2
0
 public void RecieveDataPhone()
 {
     while (true)
     {
         try{
             IPEndPoint anyIP       = new IPEndPoint(IPAddress.Any, 8051);
             byte[]     data        = clientR.Receive(ref anyIP);
             int        trialNumber = BitConverter.ToInt32(data, 0);
             Debug.Log("Recieve:");
             Debug.Log(trialNumber);
             trialManager.SetOrderIndex(trialNumber);
             ReOrienterAndTester parentTest = parent.GetComponent <ReOrienterAndTester> ();
             parentTest.UpdateTrial("");
             framesSinceContact = 0;
         }
         catch (Exception err) {
         }
     }
 }