From bd1f2fe225e422a7e5baa6395f78df5ce525f59a Mon Sep 17 00:00:00 2001 From: James Huston Date: Sat, 10 Jan 2026 16:51:41 +0000 Subject: [PATCH] Aupdates to get the admin panel to talk to llm. Remove actions from TC core that we dont want --- .../gcc-build.yml | 0 .../issue-labeler.yml | 0 .../macos-arm-build.yml | 0 .../pr-labeler.yml | 0 .../win-x64-build.yml | 0 src/araxiaonline/mcp/DatabaseTools.cpp | 36 +++++++++++-------- 6 files changed, 22 insertions(+), 14 deletions(-) rename .github/{workflows => workflows.old}/gcc-build.yml (100%) rename .github/{workflows => workflows.old}/issue-labeler.yml (100%) rename .github/{workflows => workflows.old}/macos-arm-build.yml (100%) rename .github/{workflows => workflows.old}/pr-labeler.yml (100%) rename .github/{workflows => workflows.old}/win-x64-build.yml (100%) diff --git a/.github/workflows/gcc-build.yml b/.github/workflows.old/gcc-build.yml similarity index 100% rename from .github/workflows/gcc-build.yml rename to .github/workflows.old/gcc-build.yml diff --git a/.github/workflows/issue-labeler.yml b/.github/workflows.old/issue-labeler.yml similarity index 100% rename from .github/workflows/issue-labeler.yml rename to .github/workflows.old/issue-labeler.yml diff --git a/.github/workflows/macos-arm-build.yml b/.github/workflows.old/macos-arm-build.yml similarity index 100% rename from .github/workflows/macos-arm-build.yml rename to .github/workflows.old/macos-arm-build.yml diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows.old/pr-labeler.yml similarity index 100% rename from .github/workflows/pr-labeler.yml rename to .github/workflows.old/pr-labeler.yml diff --git a/.github/workflows/win-x64-build.yml b/.github/workflows.old/win-x64-build.yml similarity index 100% rename from .github/workflows/win-x64-build.yml rename to .github/workflows.old/win-x64-build.yml diff --git a/src/araxiaonline/mcp/DatabaseTools.cpp b/src/araxiaonline/mcp/DatabaseTools.cpp index 3dcd9a7f5a..d896dd6c02 100644 --- a/src/araxiaonline/mcp/DatabaseTools.cpp +++ b/src/araxiaonline/mcp/DatabaseTools.cpp @@ -70,14 +70,14 @@ void RegisterDatabaseTools() // db_query - Execute SELECT query on any database sMCPServer->RegisterTool( "db_query", - "Execute a SELECT query on the specified database (world, characters, auth). Returns rows as JSON.", + "Execute a SELECT query on the specified database (world, characters, auth, hotfixes). Returns rows as JSON.", { {"type", "object"}, {"properties", { {"database", { {"type", "string"}, - {"description", "Database to query: world, characters, or auth"}, - {"enum", {"world", "characters", "auth"}} + {"description", "Database to query: world, characters, auth, or hotfixes"}, + {"enum", {"world", "characters", "auth", "hotfixes"}} }}, {"query", { {"type", "string"}, @@ -111,7 +111,7 @@ void RegisterDatabaseTools() } TC_LOG_DEBUG("araxia.mcp", "[MCP] db_query on {}: {}", database, query); - + try { QueryResult result; @@ -121,9 +121,11 @@ void RegisterDatabaseTools() result = CharacterDatabase.Query(query.c_str()); else if (database == "auth") result = LoginDatabase.Query(query.c_str()); + else if (database == "hotfixes") + result = HotfixDatabase.Query(query.c_str()); else return {{"success", false}, {"error", "Unknown database: " + database}}; - + json data = QueryResultToJson(result); data["success"] = true; data["database"] = database; @@ -163,8 +165,8 @@ void RegisterDatabaseTools() {"properties", { {"database", { {"type", "string"}, - {"description", "Database to modify: world, characters, or auth"}, - {"enum", {"world", "characters", "auth"}} + {"description", "Database to modify: world, characters, auth, or hotfixes"}, + {"enum", {"world", "characters", "auth", "hotfixes"}} }}, {"query", { {"type", "string"}, @@ -210,6 +212,8 @@ void RegisterDatabaseTools() CharacterDatabase.DirectExecute(query.c_str()); else if (database == "auth") LoginDatabase.DirectExecute(query.c_str()); + else if (database == "hotfixes") + HotfixDatabase.DirectExecute(query.c_str()); else return {{"success", false}, {"error", "Unknown database: " + database}}; @@ -247,15 +251,15 @@ void RegisterDatabaseTools() {"properties", { {"database", { {"type", "string"}, - {"description", "Database to list: world, characters, or auth"}, - {"enum", {"world", "characters", "auth"}} + {"description", "Database to list: world, characters, auth, or hotfixes"}, + {"enum", {"world", "characters", "auth", "hotfixes"}} }} }}, {"required", {"database"}} }, [](const json& params) -> json { std::string database = params.value("database", "world"); - + try { QueryResult result; @@ -265,6 +269,8 @@ void RegisterDatabaseTools() result = CharacterDatabase.Query("SHOW TABLES"); else if (database == "auth") result = LoginDatabase.Query("SHOW TABLES"); + else if (database == "hotfixes") + result = HotfixDatabase.Query("SHOW TABLES"); else return {{"success", false}, {"error", "Unknown database: " + database}}; @@ -307,7 +313,7 @@ void RegisterDatabaseTools() {"database", { {"type", "string"}, {"description", "Database containing the table"}, - {"enum", {"world", "characters", "auth"}} + {"enum", {"world", "characters", "auth", "hotfixes"}} }}, {"table", { {"type", "string"}, @@ -319,16 +325,16 @@ void RegisterDatabaseTools() [](const json& params) -> json { std::string database = params.value("database", "world"); std::string table = params.value("table", ""); - + // Sanitize table name (alphanumeric and underscore only) for (char c : table) { if (!std::isalnum(c) && c != '_') return {{"success", false}, {"error", "Invalid table name"}}; } - + std::string query = "DESCRIBE " + table; - + try { QueryResult result; @@ -338,6 +344,8 @@ void RegisterDatabaseTools() result = CharacterDatabase.Query(query.c_str()); else if (database == "auth") result = LoginDatabase.Query(query.c_str()); + else if (database == "hotfixes") + result = HotfixDatabase.Query(query.c_str()); else return {{"success", false}, {"error", "Unknown database: " + database}};