feat(mcp): Implement GM command execution via ChatHandler

ExecuteCommand now properly executes GM commands using ChatHandler::ParseCommands()
instead of just logging them.

Also includes cross-map teleport fix from previous commit.
This commit is contained in:
2025-12-13 11:54:25 -05:00
parent cc598584ef
commit baeeefc139

View File

@@ -914,13 +914,19 @@ std::string MCPPlayerManager::ExecuteCommand(uint32 sessionId, const std::string
if (!player)
return "Error: Player not online";
// For now, just log and return placeholder
// Full implementation would use ChatHandler
TC_LOG_INFO("araxia.mcp", "[MCPPlayerManager] Session {} executing command: {}",
sessionId, command);
// TODO: Implement proper command execution via ChatHandler
return "Command execution logged (full implementation pending)";
// Execute command via ChatHandler
ChatHandler handler(player->GetSession());
// Commands need the dot prefix
std::string fullCommand = "." + command;
if (handler.ParseCommands(fullCommand.c_str()))
return "Command executed successfully";
else
return "Command failed or not found";
}
// ============================================================================