diff --git a/data/sql/updates/pending_db_world/rev_1702306388357732400.sql b/data/sql/updates/pending_db_world/rev_1702306388357732400.sql new file mode 100644 index 000000000..b2dc6a3ec --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1702306388357732400.sql @@ -0,0 +1,2 @@ +-- +UPDATE `command` SET `help`='Syntax: .wpgps\r\nOutput current position to sql developer log as partial SQL query to be used in pathing (formated for waypoint_data table).\r\nUse .wpgps sai for waypoint (SAI) table format.' WHERE `name`='wpgps'; diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 9baef8d81..9b03cc878 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1245,11 +1245,21 @@ public: return true; } - static bool HandleWPGPSCommand(ChatHandler* handler) + static bool HandleWPGPSCommand(ChatHandler* handler, Optional type) { Player* player = handler->GetSession()->GetPlayer(); - LOG_INFO("sql.dev", "(@PATH, XX, {0:.3f}, {0:.3f}, {0:.5f}, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); + if (!type) + { + // waypoint_data - id, point, X, Y, Z, O, delay, move_type, action, action_chance, wpguid + LOG_INFO("sql.dev", "(@PATH, XX, {:.3f}, {:.3f}, {:.5f}, {:.5f}, 0, 0, 0, 100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation()); + } + + if (type == "sai") + { + // waypoint (SAI) - entry, pointid, X, Y, Z, O, delay + LOG_INFO("sql.dev", "(@PATH, XX, {:.3f}, {:.3f}, {:.5f}, {:.5f}, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation()); + } handler->PSendSysMessage("Waypoint SQL written to SQL Developer log"); return true;