Magic

Magic

190k Downloads

Combat log plugin issue

Blamo27 opened this issue · 10 comments

commented

Hello,

There is an issue with combat log plugins.
Indeed, the plugin is called CombatTagPlus, but we actually tried with other plugins such as CombatLog or CombatLogX. The problem is that, even if we turn on the option avoiding the loss of any Magic items, the player still loses them.

Video link: https://streamable.com/6ral9

Is there a way to prevent that ?
Thanks.

commented

Ok I pushed a new option that may fix this- you can now set logout_delay: 1 in config.yml. This will delay processing logout for 1 tick, which should mean it happens after CombatTagPlus has killed the player.

On a side note, this may be part of the reason you had so many issues that I could not reproduce with the file-locking mechanism. If a player combat logs by switching servers, they'd get killed after magic has already processed their logout, which would force their player data to load again, but now it's loading while they are already on the other server. Just a theory, though.

Please let me know if this helps! Also my build server seems to be back up so you can grab this fix in the dev build here (this also includes your NCP fix for gliding- both are untested, though)

http://jenkins.elmakers.com/job/MagicPlugin/2821/com.elmakers.mine.bukkit.plugins$Magic/

commented

@NathanWolf On our server, CombatTagPlus block the /warp command, allowing players to switch from a server to another. So the problem you are referring to can not normally produce.

Okey thanks, we will test both fixes and I will let you know if it helps !

commented

@NathanWolf Tested with 1 and 2 ticks, Magic items are still cleared.
PS: If the player dies again, he will get back them.

commented
commented

I don't know if I'm going to be able to do anything more about this, sorry!

commented

Probably not, unless you can turn off whatever feature in that plugin that is taking players’ items.

commented

@NathanWolf The feature doesn't take the players items, it's just "instant kill" them.
And we can't remove this option, this plugin is just punishing the player trying to escape death ... 😢

commented

Oh hm, sorry, I think not. The problem is that the way "keep" items work is that they still get removed from the player's inventory on death (I think this may be unavoidable) but they are stored in Magic's player data and given back to the player on respawn.

So once the player has logged out, Magic has already saved their data and it's too late to do this.

Also unfortunately CombatTagPlus (not sure about the others) is listening for player death at he highest priority, so there's no way for me to make Magic catch the event afterward.

So... sadly I'm not sure there's anything I can do about this. I'll give it some more thought though.

commented

I can't imagine why that would make a difference unless the plugin is doing something special to the players' items on death, though?

I'll clone the code and see if it's doing anything weird. This would unfortunately be hard to test on my own, I imagine.

commented

Hm ok- so I think what's happening here is that Magic is handling the quit event before CombatTagPlus, so by the time the player is insta-killed Magic thinks they're logged out already, and so will ignore them.

I think I may be able to re-arrange the code a bit so it'll processes "keep on death" items even if the player is logged out, though.