Class ShutdownServer

java.lang.Object
server.ShutdownServer
All Implemented Interfaces:
Runnable, ShutdownServerMBean

public class ShutdownServer extends Object implements ShutdownServerMBean
伺服器有序關機的協調者,以單例模式確保關機流程只執行一次。

實作 ShutdownServerMBean 以支援 JMX 遠端觸發; run() 依序完成以下工作:

  • 設定 ServerConstants.isShutdown = true 並廣播關機公告。
  • 關閉所有 ChannelServer 頻道並儲存精靈商人。
  • 透過 World 儲存公會、聯盟與家族資料。
  • 停止所有 Timer 排程族(WorldTimer/MapTimer/BuffTimer 等)。
  • 依序關閉 CashShopServerLoginServer

同一 JVM 行程中同時由 JVM shutdown hook(Start.Shutdown) 與顯式 GM 指令兩條路徑觸發;內部以 synchronized 旗標防止重複執行。

  • Field Details

    • running

      public static boolean running
  • Constructor Details

    • ShutdownServer

      public ShutdownServer()
  • Method Details