Exemplo n.º 1
0
 public void Abort()
 {
     if (netThread != null)
     {
         netThread.Abort();
         netThread = null;
     }
 }
Exemplo n.º 2
0
        public void StartPlayTick(double interval, Action function)
        {
            Thread t = new Thread(PlayTickThread);

            TickThread tick = new TickThread();

            tick.Interval = interval;
            tick.Function = function;
            t.Start(tick);
        }
Exemplo n.º 3
0
        public ClientSocketController(ClientSocket client, bool updatedScript)
        {
            this.client = client;
            this.lua    = new LightLuaEnv("cl_unity.lc", updatedScript);

            netThread = new TickThread(() => {
                netThreadDispatcher = new Dispatcher();
                netThreadDispatcher.ProcessTasks();
            }, TICK_MS, true);
        }
Exemplo n.º 4
0
 public static void Stop()
 {
     TickThread.Abort();
     foreach (var i in ServiceIndex)
     {
         lock (_Locker)
         {
             i.Value.Stop();
         }
     }
 }
Exemplo n.º 5
0
 public static void Start()
 {
     foreach (var i in ServiceIndex)
     {
         lock (_Locker)
         {
             i.Value.Start();
         }
     }
     TickThread.Start();
 }
Exemplo n.º 6
0
        private void PlayTickThread(object state)
        {
            TickThread t = (TickThread)state;

            for (;;)
            {
                Thread.Sleep(TimeSpan.FromMilliseconds(t.Interval));
                t.Function();

                if (hasEnded)
                {
                    break;
                }
            }
        }
Exemplo n.º 7
0
        public override bool Start()
        {
            if (false == base.Start())
            {
                return(false);
            }
            if (false == m_netServiceForClient.Start())
            {
                return(false);
            }
            if (false == m_netServiceForAttach.Start())
            {
                return(false);
            }

            m_tickThread = new TickThread(this, Update);
            Logger.Info("{0} -> Start", this.GetType().Name);
            return(true);
        }
        public override bool Start()
        {
            ChatSessionManager.Instance.Attach();
            System.Threading.Thread.Sleep(3000);

            if (false == base.Start())
            {
                return(false);
            }
            if (false == m_netServiceForClient.Start())
            {
                return(false);
            }
            if (false == m_netServiceForAttach.Start())
            {
                return(false);
            }

            m_tickThread = new TickThread(this, Update);
            Logger.Info("{0} -> Start", this.GetType().Name);
            return(true);
        }