/// <summary> /// 构造函数 /// </summary> private DNServer() { //if (_instance != null) //{ // this.Dispose(); // _instance = null; //} //_packet = new DPacketNoCrc(); _packet = new FastPacket(); ServerTimer.GetInstance().Start(); Status = new ServerStatus(this); //创建状态统计 Status.BindTimer(ServerTimer.GetInstance()); //绑定一个计时器 Status.isPrintCur1s = false; //默认不打印状态统计(1s一打印) }
/// <summary> /// 绑定一个服务器定时器ServerTimer,它是一个1秒一工作的定时器 /// </summary> /// <param name="timer"></param> public void BindTimer(ServerTimer timer) { timer.EventOnTimer += OnUpdate; }