public GameServer(int Servercode) { this.Servercode = Servercode; ServerTime = new Stopwatch(); Playerno_Pool = new RandomPool(1, 5); calculate.setCallback(cal); calculate.setInterval(10); calculate.Start(); }
private void Start_form() { Threading_Timer thread_ServerRenew = new Threading_Timer(); thread_ServerRenew.setCallback(Renew_Serverlist); thread_ServerRenew.setInterval(5000); thread_ServerRenew.Start(); Threading_Timer thread_LogRecording = new Threading_Timer(); thread_LogRecording.setCallback(Recording); thread_LogRecording.setInterval(100); thread_LogRecording.Start(); }
private MainProgram() { port = 5252; DoubleBuffering.callback_work += Draw; PacketManager.init(20); thread_cal = new Threading_Timer(); thread_cal.setInterval(10); thread_cal.setCallback(new Action(delegate() { if (callback_calculate != null) { callback_calculate(); } })); thread_cal.Start(); }
public void DoubleBufferingSetting() { Graphics gg = CreateGraphics(); DoubleBuffering.Instance(BufferedGraphicsManager.Current.Allocate(gg, this.ClientRectangle)); gg.Dispose(); void Render() { try { DoubleBuffering.Work(); Invoke(new Action(delegate() { try { Graphics g = CreateGraphics(); DoubleBuffering.Instance().getBuffered.Render(g); g.Dispose(); } catch (Exception e) { } })); } catch (Exception e) { } } Threading_Timer thread_FrameRender = new Threading_Timer(); thread_FrameRender.setCallback(new Action(delegate() { //callback_Draw(); Render(); })); thread_FrameRender.setInterval(8); thread_FrameRender.Start(); }