mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 00:46:46 +00:00
[Quest API] Add Instance Methods to Perl/Lua. (#2573)
* [Quest API] Add Instance Methods to Perl/Lua. # Perl - Add `quest::GetInstanceIDs(zone_name)`. - Add `quest::GetInstanceIDsByCharID(zone_name, character_id)`. - Add `quest::GetInstanceVersionByID(instance_id)`. - Add `quest::GetInstanceZoneIDByID(instance_id)`. # Lua - Add `eq.get_instance_ids(zone_name)`. - Add `eq.get_instance_ids_by_char_id(zone_name, character_id)`. - Add `eq.get_instance_version_by_id(instance_id)`. - Add `eq.get_instance_zone_id_by_id(instance_id)`. # Notes - The instance IDs methods return arrays of IDs for looping so you can check on mass the instances a player has for a zone. - Keeps operators from having to guess which possible versions of a zone a player has an instance for or loop through them all to find out. - Cleanup `common/database_instances.cpp` to mostly use repositories where possible. * Update database.h * Update character_corpses_repository.h
This commit is contained in:
@@ -44,7 +44,30 @@ public:
|
||||
*/
|
||||
|
||||
// Custom extended repository methods here
|
||||
static int BuryInstance(Database& db, uint16 instance_id) {
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET is_buried = 1, instance_id = 0 WHERE instance_id = {}",
|
||||
TableName(),
|
||||
instance_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int BuryInstances(Database& db, const std::string& joined_instance_ids)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET is_buried = 1, instance_id = 0 WHERE instance_id IN ({})",
|
||||
TableName(),
|
||||
joined_instance_ids
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_CHARACTER_CORPSES_REPOSITORY_H
|
||||
|
||||
Reference in New Issue
Block a user