Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 06-13-2013, 06:46 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default 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?
Reply With Quote
  #2  
Old 06-13-2013, 09:52 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

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.
Reply With Quote
  #3  
Old 06-14-2013, 08:43 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

Quote:
Originally Posted by KLS View Post
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?
Reply With Quote
  #4  
Old 03-02-2015, 07:46 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

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.
Reply With Quote
  #5  
Old 03-03-2015, 10:18 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

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.
Reply With Quote
  #6  
Old 03-03-2015, 10:19 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

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.
Reply With Quote
  #7  
Old 03-04-2015, 12:55 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

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.
Reply With Quote
  #8  
Old 03-04-2015, 09:30 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

Quote:
Originally Posted by KLS View Post
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 08:22 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3