Djaytan / mc-jobs-reborn-patch-place-break

A place-break patch extension of JobsReborn plugin for Bukkit servers (Minecraft).
MIT License
6 stars 2 forks source link

Patch tags not persisted across server restart #1

Closed InsideIntel closed 2 years ago

InsideIntel commented 2 years ago

Describe the bug So, as stated in the spigot page, you aren't supposed to be paid for blocks placed by players after restarts. "The patch is very simple: when breaking or placing blocks, each one is tagged. This information is persisted across server restarts.". I seem to be getting paid (as op and as not an op) for the blocks i mined while in the job after a server restart. However, you do not get paid for the blocks placed before a server restart.

To Reproduce Steps to reproduce the behavior:

  1. Turn server off
  2. Verify both plugins exists
  3. Verify all config options that is said on the spigot pages are correct.
  4. Turn server on
  5. Join job
  6. Verify you get paid for said job
  7. Place job blocks
  8. Verify you don't get paid for said job
  9. Place more job blocks
  10. Turn server off
  11. Turn server on
  12. You get paid for the placed blocks

Expected behavior I expect to not get paid when the server restarts

Screenshots image

Minecraft (please complete the following information):

Djaytan commented 2 years ago

Hi @InsideIntel,

Thanks for reporting the issue. I have well understood the problem shared and I will inspect that and then try to give a fix.

I will provide a feedback later this week.

Best Regards, Djaytan

InsideIntel commented 2 years ago

Thank you for the quick response!

InsideIntel commented 2 years ago

Any updates on this? Our server is out and I don't want people exploiting the bug, some people know about it, but if others find out, then they'l start making farms and then mining it when the server restarts

InsideIntel commented 2 years ago

Hello, any updates?

Djaytan commented 2 years ago

@InsideIntel sorry for the late.

I didn't find the time to check the issue. I will give a first look tomorrow.

Djaytan

InsideIntel commented 2 years ago

Thank you!

Djaytan commented 2 years ago

Hi @InsideIntel,

It seems that metadata aren't persisted accross server restarts in contrary to what I expected. I have tested it and you're right.

I must rework the system in order to store information in data file or a database... This isn't a trivial task which take only 5 minutes to do...

I give myself one hour now to try to make a fix.

Djaytan commented 2 years ago

@InsideIntel

Sorry to announce you that, but I will not be able to make the job done. This will require to rework the whole plugin. Even if the plugin isn't very big, this will take me approximatively ten hours to fix the issue. Actually, I don't have this whole time available.

Maybe I will find the time to achieve this along the august month. I can't to better than that.

I can imagine your deception, especially because I know so well the hell that's to deal with this place-break issue. I can't even say to yourself to try your best with the JobsReborn plugin because it doesn't provide piston patch... So actually there isn't any perfect solution and I'm sorry about that.

PS: I can try to find time this friday... But I can't make any promise about it.

InsideIntel commented 2 years ago

Ok thank you, ;(

InsideIntel commented 2 years ago

Is there any progress on this?

Djaytan commented 2 years ago

Hi @InsideIntel,

I have time now to work on it. I will try to make the fix today

InsideIntel commented 2 years ago

Thank you!

Djaytan commented 2 years ago

I think I will have something working today if things go well

InsideIntel commented 2 years ago

Oh cool, thanks for the update

Djaytan commented 2 years ago

I success to get ride of Bukkit's system about non-persistent metadata. However, the persistence isn't done yet. This was only the preparing part of the job.

Now, I'm currently developping a solution with SQLite to store data which will remain available after server restart. The database will have the form of a file which will be placed in the data folder of the plugin.

If you're ok with that, I will give you a beta version of the plugin monday in order to let you test it and give me feedbacks about the fix in real situations.

InsideIntel commented 2 years ago

I'm 100% ok with that, thank you very much!

Djaytan commented 2 years ago

Hi @InsideIntel,

I've made the fix, try this pre-release : https://github.com/Djaytan/mc-jobs-reborn-patch-place-break/releases/tag/v1.2.0-RC1

Like we agreed previously, report me any issue you encounter with this one. However, note that I will not be able to make any adjustement before saturday.

Enjoy!

Djaytan commented 2 years ago

Hi @InsideIntel,

Any feedback?

InsideIntel commented 2 years ago

Sorry it took so long to respond. It seems to be working now, thank you.

InsideIntel commented 2 years ago

I'll wait till u make the jar smaller or something because 15MB file for jar lmao

InsideIntel commented 2 years ago

I uploaded the plugin on my main server and when people activate piston machines, it lags the server

Djaytan commented 2 years ago

I'll wait till u make the jar smaller or something because 15MB file for jar lmao

Is there any special need to use a smaller jar? The size of the jar is explained by the used of useful librairies like Guice (unfortunately not integrated by default to Bukkit but definitively highly recommanded in lots of software developments). I will take a look if there is anything I can do about that

Djaytan commented 2 years ago

I uploaded the plugin on my main server and when people activate piston machines, it lags the server

Ok thanks a lot for this feedback, it's possible that the problem come from the plugin effectively. How do you have made the conclusion that lags come from the plugin? Remove of the jar? Use of Aïkar Timings? Anything else?

InsideIntel commented 2 years ago

I uploaded the plugin on my main server and when people activate piston machines, it lags the server

Ok thanks a lot for this feedback, it's possible that the problem come from the plugin effectively. How do you have made the conclusion that lags come from the plugin? Remove of the jar? Use of Aïkar Timings? Anything else?

https://timings.aikar.co/dev/?id=da61eb55d73144d8a759d979a889cb0d

InsideIntel commented 2 years ago

I'll wait till u make the jar smaller or something because 15MB file for jar lmao

Is there any special need to use a smaller jar? The size of the jar is explained by the used of useful librairies like Guice (unfortunately not integrated by default to Bukkit but definitively highly recommanded in lots of software developments). I will take a look if there is anything I can do about that

Uhh, it's just that the other jar was 23 KB and this one is 15 MB

Djaytan commented 2 years ago

Hi @InsideIntel,

Can you try this one? https://github.com/Djaytan/mc-jobs-reborn-patch-place-break/releases/tag/v1.2.0-RC2

Normally it fix the performance issue

InsideIntel commented 2 years ago

I'll try it, but I won't be able to for a couple of days, thx

InsideIntel commented 2 years ago

It still lags the server unfortunately

InsideIntel commented 2 years ago

When i activate this machine: image It starts to lag the server while JobsReborn-PatchPlaceBreak 1.2.0 is on the server. 1.1.3 doesn't lag the server.

Djaytan commented 2 years ago

I have some clues about the source of the issue. I will inspect it tomorrow.

Thanks for feedback!

Djaytan commented 2 years ago

Hi @InsideIntel,

I pray that all it's good now ahah: https://github.com/Djaytan/mc-jobs-reborn-patch-place-break/releases/tag/v1.2.0-RC3

Enjoy!

Djaytan commented 2 years ago

Hi @InsideIntel,

Any feedback? Is it working well now?

Djaytan commented 2 years ago

No news, I considere the issue as fixed.