mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 15:58:36 +00:00
[Performance] Reworked how all log calls are made in the source, see changelog.txt for more details
This commit is contained in:
+18
-18
@@ -584,7 +584,7 @@ bool Client::Process() {
|
||||
|
||||
if (client_state != CLIENT_LINKDEAD && !eqs->CheckState(ESTABLISHED)) {
|
||||
OnDisconnect(true);
|
||||
Log.Out(Logs::General, Logs::Zone_Server, "Client linkdead: %s", name);
|
||||
Log(Logs::General, Logs::Zone_Server, "Client linkdead: %s", name);
|
||||
|
||||
if (GetGM()) {
|
||||
if (GetMerc())
|
||||
@@ -628,7 +628,7 @@ bool Client::Process() {
|
||||
}
|
||||
npc_scan_count++;
|
||||
}
|
||||
Log.Out(Logs::General, Logs::Aggro, "Checking Reverse Aggro (client->npc) scanned_npcs (%i)", npc_scan_count);
|
||||
Log(Logs::General, Logs::Aggro, "Checking Reverse Aggro (client->npc) scanned_npcs (%i)", npc_scan_count);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -729,7 +729,7 @@ void Client::OnDisconnect(bool hard_disconnect) {
|
||||
Mob *Other = trade->With();
|
||||
if(Other)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Client disconnected during a trade. Returning their items.");
|
||||
Log(Logs::Detail, Logs::Trading, "Client disconnected during a trade. Returning their items.");
|
||||
FinishTrade(this);
|
||||
|
||||
if(Other->IsClient())
|
||||
@@ -761,7 +761,7 @@ void Client::BulkSendInventoryItems()
|
||||
if(inst) {
|
||||
bool is_arrow = (inst->GetItem()->ItemType == EQEmu::item::ItemTypeArrow) ? true : false;
|
||||
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsClassBag(), true, inst->GetItem()->Size, is_arrow);
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id);
|
||||
Log(Logs::Detail, Logs::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id);
|
||||
PutItemInInventory(free_slot_id, *inst, false);
|
||||
database.SaveInventory(character_id, nullptr, slot_id);
|
||||
safe_delete(inst);
|
||||
@@ -790,7 +790,7 @@ void Client::BulkSendInventoryItems()
|
||||
inst->Serialize(ob, slot_id);
|
||||
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
Log(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@@ -802,7 +802,7 @@ void Client::BulkSendInventoryItems()
|
||||
inst->Serialize(ob, EQEmu::inventory::slotPowerSource);
|
||||
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", EQEmu::inventory::slotPowerSource);
|
||||
Log(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", EQEmu::inventory::slotPowerSource);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@@ -817,7 +817,7 @@ void Client::BulkSendInventoryItems()
|
||||
inst->Serialize(ob, slot_id);
|
||||
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
Log(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@@ -831,7 +831,7 @@ void Client::BulkSendInventoryItems()
|
||||
inst->Serialize(ob, slot_id);
|
||||
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
Log(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@@ -919,7 +919,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
|
||||
// Account for merchant lists with gaps.
|
||||
if (ml.slot >= i) {
|
||||
if (ml.slot > i)
|
||||
Log.Out(Logs::General, Logs::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid);
|
||||
Log(Logs::General, Logs::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid);
|
||||
i = ml.slot + 1;
|
||||
}
|
||||
}
|
||||
@@ -1011,7 +1011,7 @@ uint8 Client::WithCustomer(uint16 NewCustomer){
|
||||
Client* c = entity_list.GetClientByID(CustomerID);
|
||||
|
||||
if(!c) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Previous customer has gone away.");
|
||||
Log(Logs::Detail, Logs::Trading, "Previous customer has gone away.");
|
||||
CustomerID = NewCustomer;
|
||||
return 1;
|
||||
}
|
||||
@@ -1023,7 +1023,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I
|
||||
{
|
||||
if(PendingRezzXP < 0) {
|
||||
// pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Unexpected OP_RezzAnswer. Ignoring it.");
|
||||
Log(Logs::Detail, Logs::Spells, "Unexpected OP_RezzAnswer. Ignoring it.");
|
||||
Message(13, "You have already been resurrected.\n");
|
||||
return;
|
||||
}
|
||||
@@ -1033,7 +1033,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I
|
||||
// Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the
|
||||
// corpse is in has shutdown since the rez spell was cast.
|
||||
database.MarkCorpseAsRezzed(PendingRezzDBID);
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i",
|
||||
Log(Logs::Detail, Logs::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i",
|
||||
this->name, (uint16)spells[SpellID].base[0],
|
||||
SpellID, ZoneID, InstanceID);
|
||||
|
||||
@@ -1086,7 +1086,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
|
||||
{
|
||||
if(app->size != sizeof(MemorizeSpell_Struct))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct));
|
||||
Log(Logs::General, Logs::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct));
|
||||
DumpPacket(app);
|
||||
return;
|
||||
}
|
||||
@@ -1639,12 +1639,12 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
|
||||
EQEmu::skills::SkillType skill = (EQEmu::skills::SkillType)gmskill->skill_id;
|
||||
|
||||
if(!CanHaveSkill(skill)) {
|
||||
Log.Out(Logs::Detail, Logs::Skills, "Tried to train skill %d, which is not allowed.", skill);
|
||||
Log(Logs::Detail, Logs::Skills, "Tried to train skill %d, which is not allowed.", skill);
|
||||
return;
|
||||
}
|
||||
|
||||
if(MaxSkill(skill) == 0) {
|
||||
Log.Out(Logs::Detail, Logs::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill);
|
||||
Log(Logs::Detail, Logs::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2038,7 +2038,7 @@ void Client::HandleRespawnFromHover(uint32 Option)
|
||||
{
|
||||
if (PendingRezzXP < 0 || PendingRezzSpellID == 0)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Unexpected Rezz from hover request.");
|
||||
Log(Logs::Detail, Logs::Spells, "Unexpected Rezz from hover request.");
|
||||
return;
|
||||
}
|
||||
SetHP(GetMaxHP() / 5);
|
||||
@@ -2072,10 +2072,10 @@ void Client::HandleRespawnFromHover(uint32 Option)
|
||||
|
||||
if (corpse && corpse->IsCorpse())
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Hover Rez in zone %s for corpse %s",
|
||||
Log(Logs::Detail, Logs::Spells, "Hover Rez in zone %s for corpse %s",
|
||||
zone->GetShortName(), PendingRezzCorpseName.c_str());
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Found corpse. Marking corpse as rezzed.");
|
||||
Log(Logs::Detail, Logs::Spells, "Found corpse. Marking corpse as rezzed.");
|
||||
|
||||
corpse->IsRezzed(true);
|
||||
corpse->CompleteResurrection();
|
||||
|
||||
Reference in New Issue
Block a user