Page 1 of 1

Debugging in development environment

PostPosted: Mon Apr 04, 2016 8:13 pm
by Synchronize
Hey guys and gals,

I've just finished the process of installing and configuring the development environment. Next thing is offcourse to log in, create a char, and see if atleast some thing works.

So far so good, everything looked normal, I picked up the first Q, ran to deathknell, handed it in, etc etc.
Then I wanted to cast smite on some mob, i select a hostile mob, click the cast "Smite" button on my actionbar, the casting bar loads and finishes... and... nothing! :mrgreen:

Server displays this:
WORLD: got cast spell packet, spellId - 133, cast_count: 0 data length = 16
Sending SMSG_SPELL_START id=133
Sending SMSG_SPELL_GO id=133
WORLD: got cast spell packet, spellId - 133, cast_count: 0 data length = 16
Sending SMSG_SPELL_START id=133
Sending SMSG_SPELL_GO id=133


The world debug line is generated in /game/SpellHandler.cpp
Code: Select all
DEBUG_LOG("WORLD: got cast spell packet, spellId - %u, cast_count: %u data length = " SIZEFMTD,
              spellId, cast_count, recvPacket.size());


So far so good, atleast a spell id is received. Then this method is called:
Code: Select all
sSpellStore.LookupEntry(spellId);


Now my headaches start. How do I debug everything that follows? My C# background has left me spoiled - being able to debug everything at "debug-time". Do I really need to add textual logging of "everything", recompile and reset the server? Is there a smarter way of doing things?

Edit: also partly confusing to me is the fact that casting is possible on the nostalrius TBC server. How could it, if the codebase is the same.

Re: Debugging in development environment

PostPosted: Tue Apr 19, 2016 8:58 pm
by digpoe
If you take the code from https://github.com/NostalriusTBC/Core/pull/44 and overwrite the respective files with the new code, it should work correctly. That's how I fixed it in my dev environment.

Essentially what looks like the problem is that even though you're casting/whatever, the target you're trying to cast/whatever is 'out of range' (the server doesn't notify the client though, so the client thinks it's in range) and so the server doesn't do anything.

After copying the code over and recompiling, I haven't seen any problems and everything looks fine, even though there is apparently a merge conflict.