Skip to main content
  1. Posts/

Day 67 - Unreachable

OldDays seitan-spin

That is my quest, to follow that code…
That is my quest, to follow that code…

In which we try to test some code, just to find it’s beyond our reach.

Test Every Day
#

Let’s keep barrelling through that config file, and come back to fill in the holes after. What’s next?

NPCSkillGain
#

DragonsSpine/GameSystems/Skills/Skills.cs
187
188
189
190
191
192
193
194
195
/// Give skill for stealing and casting, and as a result of special block in combat
/// </summary>
/// <param name="ch"></param>
/// <param name="skillType"></param>
/// <param name="amount"></param>
public static void GiveSkillExp(Character ch, Globals.eSkillType skillType, int amount)
{
  if (System.Configuration.ConfigurationManager.AppSettings["NPCSkillGain"].ToLower() == "false" && !ch.IsPC)
    return;
DragonsSpine/GameSystems/Skills/Skills.cs
288
Utils.Log(ch.GetLogString() + " gained " + skillExpGained.ToString() + " " + skillType.ToString() + " skill.", Utils.LogType.SkillGainNonCombat);
DragonsSpine/GameSystems/Skills/Skills.cs
293
294
295
296
297
298
299
300
301
/// Called as a result of combat damage or magic spell success
/// </summary>
/// <param name="ch"></param>
/// <param name="target"></param>
/// <param name="skillType"></param>
public static void GiveSkillExp(Character ch, Character target, Globals.eSkillType skillType)
{
  if (System.Configuration.ConfigurationManager.AppSettings["NPCSkillGain"].ToLower() == "false" && !ch.IsPC)
    return;
DragonsSpine/GameSystems/Skills/Skills.cs
393
Utils.Log(ch.GetLogString() + " +" + skillExpGained + " " + skillType.ToString().ToLower() + " vs. " + target.GetLogString() + ".", Utils.LogType.SkillGainCombat);

Ok, let’s get some samples of those log messages. I start up the production server and let it run for a while…

$ ls
DS_7_17_16_CombatDamageToCreature.log
DS_7_17_16_Connection.log
DS_7_17_16_DeathCreature.log
DS_7_17_16_DeathLair.log
DS_7_17_16_EXCEPTIONS.log
DS_7_17_16_Exception.log
DS_7_17_16_Login.log
DS_7_17_16_LootAlways.log
DS_7_17_16_LootBelt.log
DS_7_17_16_LootRare.log
DS_7_17_16_LootVeryRare.log
DS_7_17_16_SpellBeneficialFromCreature.log
DS_7_17_16_SpellDamageFromMapEffect.log
DS_7_17_16_SpellDamageToCreature.log
DS_7_17_16_SpellHarmfulFromCreature.log
DS_7_17_16_SpellWarmingFromCreature.log
DS_7_17_16_SystemFailure.log
DS_7_17_16_SystemGo.log
DS_7_17_16_Timeout.log
DS_7_17_16_Unknown.log

Nope, no indication that the NPCs are ever making it to the skill increase code. Glancing through some of the calling functions, it appears that NPCs always wind up in another code path. We get to mark this at @bug and move on.

Just so that I have some tests for today, I did the Underworld Portal Chant ones.

36 scenarios (36 passed)
272 steps (272 passed)
6m53.199s

Useful Stuff
#


More to come
More to come

Day 67 code - tests