Filled Erase

Discussion in 'Plugin Requests' started by Resoluciones, Nov 22, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    Resoluciones

    Plugin category: Mechanics

    Minecraft version: Paper version git-Paper-262 (MC: 1.16.4) (Implementing API version 1.16.4-R0.1-SNAPSHOT)

    Suggested name: Erase


    What I want: I would like a command that would be executed by console or by other pluginsas as follows:

    • /erase 7 # all playerdata files for all players that were inactive for 7 real world days (in example) are deleted from the worlds/server.
    Ideas for config:

    - Returning players: "Your data was deleted for inactivity"
    - Online players notification (logged in console also): "playername1, playername2, etc etc etc were deleted for inactivity"

    Ideas for permissions: erase.inactives

    When I'd like it by: Whenever it is possible.
     
  2. Online

    timtower Administrator Administrator Moderator

    @Resoluciones Slight issue with this: you can delete user data, but also having it delete economy stuff etc requires us to know which plugins you want to delete from.
     
  3. Offline

    Resoluciones

    It is important what you say, thanks timtower!

    My economy plugin already has that function (autodeleting balances), also has a command for that to manually do it.

    There are not other plugins tracking user info currently.

    Thank you very much!
     
  4. Offline

    KarimAKL

    Last edited by a moderator: Nov 23, 2020
    Resoluciones likes this.
  5. Offline

    Resoluciones

    Great! I will test it in a moment!!!!!!!!!!!
    Thanks!!!!!!!!!!!!!

    EDIT: follows error in console: https://pastebin.com/gXejqE6G

    Maybe you have time to check it. Thanks!
     
    Last edited: Nov 23, 2020
    KarimAKL likes this.
  6. Offline

    KarimAKL

    Resoluciones likes this.
  7. Offline

    Resoluciones

    Thanks Karim, the plugin loads perfect!

    Can I ask you, it seems the plugin is activating the deletion itself. Can this be possible? I mean, was that intentionally?

    If possible can you add a way to deactivate that? as I prefer to do it manually or by other plugins or by the control panel task creator
    upload_2020-11-24_7-22-22.png

    Thanks!
     

    Attached Files:

    KarimAKL likes this.
  8. Offline

    KarimAKL

    Yes. That was intentional, but only because I forgot the exact purpose of the command and remembered wrong. The plugin is set to check for any playerdata files older than the set time, every 5 minutes.

    Yes. I will do that. Sorry about the inconvenience. When you say "deactivate", do you want it to still be an option toggleable in the config file?
     
  9. Offline

    Resoluciones

    that would be not necesary for me Karim

    Thanks!!!!!!
     
  10. Offline

    KarimAKL

    @Resoluciones This should do it: https://www.dropbox.com/s/ttvd21eu0jxmju7/Erase 1.0.jar?dl=0

    Note: The command works like this:
    Code:Java
    1. /erase 7ms = 7 milliseconds
    2. /erase 7s = 7 seconds
    3. /erase 7m = 7 minutes
    4. /erase 7h = 7 hours
    5. /erase 7d = 7 days
    6. /erase 7w = 7 weeks
    7. /erase 7M = 7 months
    8. /erase 7y = 7 years

    There are some alternatives as well:
    Alternatives (open)
    Code:Java
    1. // Milliseconds
    2. /erase 7ms = 7 milliseconds
    3. /erase 7milliseconds = 7 milliseconds
    4. /erase 7millisecond = 7 milliseconds
    5.  
    6. // Seconds
    7. /erase 7s = 7 seconds
    8. /erase 7seconds = 7 seconds
    9. /erase 7second = 7 seconds
    10.  
    11. // Minutes
    12. /erase 7m = 7 minutes
    13. /erase 7minutes = 7 minutes
    14. /erase 7minute = 7 minutes
    15.  
    16. // Hours
    17. /erase 7h = 7 hours
    18. /erase 7hours = 7 hours
    19. /erase 7hour = 7 hours
    20.  
    21. // Days
    22. /erase 7d = 7 days
    23. /erase 7days = 7 days
    24. /erase 7day = 7 days
    25. /erase 7 = 7 days (default time unit)
    26.  
    27. // Weeks
    28. /erase 7w = 7 weeks
    29. /erase 7weeks = 7 weeks
    30. /erase 7week = 7 weeks
    31.  
    32. // Months
    33. /erase 7M = 7 months
    34. /erase 7mo = 7 months
    35. /erase 7months = 7 months
    36. /erase 7month = 7 months
    37.  
    38. // Years
    39. /erase 7y = 7 years
    40. /erase 7years = 7 years
    41. /erase 7year = 7 years
     
    Resoluciones likes this.
  11. Offline

    Resoluciones

    Plugin is working perfect, thanks!!!

    @KarimAKL May I ask you for an addition that came to my mind? Would it be possible that when the playerdata is erased, the items in the player's inventory are automatically dropped on the position when that player last logged out? Other option, is that the items go directly to the "garbage collector" as I have another plugin that recycles the items in the "garbage collector".

    That would help me a lot, as I am trying ways to "recycle" items in my server.

    Thanks!
     
  12. Offline

    KarimAKL

    Great! I am glad to hear it.

    Sure, I do not think that will be a problem.

    What "garbage collector" are you talking about?
     
  13. Offline

    Resoluciones

    @KarimAKL "Garbage collector" maybe it is not the correct name. You know the setting " item-despawn-rate: 6000" those items are sent to somewhere that I don't know how to call it. And then, remember that plugin you recreate some time ago that catches those despawned items and then are recovered back when braking something? I was thinking on the possiblity of items from inactive people are sent to that place also, in case it is possible of course.
     
  14. Offline

    KarimAKL

    I do not remember how I did that, so I will have to look at the source code (I believe I still have it), and then I will probably have to add an API of sorts for it.

    They are probably just removed from the game, but I should be able to catch them somehow (if the other plugin does not already do that).

    PS: "garbage collector" is a fine name, I just did not know what you were talking about. :p
     
    Resoluciones likes this.
  15. Offline

    KarimAKL

    @Resoluciones Lately I have been busier than I usually am, and then I decided to try something new, so it might have taken a little longer, but it should be done and working. However, it is untested, so let me know if you encounter any problems.

    Erase: https://www.dropbox.com/s/ttvd21eu0jxmju7/Erase 1.0.jar?dl=0
    Equinox: https://www.dropbox.com/s/remneytgmkumdd2/Equinox 1.0.jar?dl=0

    There should be no difference to Equinox, other than the fact that I made Erase able to access the items in it, which then requires you to get that version of it.

    Edit: Btw, do you want me to remove "<server>/<world>/stats/<uuid>.json" as well as "<server>/<world>/playerdata/<uuid>.dat"?
     
    Last edited by a moderator: Nov 30, 2020
    Resoluciones likes this.
  16. Offline

    Resoluciones

  17. Offline

    KarimAKL

    Resoluciones likes this.
  18. Offline

    Resoluciones

    Thank you Karim!

    /erase is giving internal error as per detail in pastebin: https://pastebin.com/eNqShCjB

    Maybe you have time to check it.

    Thanks!
     
  19. Online

    timtower Administrator Administrator Moderator

    @Resoluciones Please post your full log as the plugin seems to not start at all.
     
  20. Offline

    Resoluciones

    you are right! let me check it!

    @KarimAKL pls forget the error above, it was my fault! I will let you know if any issues! Thanks!

    EDIT: follows "real" error, I think: https://pastebin.com/DgSqMnkj

    Thanks!
     
    Last edited: Dec 1, 2020
    timtower likes this.
Thread Status:
Not open for further replies.

Share This Page