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-17-2013, 01:19 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default Question about Client::SendBuffDurationPacket

I started a different thread about buffs being displayed incorrectly. Consider that one irrelevant.

FIRST: This only applies to clients PRE SoF.

I see that Client::SendBuffDurationPacket is used by Mob::BuffProcess. My understanding after reading the code, and stepping through it with kdbg, is that Client::SendBuffDurationPacket is only being called when BuffProcess is NOT ticking down buffs. BuffProcess does not tick down buffs when a zone has tickdown suspended , ala the guild lobby.

So, we're only calling Client::SendBuffDurationPacket in the guild lobby/hall. I see the effect of this is that we counter the fact that the GUI is ticking down in the guild lobby and the server thinks this is incorrect.

Looking at Client::SendBuffDurationPacket, it uses a packet with the duration we want restored. It chooses to use slot 2 in the packet. A side effect of this, is whatever is in slot 2 for the buff being updated with an new duration, also processes again. So for example, if you're in the GL and you have bravery up, slot 2 for bravery is max_HP. That bump from bravery keeps getting reapplied, so that in the GL your max HP is unusually out of whack. If you have say, augmentation up, then AGI goes sky high, as agi si slot 2.

My question is this: Is there a way to update spell duration only? I've tried various things like : slot 0 or one of the blocking slots. That just breaks the call entirely (ie nothing updates).

I am not really concerned with the GL/Hall, but I have a couple of spots where I want to update the duration from the server, where the GUI is incorrect and I can't find a way to do that without reapplying some part of a buff and screwing that up.

The code that's there today that whacks out slot 2 is below. The comments seem to imply it is used more often, but it is not.

Code:
//This member function sets the buff duration on the client
//however it does not work if sent quickly after an action packets, which is what one might perfer to do
//Thus I use this in the buff process to update the correct duration once after casting
//this allows AAs and focus effects that increase buff duration to work correctly, but could probably
//be used for other things as well
void Client::SendBuffDurationPacket(uint16 spell_id, int duration, int inlevel)
{
	EQApplicationPacket* outapp;
	outapp = new EQApplicationPacket(OP_Buff, sizeof(SpellBuffFade_Struct));
	SpellBuffFade_Struct* sbf = (SpellBuffFade_Struct*) outapp->pBuffer;

	sbf->entityid = GetID();
	sbf->slot=2;
	sbf->spellid=spell_id;
	sbf->slotid=0;
	sbf->effect = inlevel > 0 ? inlevel : GetLevel();
	sbf->level = inlevel > 0 ? inlevel : GetLevel();
	sbf->bufffade = 0;
	sbf->duration = duration;
	FastQueuePacket(&outapp);
}
Reply With Quote
  #2  
Old 06-28-2013, 09:22 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

Anyone? I could try and get the old packet sniffer out on live, but I'd much rather work on content. I guess its possible there is no packet to update only the duration?
Reply With Quote
  #3  
Old 06-28-2013, 10:19 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

You're calling it in more than guild lobby, it's also being called when you have duration inc focus. I'm not sure about the restacking effects.
Reply With Quote
  #4  
Old 06-30-2013, 02:39 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

I've tried to reproduce the stacking issue on titanium and have basically not gotten it to stack like described in GH. Using bravery I'm still at the exact same hp as when i cast it.
Reply With Quote
  #5  
Old 07-09-2013, 10:17 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

Interesting.

Strip off all your buffs. Check HP. Cast bravery. Bravery should add hp as per spell description. Here, I see it added correctly, and then the next time the function gets called, it goes up again until it hits some cap.

Perhaps you need to try with a char who's HP are not near or already capped? Try with a low level. Any buff with a slot 2 effect has this bug. If I let this code work outside the GL, spells like SoW leapfrog up and people move faster.

On my side, maybe I need to get your lastest versions of the files?
Reply With Quote
  #6  
Old 07-09-2013, 04:27 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

I sorta reproduced it but it only stacked once.

I changed the duration packet function to:

Code:
	EQApplicationPacket* outapp;
	outapp = new EQApplicationPacket(OP_Buff, sizeof(SpellBuffFade_Struct));
	SpellBuffFade_Struct* sbf = (SpellBuffFade_Struct*) outapp->pBuffer;

	sbf->entityid = GetID();
	sbf->slot = -1;
	sbf->spellid = spell_id;
	sbf->slotid = 0;
	sbf->effect = inlevel > 0 ? inlevel : GetLevel();
	sbf->level = 0;
	sbf->bufffade = 0;
	sbf->duration = duration;
	FastQueuePacket(&outapp);
Though I'm fairly certain level / effect are swapped on some clients so gotta look into that but that seemed to work for titanium.
Reply With Quote
  #7  
Old 07-09-2013, 04:43 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

I think I tried -1, and oither non-stat slots. Those basically broke it for me.

On titanium, the GUI handles buff duration tickdown. The Guild Lobby (not hall, the gui knows about hall) started to tick down buffs, since this call no longer had an effect. At least that's what happened when I tried -1 and other non-stat slot options.

I am glad you reproduced it.
Reply With Quote
  #8  
Old 07-10-2013, 01:31 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

I've gotta play around with it some more but it did appear to work at least initially. I don't think we have a really good idea on how this packet actually works which is the issue.
Reply With Quote
  #9  
Old 07-10-2013, 08:01 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

The best place to test it is the GL on Titanium. There, the code is being used to keep the timer from ticking down. If it ticks down, the change broke the call.

Everywhere else, its hard to see if its working, as the GUI does the duration maintenance.

Briefly, I allowed the code to always update duration, but outside the GL I got buffs mega stacked.
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 07:31 PM.


 

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