EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   Question for spell casting code gurus (https://www.eqemulator.org/forums/showthread.php?t=36955)

noudess 06-13-2013 06:46 PM

Question for spell casting code gurus
 
I was curious..

In spells.cpp there are several spots where Buffs are updated on when client is SoDAndLater (clients SoD+)

Code:

if(c->GetClientVersionBit() & BIT_SoDAndLater)
{
EQApplicationPacket *outapp = MakeBuffsPacket();
c->FastQueuePacket(&outapp);
}

while in spell_effects.cpp, buff durations are updated in a different, but almost opposite way when client NOT SoFAndLater (hence older than SoF):

Code:

        else if(IsClient() && !(CastToClient()->GetClientVersionBit() & BIT_SoFAndLater))
{
buffs[buffs_i].UpdateClient = true;
}
}

if(IsClient())
{
if(buffs[buffs_i].UpdateClient == true)
{
CastToClient()->SendBuffDurationPacket(buffs[buffs_i].spellid, buffs[buffs_i].ticsremaining, buffs[buffs_i].casterlevel);
buffs[buffs_i].UpdateClient = false;
}
}

Is this accurate? BuffsDurations are updated for older clients, but Updates to the Buff List is only done on newer ones?

KLS 06-13-2013 09:52 PM

The thing for the newer clients is the buffs you see in the target buffs window when you target something. While the durations are actual buff durations being modified for things like focus.

noudess 06-14-2013 08:43 AM

Quote:

Originally Posted by KLS (Post 221702)
The thing for the newer clients is the buffs you see in the target buffs window when you target something. While the durations are actual buff durations being modified for things like focus.


Aha! So The MakeBuffsPacket stuff has nothing to do with the standard buffs window?!

Only SendBuffDurationPacket is used for older clients?

I appreciate the information. I'm trying to understand why a couple of buffs display incorrectly on my Titanium client.

So, far, as I understand it:

- 3 action packets are sent to the client for beginning animation, completion and damage message.
- None of these include buff duration. I am assuming after several hours of trials that when the GUI (Titanium) displays the buff icon after the 2nd action message, that it is coming up with its own duration?
- I see that SendBuffDuration is done in BuffProcess when we have an older client like Titanium. This seems to be what is keeping the buffs up in the guild lobby (the update overwrites the still ticking down GUI code).

If the above observations are correct - Then I think I have a patch to fix the bug I am seeing, but only if the above is correct.

Are my above statements accurate?

noudess 03-02-2015 07:46 PM

Client::SendBuffDurationPacket not only impacts duration, but I am seeing a direct impact on some of the stats that we're impacted by the buff.

The function fills in the field "effect" in the SpellBuffFade_Struct with caster_level, which does not seem to be the correct value.

Testing:

- Cast lesser shielding and note your new max HP.
- click it off
- Put on an EEI item (bear-hide boots)
- Cast lesser shielding on yourself again.
- If you watch, maxHP goes to the correct value on the GUI, then changes again when the duration is updated by the SendBuffDurationPacket.

I ran tests using values of 0-11 for effect.

0 - cancelled the maxhP effect entirely.
1-11 - dropped the max HP effect down, each higher value leaving it more and more intact.

I don't know what should be placed in the effect field. I've put 255 in it for now and see no ill effects yet.

Similar problems happen with Holy Armor.

noudess 03-03-2015 10:18 AM

I hoped that I might watch packets from a live setup, but it doesn't appear to me that the liver server sends up a packet like we do to update the duration. It just starts out correct on the client as soon as the buff shows up.

noudess 03-03-2015 10:19 AM

I changed "effect" to 254 (a random large value) and the problems seem to go away. Does anyone have any information as to what this value should be? I don't want to break other clients or propose a pull request of a change I don't fully understand.

KLS 03-04-2015 12:55 AM

I'm not sure exactly, the packet is sort of a work around for not sending the correct data the first time I think.

If we could fix that I think ultimately that's the ideal solution.

noudess 03-04-2015 09:30 AM

Quote:

Originally Posted by KLS (Post 238345)
I'm not sure exactly, the packet is sort of a work around for not sending the correct data the first time I think.

If we could fix that I think ultimately that's the ideal solution.

I'm willing to learn more about how this works. My understanding right now is that when the client casts a spell, it puts its own buff up without information from the server at all. It's only when we need to update durartion (like focus) that we send info.

Are you saying we send a packet before that? I know when we zone, we put them all back up, but that seems to be fine anyway.


All times are GMT -4. The time now is 01:16 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.