mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Migrate objects and pets [skip ci]
This commit is contained in:
parent
a37260fec5
commit
b22d8f6148
@ -55,7 +55,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
|
||||
}
|
||||
|
||||
PetRecord record;
|
||||
if (!database.GetPoweredPetEntry(spells[spell_id].teleport_zone, act_power, &record))
|
||||
if (!content_db.GetPoweredPetEntry(spells[spell_id].teleport_zone, act_power, &record))
|
||||
{
|
||||
LogError("Unknown swarm pet spell id: {}, check pets table", spell_id);
|
||||
Message(Chat::Red, "Unable to find data for pet %s", spells[spell_id].teleport_zone);
|
||||
|
||||
@ -10372,7 +10372,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
"ORDER BY id",
|
||||
zone->GetZoneID(), zone->GetInstanceVersion());
|
||||
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
c->Message(Chat::White, "Error in objects query");
|
||||
return;
|
||||
@ -10499,7 +10499,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
if (id) {
|
||||
// ID specified. Verify that it doesn't already exist.
|
||||
query = StringFormat("SELECT COUNT(*) FROM object WHERE ID = %u", id);
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (results.Success() && results.RowCount() != 0) {
|
||||
auto row = results.begin();
|
||||
if (atoi(row[0]) > 0) // Yep, in database already.
|
||||
@ -10529,7 +10529,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
od.y - 0.2f, od.y + 0.2f, // Much less processing power used this way.
|
||||
od.z - 0.2f, od.z + 0.2f); // It's pretty forgiving, though, allowing for close-proximity objects
|
||||
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (results.Success() && results.RowCount() != 0) {
|
||||
auto row = results.begin();
|
||||
objectsFound = atoi(row[0]); // Number of nearby objects from database
|
||||
@ -10638,7 +10638,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
} else {
|
||||
// Object not found in-zone in a modifiable form. Check for valid matching circumstances.
|
||||
std::string query = StringFormat("SELECT zoneid, version, type FROM object WHERE id = %u", id);
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success() || results.RowCount() == 0) {
|
||||
c->Message(Chat::White, "ERROR: Object %u not found", id);
|
||||
return;
|
||||
@ -10667,7 +10667,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
// Convert to tradeskill object temporarily for changes
|
||||
query = StringFormat("UPDATE object SET type = %u WHERE id = %u", staticType, id);
|
||||
|
||||
database.QueryDatabase(query);
|
||||
content_db.QueryDatabase(query);
|
||||
|
||||
c->Message(Chat::White, "Static Object %u unlocked for editing. You must zone out and back in to "
|
||||
"make your changes, then commit them with '#object Save'.",
|
||||
@ -10862,7 +10862,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
|
||||
if (!(o = entity_list.FindObject(id))) {
|
||||
std::string query = StringFormat("SELECT zoneid, version, type FROM object WHERE id = %u", id);
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success() || results.RowCount() == 0) {
|
||||
c->Message(Chat::White, "ERROR: Object %u not found", id);
|
||||
return;
|
||||
@ -11002,7 +11002,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
// If this ID isn't in the database yet, it's a new object
|
||||
bNewObject = true;
|
||||
std::string query = StringFormat("SELECT zoneid, version, type FROM object WHERE id = %u", id);
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (results.Success() && results.RowCount() != 0) {
|
||||
auto row = results.begin();
|
||||
od.zone_id = atoi(row[0]);
|
||||
@ -11097,7 +11097,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
od.heading, od.object_name, od.object_type, icon, od.size,
|
||||
od.solidtype, od.unknown020);
|
||||
|
||||
results = database.QueryDatabase(query);
|
||||
results = content_db.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
c->Message(Chat::White, "Database Error: %s", results.ErrorMessage().c_str());
|
||||
return;
|
||||
@ -11229,7 +11229,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
"objectname, type, icon, unknown08, unknown10, unknown20 "
|
||||
"FROM object WHERE zoneid = %u) AND version = %u",
|
||||
od.zone_instance, zone->GetZoneID(), zone->GetInstanceVersion());
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
c->Message(Chat::White, "Database Error: %s", results.ErrorMessage().c_str());
|
||||
return;
|
||||
@ -11249,7 +11249,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
"objectname, type, icon, unknown08, unknown10, unknown20 "
|
||||
"FROM object WHERE id = %u AND zoneid = %u AND version = %u",
|
||||
od.zone_instance, id, zone->GetZoneID(), zone->GetInstanceVersion());
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (results.Success() && results.RowsAffected() > 0) {
|
||||
c->Message(Chat::White, "Copied Object %u into instance version %u", id, od.zone_instance);
|
||||
return;
|
||||
@ -11266,7 +11266,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
// No database error returned. See if we can figure out why.
|
||||
|
||||
query = StringFormat("SELECT zoneid, version FROM object WHERE id = %u", id);
|
||||
results = database.QueryDatabase(query);
|
||||
results = content_db.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
return;
|
||||
|
||||
@ -11319,7 +11319,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
"WHERE id = %u AND zoneid = %u "
|
||||
"AND version = %u LIMIT 1",
|
||||
id, zone->GetZoneID(), zone->GetInstanceVersion());
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
|
||||
c->Message(Chat::White, "Object %u deleted", id);
|
||||
return;
|
||||
@ -11330,7 +11330,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
"WHERE id = %u AND zoneid = %u "
|
||||
"AND version = %u LIMIT 1",
|
||||
id, zone->GetZoneID(), zone->GetInstanceVersion());
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
return;
|
||||
|
||||
@ -11346,7 +11346,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
query = StringFormat("DELETE FROM object WHERE id = %u "
|
||||
"AND zoneid = %u AND version = %u LIMIT 1",
|
||||
id, zone->GetZoneID(), zone->GetInstanceVersion());
|
||||
results = database.QueryDatabase(query);
|
||||
results = content_db.QueryDatabase(query);
|
||||
|
||||
c->Message(Chat::White, "Object %u deleted. NOTE: This static object will remain for anyone currently in "
|
||||
"the zone until they next zone out and in.",
|
||||
@ -11398,7 +11398,7 @@ void command_object(Client *c, const Seperator *sep)
|
||||
"unknown08, unknown10, unknown20 "
|
||||
"FROM object WHERE id = %u",
|
||||
id);
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success() || results.RowCount() == 0) {
|
||||
c->Message(Chat::White, "Database Error: %s", results.ErrorMessage().c_str());
|
||||
return;
|
||||
|
||||
@ -292,11 +292,11 @@ bool Object::Save()
|
||||
{
|
||||
if (m_id) {
|
||||
// Update existing
|
||||
database.UpdateObject(m_id, m_type, m_icon, m_data, m_inst);
|
||||
content_db.UpdateObject(m_id, m_type, m_icon, m_data, m_inst);
|
||||
}
|
||||
else {
|
||||
// Doesn't yet exist, add now
|
||||
m_id = database.AddObject(m_type, m_icon, m_data, m_inst);
|
||||
m_id = content_db.AddObject(m_type, m_icon, m_data, m_inst);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -306,11 +306,11 @@ uint16 Object::VarSave()
|
||||
{
|
||||
if (m_id) {
|
||||
// Update existing
|
||||
database.UpdateObject(m_id, m_type, m_icon, m_data, m_inst);
|
||||
content_db.UpdateObject(m_id, m_type, m_icon, m_data, m_inst);
|
||||
}
|
||||
else {
|
||||
// Doesn't yet exist, add now
|
||||
m_id = database.AddObject(m_type, m_icon, m_data, m_inst);
|
||||
m_id = content_db.AddObject(m_type, m_icon, m_data, m_inst);
|
||||
}
|
||||
return m_id;
|
||||
}
|
||||
@ -319,7 +319,7 @@ uint16 Object::VarSave()
|
||||
void Object::Delete(bool reset_state)
|
||||
{
|
||||
if (m_id != 0) {
|
||||
database.DeleteObject(m_id);
|
||||
content_db.DeleteObject(m_id);
|
||||
}
|
||||
|
||||
if (reset_state) {
|
||||
@ -436,7 +436,7 @@ bool Object::Process(){
|
||||
safe_delete(outapp);
|
||||
|
||||
// Remove object
|
||||
database.DeleteObject(m_id);
|
||||
content_db.DeleteObject(m_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -553,7 +553,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
|
||||
safe_delete(outapp);
|
||||
|
||||
// Remove object
|
||||
database.DeleteObject(m_id);
|
||||
content_db.DeleteObject(m_id);
|
||||
if(!m_ground_spawn)
|
||||
entity_list.RemoveEntity(this->GetID());
|
||||
} else {
|
||||
|
||||
@ -175,7 +175,7 @@ bool Zone::LoadZoneObjects()
|
||||
"unknown08, unknown10, unknown20, unknown24, unknown76, size, tilt_x, tilt_y, display_name "
|
||||
"FROM object WHERE zoneid = %i AND (version = %u OR version = -1)",
|
||||
zoneid, instanceversion);
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogError("Error Loading Objects from DB: [{}]",
|
||||
results.ErrorMessage().c_str());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user