Class CommandProcessor
java.lang.Object
client.messages.CommandProcessor
玩家與 GM 指令的入口分派器,於聊天封包到達時由
MapleServerHandler 呼叫。
靜態初始化時以反射掃描七個指令容器類別(PlayerCommand、
InternCommand、GMCommand、AdminCommand 等),
依 ServerConstants.PlayerGMRank 建立 commands 映射與
NormalCommandList 分層索引。processCommand(MapleClient, String, ServerConstants.CommandType) 依首字元分流:
@前綴 →handlePlayerCommand:先查scripts/command/player/腳本覆寫(經NPCScriptManager.runCommand(MapleClient, String, String, String[])以 NPC 腳本架構執行), 未覆寫則委派內建CommandObject。!前綴(GM 等級 ≥ 1)→handleGmCommand:同樣腳本優先, 存在同名 Java 指令時沿用其ServerConstants.PlayerGMRank權限閾值; 找不到腳本則進行模糊比對候選清單後委派 Java 指令。
GM 指令成功執行後透過 logGMCommandToDB 寫入 gmlog 資料表,
並由 ShowMsg 廣播至 GM 頻道與伺服器日誌;玩家指令則以
logPlayerCommand 記錄至 logs/指令/玩家指令.txt。
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddropHelp(MapleClient c, int type) static booleanprocessCommand(MapleClient c, String line, ServerConstants.CommandType type)
-
Constructor Details
-
CommandProcessor
public CommandProcessor()
-
-
Method Details
-
dropHelp
- Parameters:
c- MapleClienttype- 0 = NormalCommand
-
processCommand
-