//TODO: Not so important function. Can remove this implementation altogether void MessageToServer(string deviceConnecting) { var sendMSG = new customMessage(); sendMSG.deviceType = deviceConnecting; // adding values to message class sendMSG.devicePosition = new Vector3(16.5f, 0.5f, 59); client.Send(messageID, sendMSG); // send message }
private void SendToServer(customMessage msg) { //TODO:- Update frequency is set. Modify this function properly if (Time.time >= nextUpdate) { nextUpdate = Time.time + updateFrequency; client.Send(messageID, msg); } }
void CreateMessageAndSend() { var msg = new customMessage(); msg.deviceType = "iPAD"; msg.ipAddress = localIP; msg.purpose = "Simulation"; msg.devicePosition = playerObject.transform.position; msg.deviceRotation = playerObject.transform.rotation; SendToServer(msg); }
public void updateLocation(Vector3 newPosition, Quaternion newRotation) //network messenger for location updates { var msg = new customMessage(); msg.devicePosition = newPosition; msg.deviceType = "Hololens"; msg.purpose = "Synchronization"; msg.deviceRotation = newRotation; Debug.Log("Device " + msg.deviceType + " at position " + msg.devicePosition); client.Send(messageID, msg); }
public void OnConnected() //network messenger for first tracked location { var msg = new customMessage(); msg.devicePosition = handler.childObject.transform.position; prevPos = handler.childObject.transform.position; msg.deviceType = "Hololens"; //identify self msg.purpose = "Initialization"; // purpose of message Debug.Log("Device " + msg.deviceType + " has tracked an image at " + msg.devicePosition); client.Send(messageID, msg); //actually send, containing an arbitrary id and message class }