static void Main(string[] args) { TrackerServer server = new TrackerServer(); server.Start(); while (server.Running()) { ; } server.Close(); }
//Awake is always called before any Start functions void Awake() { //Check if instance already exists if (instance == null) { //if not, set instance to this instance = this; _sessionGuid = Guid.NewGuid(); server = new Server.TrackerServer(); server.Start(); Tracker.Tracker.Instance.SetPath(Application.persistentDataPath + "/"); Tracker.SerializerInterface b = new Tracker.BinarySerializer(); Tracker.Tracker.Instance.AddSerializer(b, true); Tracker.SerializerInterface c = new Tracker.CSVSerializer(); Tracker.Tracker.Instance.AddSerializer(c, true); Tracker.Tracker.Instance.Init(); Tracker.Tracker.Instance.AddEvent(new Tracker.TrackerEvent(_sessionGuid.ToString(), (int)EVENT_TYPES.START_SESSION, Time.time)); //Tracker.Tracker.Instance.SetMAX_ELEM(1500); //Tracker.Tracker.Instance.SetOptMode(Tracker.Tracker.MODE.ULTRA); //Force use to get the devices info string aux = ""; foreach (var camDevice in WebCamTexture.devices) { aux += camDevice.name.ToString() + " "; } foreach (var microDevice in Microphone.devices) { aux += microDevice.ToString() + " " + Microphone.IsRecording(microDevice).ToString() + " "; Microphone.End(microDevice); } } //If instance already exists and it's not this: else if (instance != this) { //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. Destroy(gameObject); } //Sets this to not be destroyed when reloading scene DontDestroyOnLoad(gameObject); }