public void InitServer(String MasterUri, String Address, short RemotingPort, short WsPort) { this.RemoteMaster = (IMaster)Activator.GetObject(typeof(IMaster), MasterUri); try { RemoteMaster.RegisterServer(Address, RemotingPort, WsPort); System.Timers.Timer timer = new System.Timers.Timer(); timer.Interval = 3000; timer.Elapsed += delegate { Heartbeat(); }; timer.Start(); } catch (RemotingException re) { System.Console.WriteLine("Unable to connect to master: {0}", re.Message); } }
//public int void Awake() { s = this; DateTime tempcurDate = System.DateTime.Now; // tempDateRoulette = Convert.ToDateTime(roullete_date); // PlayerPrefs.SetString("RouletteDate2ChangeState", tempDateRoulette.ToString()); // int canRotate = PlayerPrefs.GetInt("CanRotate", 1); // if (canRotate == 1) { // CAN_ROTATE_ROULETTE = true; // if(activate_pw_bt.activeInHierarchy) activate_pw_bt.GetComponent<Button> ().interactable = true; // //NO DATE CASE, TRIGGER 5 MINUTES // { // TimeSpan diff = tempDate.Subtract(tempcurDate); // //Debug.Log(diff + " TimeDif " + globals.s.PW_ACTIVE); // if (diff.Minutes > GD.s.GD_WITHOUT_PW_TIME && globals.s.PW_ACTIVE == false) // { // Debug.Log("new date"); // // PW_time_set_new_date_and_state(true); // } // else // { // if (tempDate < tempcurDate) // { // Debug.Log("new date"); // // PW_time_set_new_date_and_state(!globals.s.PW_ACTIVE); // } // } // } // // // TimeSpan difference = tempDate.Subtract(tempcurDate); }