Пример #1
0
        private void SkipStage(SceneExitController self)
        {
            /*I actually dont know what this does
             * //self = explicitSceneExitController.GetComponent<SceneExitController>();
             #if DEBUG
             * Chat.AddMessage("Turbo Edition: " + EquipmentName + " getComponent " + self);
             #endif*/
            //CANNOT DO THIS!!!! Throws an exception on ExitStage.State newState!
            //self = new SceneExitController();

            InstanceTracker.Add(self);
#if DEBUG
            Chat.AddMessage("Turbo Edition: " + EquipmentName + " forced stage skip.");
#endif
            //The game does this so lets do too
            if (NetworkServer.active)
            {
                //SceneExitController.ExitState == SceneExitController.ExitState.Idle;
                self.SetState(SceneExitController.ExitState.Idle);
                self.Begin();
            }
            //If we are grabbing an already existing instance from the game thanks to InstanceTracker.FirstOrNull we are deleting that one
            //should be fine since we are leaving the scene though.
            InstanceTracker.Remove(self);
        }
Пример #2
0
 public SafeTimer()
 {
     WaitFlag = false;
     timeout  = 0;
     WOTcb    = HandleTimer;
     InstanceTracker.Add(this);
 }
Пример #3
0
 public SafeTimer(int Milliseconds, bool Auto) : this()
 {
     // SWC 20130227 Fix high cpu problem
     // SWC Validate Interval setting
     //if (Milliseconds <= 0 || Milliseconds >= Int32.MaxValue) Milliseconds = 1000; // This should never happen
     //Interval = Milliseconds;
     Interval  = Math.Max(MINIMUM_INTERVAL, Milliseconds);
     AutoReset = Auto;
     InstanceTracker.Add(this);
 }
Пример #4
0
        /// <summary>
        /// Constructs a new SSDP Server
        /// </summary>
        /// <param name="Expiration">The number of seconds before a Refresh will be triggered</param>
        public SSDP(int Expiration)
        {
            InstanceTracker.Add(this);
            LifeTimeHandler        = SearchTimerSink;
            SearchTimer.OnExpired += LifeTimeHandler;

            SSDP_EXPIRATION = Expiration;
            if (SSDP_EXPIRATION < 5)
            {
                SSDP_EXPIRATION = 5;
            }
            int MinVal = (int)(SSDP_EXPIRATION * 0.25 * 1000);
            int MaxVal = (int)(SSDP_EXPIRATION * 0.45 * 1000);

            NotifyTimer.OnElapsed += __NotifyCheck;
            NotifyTimer.Interval   = RND.Next(MinVal, MaxVal);
            NotifyTimer.AutoReset  = true;
            NotifyTimer.Start();

            NetInfo = new NetworkInfo();
            SetupSessions();
        }