Ejemplo n.º 1
0
 public override void Stop()
 {
     if (this.IsRunning == 1)
     {
         this.IsRunning = -1;
         if (!MarryRoomMgr.UpdateBreakTimeWhereServerStop())
         {
             Console.WriteLine("Update Marry BreakTime failed");
         }
         if (!SpaRoomMgr.UpdateBreakTimeWhereSpaServerStop())
         {
             Console.WriteLine("Update Spa BreakTime failed");
         }
         RoomMgr.Stop();
         GameMgr.Stop();
         BattleMgr.Stop();
         if (this._loginServer != null)
         {
             this._loginServer.Disconnected -= new ClientEventHandle(this.loginServer_Disconnected);
             this._loginServer.Disconnect();
         }
         if (this.m_pingCheckTimer != null)
         {
             this.m_pingCheckTimer.Change(-1, -1);
             this.m_pingCheckTimer.Dispose();
             this.m_pingCheckTimer = null;
         }
         if (this.m_saveDbTimer != null)
         {
             this.m_saveDbTimer.Change(-1, -1);
             this.m_saveDbTimer.Dispose();
             this.m_saveDbTimer = null;
         }
         if (this.m_saveRecordTimer != null)
         {
             this.m_saveRecordTimer.Change(-1, -1);
             this.m_saveRecordTimer.Dispose();
             this.m_saveRecordTimer = null;
             this.SaveRecordProc(null);
         }
         if (this.m_buffScanTimer != null)
         {
             this.m_buffScanTimer.Change(-1, -1);
             this.m_buffScanTimer.Dispose();
             this.m_buffScanTimer = null;
         }
         if (this.m_limitItemRefreshTimer != null)
         {
             this.m_limitItemRefreshTimer.Change(-1, -1);
             this.m_limitItemRefreshTimer.Dispose();
             this.m_limitItemRefreshTimer = null;
         }
         this.SaveTimerProc(null);
         base.Stop();
         Thread.CurrentThread.Priority = ThreadPriority.BelowNormal;
         GameServer.log.Warn("Server Stopped!");
     }
 }