Add GetGroupIDByCharID and GetGuildIDByCharID to Perl/Lua.

This commit is contained in:
Alex
2020-03-08 10:38:28 -04:00
parent 581d5b1289
commit 2a9248697e
6 changed files with 86 additions and 0 deletions
+22
View File
@@ -2158,6 +2158,28 @@ uint32 Database::GetGuildIDByCharID(uint32 character_id)
return atoi(row[0]);
}
uint32 Database::GetGroupIDByCharID(uint32 character_id)
{
std::string query = fmt::format(
SQL(
SELECT groupid
FROM group_id
WHERE charid = '{}'
),
character_id
);
auto results = QueryDatabase(query);
if (!results.Success())
return 0;
if (results.RowCount() == 0)
return 0;
auto row = results.begin();
return atoi(row[0]);
}
/**
* @param log_settings
*/