mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-04 22:56:37 +00:00
[Performance] Reworked how all log calls are made in the source, see changelog.txt for more details
This commit is contained in:
+51
-51
@@ -197,7 +197,7 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct
|
||||
|
||||
//not in the DB yet:
|
||||
zone_data->gravity = atof(row[56]);
|
||||
Log.Out(Logs::General, Logs::Debug, "Zone Gravity is %f", zone_data->gravity);
|
||||
Log(Logs::General, Logs::Debug, "Zone Gravity is %f", zone_data->gravity);
|
||||
allow_mercs = true;
|
||||
|
||||
int bindable = 0;
|
||||
@@ -471,7 +471,7 @@ void ZoneDatabase::GetEventLogs(const char* name,char* target,uint32 account_id,
|
||||
void ZoneDatabase::LoadWorldContainer(uint32 parentid, EQEmu::ItemInstance* container)
|
||||
{
|
||||
if (!container) {
|
||||
Log.Out(Logs::General, Logs::Error, "Programming error: LoadWorldContainer passed nullptr pointer");
|
||||
Log(Logs::General, Logs::Error, "Programming error: LoadWorldContainer passed nullptr pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -479,7 +479,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, EQEmu::ItemInstance* cont
|
||||
"FROM object_contents WHERE parentid = %i", parentid);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -544,7 +544,7 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const EQ
|
||||
augslot[0], augslot[1], augslot[2], augslot[3], augslot[4], augslot[5]);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
@@ -556,7 +556,7 @@ void ZoneDatabase::DeleteWorldContainer(uint32 parent_id, uint32 zone_id)
|
||||
std::string query = StringFormat("DELETE FROM object_contents WHERE parentid = %i AND zoneid = %i", parent_id, zone_id);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
@@ -568,14 +568,14 @@ Trader_Struct* ZoneDatabase::LoadTraderItem(uint32 char_id)
|
||||
std::string query = StringFormat("SELECT * FROM trader WHERE char_id = %i ORDER BY slot_id LIMIT 80", char_id);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Failed to load trader information!\n");
|
||||
Log(Logs::Detail, Logs::Trading, "Failed to load trader information!\n");
|
||||
return loadti;
|
||||
}
|
||||
|
||||
loadti->Code = BazaarTrader_ShowItems;
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
if (atoi(row[5]) >= 80 || atoi(row[4]) < 0) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Bad Slot number when trying to load trader information!\n");
|
||||
Log(Logs::Detail, Logs::Trading, "Bad Slot number when trying to load trader information!\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -593,13 +593,13 @@ TraderCharges_Struct* ZoneDatabase::LoadTraderItemWithCharges(uint32 char_id)
|
||||
std::string query = StringFormat("SELECT * FROM trader WHERE char_id=%i ORDER BY slot_id LIMIT 80", char_id);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Failed to load trader information!\n");
|
||||
Log(Logs::Detail, Logs::Trading, "Failed to load trader information!\n");
|
||||
return loadti;
|
||||
}
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
if (atoi(row[5]) >= 80 || atoi(row[5]) < 0) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Bad Slot number when trying to load trader information!\n");
|
||||
Log(Logs::Detail, Logs::Trading, "Bad Slot number when trying to load trader information!\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -619,7 +619,7 @@ EQEmu::ItemInstance* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int Seria
|
||||
return nullptr;
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Bad result from query\n"); fflush(stdout);
|
||||
Log(Logs::Detail, Logs::Trading, "Bad result from query\n"); fflush(stdout);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -632,7 +632,7 @@ EQEmu::ItemInstance* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int Seria
|
||||
const EQEmu::ItemData *item = database.GetItem(ItemID);
|
||||
|
||||
if(!item) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Unable to create item\n");
|
||||
Log(Logs::Detail, Logs::Trading, "Unable to create item\n");
|
||||
fflush(stdout);
|
||||
return nullptr;
|
||||
}
|
||||
@@ -642,7 +642,7 @@ EQEmu::ItemInstance* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int Seria
|
||||
|
||||
EQEmu::ItemInstance* inst = database.CreateItem(item);
|
||||
if(!inst) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Unable to create item instance\n");
|
||||
Log(Logs::Detail, Logs::Trading, "Unable to create item instance\n");
|
||||
fflush(stdout);
|
||||
return nullptr;
|
||||
}
|
||||
@@ -664,25 +664,25 @@ void ZoneDatabase::SaveTraderItem(uint32 CharID, uint32 ItemID, uint32 SerialNum
|
||||
CharID, ItemID, SerialNumber, Charges, ItemCost, Slot);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
void ZoneDatabase::UpdateTraderItemCharges(int CharID, uint32 SerialNumber, int32 Charges) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges);
|
||||
Log(Logs::Detail, Logs::Trading, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges);
|
||||
|
||||
std::string query = StringFormat("UPDATE trader SET charges = %i WHERE char_id = %i AND serialnumber = %i",
|
||||
Charges, CharID, SerialNumber);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n",
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n",
|
||||
SerialNumber, CharID, results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charges, uint32 NewPrice) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice);
|
||||
Log(Logs::Detail, Logs::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice);
|
||||
|
||||
const EQEmu::ItemData *item = database.GetItem(ItemID);
|
||||
|
||||
@@ -690,12 +690,12 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg
|
||||
return;
|
||||
|
||||
if(NewPrice == 0) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID);
|
||||
Log(Logs::Detail, Logs::Trading, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID);
|
||||
|
||||
std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i AND item_id = %i",CharID, ItemID);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -706,7 +706,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg
|
||||
NewPrice, CharID, ItemID, Charges);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -716,7 +716,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg
|
||||
NewPrice, CharID, ItemID);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
|
||||
}
|
||||
|
||||
void ZoneDatabase::DeleteTraderItem(uint32 char_id){
|
||||
@@ -725,7 +725,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){
|
||||
const std::string query = "DELETE FROM trader";
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str());
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -733,7 +733,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){
|
||||
std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i", char_id);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) {
|
||||
@@ -741,7 +741,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) {
|
||||
std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i And slot_id = %i", CharID, SlotID);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str());
|
||||
}
|
||||
|
||||
void ZoneDatabase::DeleteBuyLines(uint32 CharID) {
|
||||
@@ -750,7 +750,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) {
|
||||
const std::string query = "DELETE FROM buyer";
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str());
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -758,7 +758,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) {
|
||||
std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i", CharID);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
@@ -767,7 +767,7 @@ void ZoneDatabase::AddBuyLine(uint32 CharID, uint32 BuySlot, uint32 ItemID, cons
|
||||
CharID, BuySlot, ItemID, ItemName, Quantity, Price);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
@@ -775,7 +775,7 @@ void ZoneDatabase::RemoveBuyLine(uint32 CharID, uint32 BuySlot) {
|
||||
std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i AND buyslot = %i", CharID, BuySlot);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
@@ -788,7 +788,7 @@ void ZoneDatabase::UpdateBuyLine(uint32 CharID, uint32 BuySlot, uint32 Quantity)
|
||||
std::string query = StringFormat("UPDATE buyer SET quantity = %i WHERE charid = %i AND buyslot = %i", Quantity, CharID, BuySlot);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
@@ -1288,7 +1288,7 @@ bool ZoneDatabase::LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Str
|
||||
|
||||
bool ZoneDatabase::SaveCharacterLanguage(uint32 character_id, uint32 lang_id, uint32 value){
|
||||
std::string query = StringFormat("REPLACE INTO `character_languages` (id, lang_id, value) VALUES (%u, %u, %u)", character_id, lang_id, value); QueryDatabase(query);
|
||||
Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value);
|
||||
Log(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1300,13 +1300,13 @@ bool ZoneDatabase::SaveCharacterBindPoint(uint32 character_id, const BindStruct
|
||||
"%u, %u, %f, %f, %f, %f, %i)",
|
||||
character_id, bind.zoneId, bind.instance_id, bind.x, bind.y, bind.z, bind.heading, bind_num);
|
||||
|
||||
Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u "
|
||||
Log(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u "
|
||||
"instance_id: %u position: %f %f %f %f bind_num: %u",
|
||||
character_id, bind.zoneId, bind.instance_id, bind.x, bind.y, bind.z, bind.heading, bind_num);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.RowsAffected())
|
||||
Log.Out(Logs::General, Logs::None, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(),
|
||||
Log(Logs::General, Logs::None, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(),
|
||||
query.c_str());
|
||||
|
||||
return true;
|
||||
@@ -1318,20 +1318,20 @@ bool ZoneDatabase::SaveCharacterMaterialColor(uint32 character_id, uint32 slot_i
|
||||
uint8 blue = (color & 0x000000FF);
|
||||
|
||||
std::string query = StringFormat("REPLACE INTO `character_material` (id, slot, red, green, blue, color, use_tint) VALUES (%u, %u, %u, %u, %u, %u, 255)", character_id, slot_id, red, green, blue, color); auto results = QueryDatabase(query);
|
||||
Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color);
|
||||
Log(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ZoneDatabase::SaveCharacterSkill(uint32 character_id, uint32 skill_id, uint32 value){
|
||||
std::string query = StringFormat("REPLACE INTO `character_skills` (id, skill_id, value) VALUES (%u, %u, %u)", character_id, skill_id, value); auto results = QueryDatabase(query);
|
||||
Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value);
|
||||
Log(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ZoneDatabase::SaveCharacterDisc(uint32 character_id, uint32 slot_id, uint32 disc_id){
|
||||
std::string query = StringFormat("REPLACE INTO `character_disciplines` (id, slot_id, disc_id) VALUES (%u, %u, %u)", character_id, slot_id, disc_id);
|
||||
auto results = QueryDatabase(query);
|
||||
Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id);
|
||||
Log(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1343,7 +1343,7 @@ bool ZoneDatabase::SaveCharacterTribute(uint32 character_id, PlayerProfile_Struc
|
||||
if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != TRIBUTE_NONE){
|
||||
std::string query = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute);
|
||||
QueryDatabase(query);
|
||||
Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute);
|
||||
Log(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -1355,7 +1355,7 @@ bool ZoneDatabase::SaveCharacterBandolier(uint32 character_id, uint8 bandolier_i
|
||||
DoEscapeString(bandolier_name_esc, bandolier_name, strlen(bandolier_name));
|
||||
std::string query = StringFormat("REPLACE INTO `character_bandolier` (id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name) VALUES (%u, %u, %u, %u, %u,'%s')", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name_esc);
|
||||
auto results = QueryDatabase(query);
|
||||
Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name);
|
||||
Log(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1427,7 +1427,7 @@ bool ZoneDatabase::SaveCharacterInventorySnapshot(uint32 character_id){
|
||||
character_id
|
||||
);
|
||||
auto results = database.QueryDatabase(query);
|
||||
Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterInventorySnapshot %i (%s)", character_id, (results.Success() ? "pass" : "fail"));
|
||||
Log(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterInventorySnapshot %i (%s)", character_id, (results.Success() ? "pass" : "fail"));
|
||||
return results.Success();
|
||||
}
|
||||
|
||||
@@ -1722,7 +1722,7 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla
|
||||
m_epp->last_invsnapshot_time
|
||||
);
|
||||
auto results = database.QueryDatabase(query);
|
||||
Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC);
|
||||
Log(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1763,7 +1763,7 @@ bool ZoneDatabase::SaveCharacterCurrency(uint32 character_id, PlayerProfile_Stru
|
||||
pp->currentEbonCrystals,
|
||||
pp->careerEbonCrystals);
|
||||
auto results = database.QueryDatabase(query);
|
||||
Log.Out(Logs::General, Logs::None, "Saving Currency for character ID: %i, done", character_id);
|
||||
Log(Logs::General, Logs::None, "Saving Currency for character ID: %i, done", character_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1772,7 +1772,7 @@ bool ZoneDatabase::SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 cur
|
||||
" VALUES (%u, %u, %u, %u)",
|
||||
character_id, aa_id, current_level, charges);
|
||||
auto results = QueryDatabase(rquery);
|
||||
Log.Out(Logs::General, Logs::None, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level);
|
||||
Log(Logs::General, Logs::None, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1859,7 +1859,7 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
|
||||
std::string where_condition = "";
|
||||
|
||||
if (bulk_load){
|
||||
Log.Out(Logs::General, Logs::Debug, "Performing bulk NPC Types load");
|
||||
Log(Logs::General, Logs::Debug, "Performing bulk NPC Types load");
|
||||
where_condition = StringFormat(
|
||||
"INNER JOIN spawnentry ON npc_types.id = spawnentry.npcID "
|
||||
"INNER JOIN spawn2 ON spawnentry.spawngroupID = spawn2.spawngroupID "
|
||||
@@ -2547,7 +2547,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) {
|
||||
std::string query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2573,7 +2573,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) {
|
||||
buffs[buffCount].caston_z, buffs[buffCount].ExtraDIChance);
|
||||
results = database.QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2592,7 +2592,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) {
|
||||
merc->GetMercID());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2637,7 +2637,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) {
|
||||
query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID());
|
||||
results = database.QueryDatabase(query);
|
||||
if(!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
@@ -2653,14 +2653,14 @@ bool ZoneDatabase::DeleteMerc(uint32 merc_id) {
|
||||
auto results = database.QueryDatabase(query);
|
||||
if(!results.Success())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str());
|
||||
}
|
||||
|
||||
query = StringFormat("DELETE FROM mercs WHERE MercID = '%u'", merc_id);
|
||||
results = database.QueryDatabase(query);
|
||||
if(!results.Success())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2678,7 +2678,7 @@ void ZoneDatabase::LoadMercEquipment(Merc *merc) {
|
||||
merc->GetLevel(), merc->GetLevel());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2889,7 +2889,7 @@ int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid)
|
||||
|
||||
bool ZoneDatabase::LoadBlockedSpells(int32 blockedSpellsCount, ZoneSpellsBlocked* into, uint32 zoneid)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Status, "Loading Blocked Spells from database...");
|
||||
Log(Logs::General, Logs::Status, "Loading Blocked Spells from database...");
|
||||
|
||||
std::string query = StringFormat("SELECT id, spellid, type, x, y, z, x_diff, y_diff, z_diff, message "
|
||||
"FROM blocked_spells WHERE zoneid = %d ORDER BY id ASC", zoneid);
|
||||
@@ -3980,7 +3980,7 @@ Corpse* ZoneDatabase::SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_z
|
||||
corpse->SetDecayTimer(RuleI(Character, CorpseDecayTimeMS));
|
||||
corpse->Spawn();
|
||||
if (!UnburyCharacterCorpse(corpse->GetCorpseDBID(), dest_zone_id, dest_instance_id, position))
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id);
|
||||
Log(Logs::General, Logs::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id);
|
||||
}
|
||||
|
||||
return corpse;
|
||||
@@ -4019,7 +4019,7 @@ bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id
|
||||
++CorpseCount;
|
||||
}
|
||||
else{
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to construct a player corpse for character id %u.", char_id);
|
||||
Log(Logs::General, Logs::Error, "Unable to construct a player corpse for character id %u.", char_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user