mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
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:
@@ -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";
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user