fix(Scripts/Commands): fix wpgps and add sai option for formating (#17990)

* fix(Scripts/Commands): fix wpgps and add sai option for formating

* ???
This commit is contained in:
avarishd
2023-12-12 04:54:52 +02:00
committed by GitHub
parent 65e88d226b
commit 0ab4931bf5
2 changed files with 14 additions and 2 deletions

View File

@@ -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';

View File

@@ -1245,11 +1245,21 @@ public:
return true;
}
static bool HandleWPGPSCommand(ChatHandler* handler)
static bool HandleWPGPSCommand(ChatHandler* handler, Optional<std::string> 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;