void Start() { // Get the global RTClient object from the Qualisys system rtClient = RTClient.GetInstance(); // Loop through discovered servers to find one that matches our needs foreach (var discoveryResponse in rtClient.GetServers()) { // Check if the response has the right IP address if (discoveryResponse.IpAddress == host) { Debug.Log("Desired Host Found"); server = discoveryResponse; foundServer = true; } Debug.Log(discoveryResponse.IpAddress); // else{ // Debug.Log("Desired Host not found"); // } } // If a server is found at the correct host, connect to the server if (foundServer) { rtClient.Connect(server, 4545, true, true, false, false, false); } }
public void Initialize(string host, int port) { _host = host; _port = port; try { _webDataClient = new RTClient(); _webDataClient.Connect(_host, _port); _webDataClient.Login("WebDispatcher"); _webDataClient.DataReceived += DataClient_DataReceived; // _webDataClient.CommandReceived += DataClient_CommandReceived; _webDataClient.Register(new string[] { "*" }); _macAddress = SystemHelper.GetMACAddress(string.Empty); } catch (Exception ex) { _logService.Error(string.Format("ExistCatch:<-{0}->:{1}", "Initialize", ex.ToString())); } }
// Start is called before the first frame update void Start() { rtClient = RTClient.GetInstance(); // Loop through discovered servers to find one that matches our needs foreach (var discoveryResponse in rtClient.GetServers()) { if (discoveryResponse.IpAddress == host) { Debug.Log("Desired Host Found"); server = discoveryResponse; foundServer = true; } } // Maybe do something on update to attempt again? if (foundServer) { rtClient.Connect(server, 4545, true, true, false, false, false, false); } }