[Performance] Reworked how all log calls are made in the source, see changelog.txt for more details

This commit is contained in:
Akkadius
2017-04-01 03:51:46 -05:00
parent 93a6efa95f
commit 7aa1d243b0
131 changed files with 3126 additions and 3066 deletions
+15 -15
View File
@@ -487,7 +487,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if(!target_zone) {
#ifdef SPELL_EFFECT_SPAM
Log.Out(Logs::General, Logs::None, "Succor/Evacuation Spell In Same Zone.");
Log(Logs::General, Logs::None, "Succor/Evacuation Spell In Same Zone.");
#endif
if(IsClient())
CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), x, y, z, heading, 0, EvacToSafeCoords);
@@ -496,7 +496,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
}
else {
#ifdef SPELL_EFFECT_SPAM
Log.Out(Logs::General, Logs::None, "Succor/Evacuation Spell To Another Zone.");
Log(Logs::General, Logs::None, "Succor/Evacuation Spell To Another Zone.");
#endif
if(IsClient())
CastToClient()->MovePC(target_zone, x, y, z, heading);
@@ -708,7 +708,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
stun_resist += aabonuses.StunResist;
if (stun_resist <= 0 || zone->random.Int(0,99) >= stun_resist) {
Log.Out(Logs::Detail, Logs::Combat, "Stunned. We had %d percent resist chance.", stun_resist);
Log(Logs::Detail, Logs::Combat, "Stunned. We had %d percent resist chance.", stun_resist);
if (caster && caster->IsClient())
effect_value += effect_value*caster->GetFocusEffect(focusFcStunTimeMod, spell_id)/100;
@@ -718,7 +718,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if (IsClient())
Message_StringID(MT_Stun, SHAKE_OFF_STUN);
Log.Out(Logs::Detail, Logs::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist);
Log(Logs::Detail, Logs::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist);
}
}
break;
@@ -1659,7 +1659,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if (IsCorpse() && CastToCorpse()->IsPlayerCorpse()) {
if(caster)
Log.Out(Logs::Detail, Logs::Spells, " corpse being rezzed using spell %i by %s",
Log(Logs::Detail, Logs::Spells, " corpse being rezzed using spell %i by %s",
spell_id, caster->GetName());
CastToCorpse()->CastRezz(spell_id, caster);
@@ -1782,7 +1782,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
}
else {
Message_StringID(4, TARGET_NOT_FOUND);
Log.Out(Logs::General, Logs::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id);
Log(Logs::General, Logs::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id);
}
}
@@ -3077,7 +3077,7 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level,
int oval = effect_value;
int mod = ApplySpellEffectiveness(spell_id, instrument_mod, true, caster_id);
effect_value = effect_value * mod / 10;
Log.Out(Logs::Detail, Logs::Spells, "Effect value %d altered with bard modifier of %d to yeild %d",
Log(Logs::Detail, Logs::Spells, "Effect value %d altered with bard modifier of %d to yeild %d",
oval, mod, effect_value);
}
@@ -3140,7 +3140,7 @@ snare has both of them negative, yet their range should work the same:
updownsign = 1;
}
Log.Out(Logs::Detail, Logs::Spells, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d",
Log(Logs::Detail, Logs::Spells, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d",
spell_id, formula, base, max, caster_level, updownsign);
switch(formula)
@@ -3362,7 +3362,7 @@ snare has both of them negative, yet their range should work the same:
result = ubase * (caster_level * (formula - 2000) + 1);
}
else
Log.Out(Logs::General, Logs::None, "Unknown spell effect value forumula %d", formula);
Log(Logs::General, Logs::None, "Unknown spell effect value forumula %d", formula);
}
}
@@ -3387,7 +3387,7 @@ snare has both of them negative, yet their range should work the same:
if (base < 0 && result > 0)
result *= -1;
Log.Out(Logs::Detail, Logs::Spells, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":"");
Log(Logs::Detail, Logs::Spells, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":"");
return result;
}
@@ -3414,12 +3414,12 @@ void Mob::BuffProcess()
--buffs[buffs_i].ticsremaining;
if (buffs[buffs_i].ticsremaining < 0) {
Log.Out(Logs::Detail, Logs::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i);
Log(Logs::Detail, Logs::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i);
BuffFadeBySlot(buffs_i);
}
else
{
Log.Out(Logs::Detail, Logs::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining);
Log(Logs::Detail, Logs::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining);
}
}
else if (IsClient() && !(CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoFAndLater))
@@ -3760,7 +3760,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
if (IsClient() && !CastToClient()->IsDead())
CastToClient()->MakeBuffFadePacket(buffs[slot].spellid, slot);
Log.Out(Logs::Detail, Logs::Spells, "Fading buff %d from slot %d", buffs[slot].spellid, slot);
Log(Logs::Detail, Logs::Spells, "Fading buff %d from slot %d", buffs[slot].spellid, slot);
if(spells[buffs[slot].spellid].viral_targets > 0) {
bool last_virus = true;
@@ -4789,7 +4789,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
return 0;
break;
default:
Log.Out(Logs::General, Logs::Normal, "CalcFocusEffect: unknown limit spelltype %d",
Log(Logs::General, Logs::Normal, "CalcFocusEffect: unknown limit spelltype %d",
focus_spell.base[i]);
}
break;
@@ -5146,7 +5146,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
// this spits up a lot of garbage when calculating spell focuses
// since they have all kinds of extra effects on them.
default:
Log.Out(Logs::General, Logs::Normal, "CalcFocusEffect: unknown effectid %d",
Log(Logs::General, Logs::Normal, "CalcFocusEffect: unknown effectid %d",
focus_spell.effectid[i]);
#endif
}