Class ServerConstants
java.lang.Object
constants.ServerConstants
伺服器層級的全域開關、版本識別碼與可調參數的中央常數類別。
本類別以靜態欄位集中管理 TWMS v149 的營運設定,涵蓋:
- 版本識別:
MAPLE_VERSION(149)與MAPLE_PATCH("1"), 由handling.MapleServerHandler在握手時驗證,不符合者拒絕連線。 - 連線與加密:
Use_Fixed_IV、CUSTOM_ENCRYPTION、Gateway_IP。 - MTS 玩家拍賣系統參數:
MIN_MTS、MTS_BASE、MTS_TAX、MTS_MESO。 - GM 階級定義:列舉
PlayerGMRank(普通玩家 0 → 神 100),決定!/@指令前綴與許可等級。 - 行為開關:
AUTO_REGISTER、isShutdown、DisableBlockSkills、各log_*稽核旗標等。 - 傷害上限(
damagecap)、監獄地圖(JAIL)、地獄頻道(EnableHellCh/HellCh)。
loadSetting() 由 ServerProperties 在啟動時呼叫,
將 settings.ini 中的鍵值覆寫到對應靜態欄位,
使新增可調參數時必須同步修改 settings.ini 與本類別。
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanstatic booleanstatic booleanstatic booleanstatic intstatic int[]static booleanstatic intstatic booleanstatic intstatic booleanstatic booleanstatic longstatic booleanstatic intstatic intstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic doublestatic booleanstatic booleanstatic intstatic int[]static final byte[]static Stringstatic booleanstatic intstatic int[]static int[]static booleanstatic booleanstatic intstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic final Stringstatic final shortstatic int[]static final intstatic intstatic intstatic intstatic booleanstatic intstatic final intstatic booleanstatic final intstatic intstatic Stringstatic final intstatic booleanstatic booleanstatic booleanstatic intstatic booleanstatic intstatic int點數道具賣回商城時可回收的價格百分比(0~100)。static boolean商城購買是否一律改扣楓葉點數(不論客戶端送出的貨幣別)。static boolean購買商城點裝時,是否清除點裝的所有能力(防止有能力點裝被買到)。static boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final byteClass_Bonus_EXP(int job) static doublegetExpBracketRate(int level) 取得指定等級的經驗倍率(委派RangeBrackets.expRate(List, int));未涵蓋的等級回1.0(不變)。static List<RangeBrackets.ExpBracket> 取得目前的經驗區間倍率快照(不可變)。static List<RangeBrackets.StackRange> 取得目前的道具堆疊區間快照(不可變)。static shortgetStackOverride(int itemId) 取得指定道具的堆疊上限覆寫(委派RangeBrackets.stackOverride(List, int));無命中或裝備類回0(呼叫端沿用原設定)。static booleanisFishingAllowedMap(int mapId) 判斷指定地圖是否允許釣魚:fishingAllMaps開啟時一律允許,否則須在fishingMaps指定清單內。static voidstatic void套用經驗區間倍率清單(即時生效);傳入清單會被複製為不可變快照。static void套用道具堆疊區間清單(即時生效);傳入清單會被複製為不可變快照。static void
-
Field Details
-
Gateway_IP
public static final byte[] Gateway_IP -
MAPLE_VERSION
public static final short MAPLE_VERSION- See Also:
-
MAPLE_PATCH
- See Also:
-
Use_Fixed_IV
public static boolean Use_Fixed_IV -
Use_Localhost
public static boolean Use_Localhost -
CUSTOM_ENCRYPTION
public static boolean CUSTOM_ENCRYPTION -
MIN_MTS
public static final int MIN_MTS- See Also:
-
MTS_BASE
public static final int MTS_BASE- See Also:
-
MTS_TAX
public static final int MTS_TAX- See Also:
-
MTS_MESO
public static final int MTS_MESO- See Also:
-
AUTO_REGISTER
public static boolean AUTO_REGISTER -
Can_GMItems
public static boolean Can_GMItems -
isShutdown
public static boolean isShutdown -
Disable_Shop
public static boolean Disable_Shop -
isAdminOnly
public static boolean isAdminOnly -
adminLoginHide
public static boolean adminLoginHide -
adminLoginGodmode
public static boolean adminLoginGodmode -
EnableHellCh
public static boolean EnableHellCh -
HellCh
public static int[] HellCh -
MTS_FM
public static boolean MTS_FM -
MTS_NpcId
public static int MTS_NpcId -
MTS_NpcScript
-
weekcash
public static boolean weekcash -
weekacash
public static int weekacash -
mobdropMP
public static boolean mobdropMP -
mobdropprop
public static int mobdropprop -
mobdropminmp
public static int mobdropminmp -
mobdropmaxmp
public static int mobdropmaxmp -
mobdropdailylimit
public static int mobdropdailylimit -
伺服器楓幣掉落機率
public static int 伺服器楓幣掉落機率 -
EquipExpRate
public static double EquipExpRate -
連續升級
public static boolean 連續升級 -
leveljobshow
public static boolean leveljobshow -
log_chalkboard
public static boolean log_chalkboard -
log_mshop
public static boolean log_mshop -
log_merchant
public static boolean log_merchant -
log_csbuy
public static boolean log_csbuy -
log_scroll
public static boolean log_scroll -
log_mega
public static boolean log_mega -
log_chat
public static boolean log_chat -
chatlog_enabled
public static boolean chatlog_enabled -
chatlog_retention_days
public static int chatlog_retention_days -
autoSaveEnabled
public static boolean autoSaveEnabled -
autoSaveMinutes
public static int autoSaveMinutes -
fishingEnabled
public static boolean fishingEnabled -
fishingIntervalSeconds
public static int fishingIntervalSeconds -
fishingAllMaps
public static boolean fishingAllMaps -
fishingMaps
public static int[] fishingMaps -
log_trade
public static boolean log_trade -
log_drop
public static boolean log_drop -
log_pickup
public static boolean log_pickup -
log_cube
public static boolean log_cube -
log_seal
public static boolean log_seal -
log_dc
public static boolean log_dc -
log_delchr
public static boolean log_delchr -
log_kite
public static boolean log_kite -
log_storage
public static boolean log_storage -
CashShopGiftsCount
public static int CashShopGiftsCount -
GiftsMaxMessage
-
現金商城點裝清除能力
public static boolean 現金商城點裝清除能力購買商城點裝時,是否清除點裝的所有能力(防止有能力點裝被買到)。 -
現金商城強制楓葉點數
public static boolean 現金商城強制楓葉點數商城購買是否一律改扣楓葉點數(不論客戶端送出的貨幣別)。 -
現金商城回收價百分比
public static int 現金商城回收價百分比點數道具賣回商城時可回收的價格百分比(0~100)。 -
LOG_TRACE_GAINMESO
public static boolean LOG_TRACE_GAINMESO -
LOG_TRACE_INVENTORY
public static boolean LOG_TRACE_INVENTORY -
hot_sell
public static int[] hot_sell -
DisableMapCC
public static boolean DisableMapCC -
MapNotCC
public static int[] MapNotCC -
DisableBlockSkills
public static boolean DisableBlockSkills -
blockedSkills
public static int[] blockedSkills -
EnableHM
public static boolean EnableHM -
createMapInFM
public static boolean createMapInFM -
rebornexp
public static boolean rebornexp -
JAIL
public static int JAIL -
damagecap
public static long damagecap -
LOG_UNHandle_PACKETS
public static boolean LOG_UNHandle_PACKETS -
LOG_Handle_PACKETS
public static boolean LOG_Handle_PACKETS -
loginMapInFM
public static boolean loginMapInFM -
GuiApiEnabled
public static boolean GuiApiEnabled -
GuiApiPort
public static int GuiApiPort -
DbBackupEnabled
public static boolean DbBackupEnabled -
DbBackupIntervalMinutes
public static int DbBackupIntervalMinutes -
DbBackupKeep
public static int DbBackupKeep
-
-
Constructor Details
-
ServerConstants
public ServerConstants()
-
-
Method Details
-
Class_Bonus_EXP
public static final byte Class_Bonus_EXP(int job) -
loadSetting
public static void loadSetting()從ServerProperties(即settings.ini)載入所有SETTINGS。由本類別的靜態初始化區塊在啟動時呼叫;
settings.ini缺少某鍵時, 該欄位保留其宣告時的預設值(與重構前getProperty(key, 欄位現值)行為一致)。 -
storeSetting
public static void storeSetting()將所有SETTINGS目前的執行期值寫回ServerProperties(props)。為
loadSetting()的反向操作;經由ServerProperties.registerSaveHook(Runnable)註冊為存檔掛鉤,使ServerProperties.saveProperties()能把執行期變更(如各log_*開關、AUTO_REGISTER、isAdminOnly…)正確存回settings.ini。 -
isFishingAllowedMap
public static boolean isFishingAllowedMap(int mapId) 判斷指定地圖是否允許釣魚:fishingAllMaps開啟時一律允許,否則須在fishingMaps指定清單內。供handling.channel.handler.PlayerHandler在坐椅時判定是否啟動釣魚。- Parameters:
mapId- 地圖 ID- Returns:
- 該地圖是否可釣魚
-
getItemStackRanges
取得目前的道具堆疊區間快照(不可變)。 -
setItemStackRanges
套用道具堆疊區間清單(即時生效);傳入清單會被複製為不可變快照。 -
getExpBrackets
取得目前的經驗區間倍率快照(不可變)。 -
setExpBrackets
套用經驗區間倍率清單(即時生效);傳入清單會被複製為不可變快照。 -
getStackOverride
public static short getStackOverride(int itemId) 取得指定道具的堆疊上限覆寫(委派RangeBrackets.stackOverride(List, int));無命中或裝備類回0(呼叫端沿用原設定)。即時讀取目前快照,免鎖。- Parameters:
itemId- 道具 ID- Returns:
- 堆疊上限覆寫(
> 0),或0表示不覆寫
-
getExpBracketRate
public static double getExpBracketRate(int level) 取得指定等級的經驗倍率(委派RangeBrackets.expRate(List, int));未涵蓋的等級回1.0(不變)。 即時讀取目前快照,免鎖。- Parameters:
level- 角色等級- Returns:
- 經驗倍率(預設
1.0)
-