Jump to content

OnRaidableDespawnUpdate

Pending 3.1.3

IIIaKa
IIIaKa

Posted

Hello. I launched a clean PvP(server.pve false) server with only two plugins: CopyPaste and RaidableBases.
The only thing I added was a PrintWarning before calling the OnRaidableDespawnUpdate hook. Then I fired an incendiary rocket from a rocket launcher at BuildingBlock(walls, ceilings, etc), and it shows that, for some unknown reason, the damage type is Cannon. Because of this, your Heat protection doesn't work, which results in the OnRaidableDespawnUpdate hook being spammed.
image.png
image.png
image.png


I suggest removing the damage type check and replacing lastDespawnUpdateTime with nextDespawnUpdateTime.
I tried this, and the spam decreased. I'm not sure who else uses the OnRaidableDespawnUpdate hook, but I think the delay could be increased to around 0.3-0.5(for RealPVE it's enough).
image.png
image.png

IIIaKa

Posted (edited)

As far as I understand, Protector is called every second, as well as on player entry and when the owner is updated.
I might be wrong, but I think it would be even better to replace lastDespawnUpdateTime with a boolean value(something like despawnTimeUpdated).
Then, inside UpdateDespawnDateTime(float time, HitInfo info), set it to true.
image.png
Also, the HitInfo parameter can be removed from the UpdateDespawnDateTime method.

And in Protector(), before if (DateTime.Now >= despawnDateTime), call the OnRaidableDespawnUpdate hook if despawnTimeUpdated == true, and then set it back to false after the call.
image.png

 

Edited by IIIaKa

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.3m
Total downloads
Customers
10.7k
Customers served
Files Sold
155k
Marketplace sales
Payments
3.3m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.