public void Abort() { if (netThread != null) { netThread.Abort(); netThread = null; } }
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); }
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); }
public static void Stop() { TickThread.Abort(); foreach (var i in ServiceIndex) { lock (_Locker) { i.Value.Stop(); } } }
public static void Start() { foreach (var i in ServiceIndex) { lock (_Locker) { i.Value.Start(); } } TickThread.Start(); }
private void PlayTickThread(object state) { TickThread t = (TickThread)state; for (;;) { Thread.Sleep(TimeSpan.FromMilliseconds(t.Interval)); t.Function(); if (hasEnded) { break; } } }
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); }