TShock
TShock copied to clipboard
Fix player buffs applied to other players through `PlayerAddBuff` packet
Fixed HandlePlayerAddBuff
data handler always being marked as Handled
, and therefore never allowing the PlayerAddBuff
to be sent to anyone.
Fixed OnPlayerBuff
logic inside of Bouncer when checking WhitelistBuffMaxTime
to determine if a buff being applied longer than allowed. This also marks the handler as Handled
if the check fails, and resyncs the buffs with the PlayerAddBuff
packet to the sender. (@drunderscore)
The original bug is that when shooting another player with a Cursed Arrow (to apply Cursed Inferno), the check against WhitelistBuffMaxTime
was using <=
instead of >
, which prevented the buff from being applied -- but never actually did because it was marked as not handled. Only a second bug within the HandlePlayerAddBuff
data handler allowed this bug to continue.
Ichor Arrows (to apply Ichor) will fail simply because of the second bug.
@bartico6 Yeah I see what you mean, definitely a good idea to only allow buffs that happen in vanilla to others (which should be a short list regardless)
I'll go through and update WhitelistBuffMaxTime
with all buffs and their max time, and remove the > 0
check.
Just commit a fix with the buffs you're currently seeing problems with.
@bartico6 fyi, this was updated, can you check again?
Rebased, whitelisted more buffs, and added CanOnlyBeAppliedToSender
, to indicate that the sender may only apply this buff to themself. This is used by BuffIDs.Campfire
(aka Cozy Fire), BuffID.WaterCandle
, and some others.
@drunderscore still has merge conflicts on GitHub on web, can you fix with a rebase so that it runs CI?
@hakusaro Fixed! Sorry about that, I actually didn't rebase even though I thought I did...
https://github.com/Pryaxis/TShock/compare/c93cc7bb09d34c19fc908ca201061f5b9fc52f7d..b2214685ca3d49ea009112cb97a1d21e9cf9bd66
Added buff limits for MonsterBanner
, HeartLamp
, PeaceCandle
, StarInBottle
, CatBast
https://github.com/Pryaxis/TShock/compare/b2214685ca3d49ea009112cb97a1d21e9cf9bd66..f53367399fd1baa7aad55ca77f827fa3b2e2f8f6
Anyone know the status on this?
The Venom buff in Main.pvpBuff
change will be removed, as it has been corrected by Re-Logic in 1.4.4. All of the existing buff limits will be checked to ensure they are still correct.
There are certainly still some missing buff limits, but I think it would be beneficial to review and merge this, as we would only gain more features.
I'll take another look at this today, and hopefully persuade some others to review.
I've rebased this, and the only thing I've removed is the Main.pvpBuff[BuffID.Venom] = true
patch as described earlier.
@hakusaro or @Arthri if you are able to review, I'd appreciate it -- I believe this to be ready to merge, other missing buff limits can be added in due time.
Changed buff limits for Solar Armor (SolarShield1
, SolarShield2
, SolarShield3
), to allow them to be applied by non-senders. Added limits for Hellfire (OnFire3
), Hearty Meal, and Frostbite (Frostburn2
).