mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 02:38:45 +00:00
Remove FindTraderItemSerialNumber and FIndTraderItemBySerialNumber as they are no longer used.
Updated sharedbank to store unique_item_id instead of guid.
This commit is contained in:
@@ -7240,6 +7240,11 @@ ALTER TABLE `trader`
|
||||
ADD INDEX `idx_trader_char` (`character_id`, `char_zone_id`, `char_zone_instance_id`) USING BTREE,
|
||||
ADD UNIQUE INDEX `idx_item_unique_id` (`item_unique_id`);
|
||||
|
||||
ALTER TABLE `sharedbank`
|
||||
DROP COLUMN `guid`,
|
||||
ADD COLUMN `item_unique_id` VARCHAR(16) NULL DEFAULT NULL AFTER `ornament_hero_model`,
|
||||
ADD UNIQUE INDEX `idx_item_unique_id` (`item_unique_id`);
|
||||
|
||||
)",
|
||||
.content_schema_update = false
|
||||
},
|
||||
|
||||
@@ -245,7 +245,6 @@ namespace EQ
|
||||
|
||||
int32 GetSerialNumber() const { return m_SerialNumber; }
|
||||
void SetSerialNumber(int32 id) { m_SerialNumber = id; }
|
||||
const std::string &GetSerialNumber2() const { return m_unique_id; }
|
||||
const std::string &GetUniqueID() const { return m_unique_id; }
|
||||
void SetUniqueID(std::string sn) { m_unique_id = std::move(sn); }
|
||||
void CreateUniqueID() const { m_unique_id = GenerateUniqueID(); }
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
uint32_t ornament_icon;
|
||||
uint32_t ornament_idfile;
|
||||
int32_t ornament_hero_model;
|
||||
uint64_t guid;
|
||||
std::string item_unique_id;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
"ornament_icon",
|
||||
"ornament_idfile",
|
||||
"ornament_hero_model",
|
||||
"guid",
|
||||
"item_unique_id",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
"ornament_icon",
|
||||
"ornament_idfile",
|
||||
"ornament_hero_model",
|
||||
"guid",
|
||||
"item_unique_id",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
e.ornament_icon = 0;
|
||||
e.ornament_idfile = 0;
|
||||
e.ornament_hero_model = 0;
|
||||
e.guid = 0;
|
||||
e.item_unique_id = "";
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
e.ornament_icon = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.ornament_idfile = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.ornament_hero_model = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
|
||||
e.guid = row[15] ? strtoull(row[15], nullptr, 10) : 0;
|
||||
e.item_unique_id = row[15] ? row[15] : "";
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ public:
|
||||
v.push_back(columns[12] + " = " + std::to_string(e.ornament_icon));
|
||||
v.push_back(columns[13] + " = " + std::to_string(e.ornament_idfile));
|
||||
v.push_back(columns[14] + " = " + std::to_string(e.ornament_hero_model));
|
||||
v.push_back(columns[15] + " = " + std::to_string(e.guid));
|
||||
v.push_back(columns[15] + " = '" + Strings::Escape(e.item_unique_id) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
v.push_back(std::to_string(e.ornament_icon));
|
||||
v.push_back(std::to_string(e.ornament_idfile));
|
||||
v.push_back(std::to_string(e.ornament_hero_model));
|
||||
v.push_back(std::to_string(e.guid));
|
||||
v.push_back("'" + Strings::Escape(e.item_unique_id) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -321,7 +321,7 @@ public:
|
||||
v.push_back(std::to_string(e.ornament_icon));
|
||||
v.push_back(std::to_string(e.ornament_idfile));
|
||||
v.push_back(std::to_string(e.ornament_hero_model));
|
||||
v.push_back(std::to_string(e.guid));
|
||||
v.push_back("'" + Strings::Escape(e.item_unique_id) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -370,7 +370,7 @@ public:
|
||||
e.ornament_icon = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.ornament_idfile = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.ornament_hero_model = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
|
||||
e.guid = row[15] ? strtoull(row[15], nullptr, 10) : 0;
|
||||
e.item_unique_id = row[15] ? row[15] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -410,7 +410,7 @@ public:
|
||||
e.ornament_icon = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.ornament_idfile = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.ornament_hero_model = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
|
||||
e.guid = row[15] ? strtoull(row[15], nullptr, 10) : 0;
|
||||
e.item_unique_id = row[15] ? row[15] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -500,7 +500,7 @@ public:
|
||||
v.push_back(std::to_string(e.ornament_icon));
|
||||
v.push_back(std::to_string(e.ornament_idfile));
|
||||
v.push_back(std::to_string(e.ornament_hero_model));
|
||||
v.push_back(std::to_string(e.guid));
|
||||
v.push_back("'" + Strings::Escape(e.item_unique_id) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -538,7 +538,7 @@ public:
|
||||
v.push_back(std::to_string(e.ornament_icon));
|
||||
v.push_back(std::to_string(e.ornament_idfile));
|
||||
v.push_back(std::to_string(e.ornament_hero_model));
|
||||
v.push_back(std::to_string(e.guid));
|
||||
v.push_back("'" + Strings::Escape(e.item_unique_id) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
+1
-1
@@ -335,7 +335,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const EQ::ItemInstance
|
||||
e.ornament_icon = inst->GetOrnamentationIcon();
|
||||
e.ornament_idfile = inst->GetOrnamentationIDFile();
|
||||
e.ornament_hero_model = inst->GetOrnamentHeroModel();
|
||||
e.guid = inst->GetSerialNumber();
|
||||
e.item_unique_id = inst->GetUniqueID();
|
||||
|
||||
const int replaced = SharedbankRepository::ReplaceOne(*this, e);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user