Denied Player item clean up

Discussion in 'Suggestions' started by vwman67, Sep 17, 2017.

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

    vwman67 President
    President ⛰️⛰️ Ex-President ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Apr 2, 2013
    Messages:
    171
    Trophy Points:
    32,990
    Gender:
    Male
    Ratings:
    +22
    Minecraft Name
    Vwman67

    Suggestion
    OK i get it that there has be a little maintenance of players off line to save hard disk space. but i think there needs to be added a filter for star tools. to be overlooked added in there some where.

    Reason
    as we have lost on due to it.
     
  2. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,963
    Trophy Points:
    87,660
    EcoDollars:
    $27,000,000
    Ratings:
    +4,866
    Please note: The following is based on my own experiments. ECC might use a different approach to reduce server file space, but this one appears to match the visible effects of ECC's 14-days-offline clear.



    Minecraft/Spigot stores player-specific data in NBT files. They contain a lot of data, but most importantly the player inventory (and enderchest, which I had to omit from the following examination because I don't have enough time right now).


    This data can be arranged in a tree. I decided to focus on my own file, d9d1654b-ce73-46dd-a6e8-fcde92b53926.dat.
    [​IMG]
    My inventory contains one minecraft:diamond_pickaxe with an enchant ID of 32 (efficiency) at level VII and an enchant ID 33 (silk touch) at level I. It's possible to read this data when it's formatted like that, but there is a problem.

    This is what the actual d9d1654b-ce73-46dd-a6e8-fcde92b53926.dat file looks like.
    [​IMG]
    Can you find the Eff7? I can't.

    Okay, I'm not being absolutely truthful here: There is an old NBT format specification at http://web.archive.org/web/20110723210920/http://www.minecraft.net/docs/NBT.txt, which tells us that the data we see is actually a gzip archive.

    One gzip -d later...

    This looks much better.
    [​IMG]
    However, as the name says, NBT is a Named Binary Tag - which means that parts of our data are actually stored in binary data. Can you find the eff7?

    It's right here.
    [​IMG]
    "lvl[NUL][BEL][STX][NUL][STX]id[NUL] " identifies it as an efficiency 7 pickaxe. Why? Let's convert everything from ASCII to actual binary values.
    Code:
    "lvl"
    NUL        0
    BEL        7
    STX        2
    NUL        0
    STX        2
    "id"
    NUL        0
    Spacebar  32
    
    Long story short:
    The BEL byte with the decimal value 7 identifies it as a level 7 enchantment, the spacebar byte with the decimal value 32 identifies it as enchantment ID 32, i.e. efficiency.

    To summarize, we would need a program that does the following:
    1. Unzip the NBT data file.
    2. Search for eligible items (pickaxes, shovels, axes, armor, fishing rods, [potentially equipped] elytras [which would then be at a different location in the NBT data]).
    3. Search an efficiency enchantment with ID 32 ( ) and level 7 (BEL) to identify an eff7 pickaxe.
    4. Search an efficiency enchantment with ID 32 ( ) and level 10 (LF) to identify an eff10 shovel or axe.
    5. Search a protection enchantment with ID 0 (NUL) and level 5 (ENQ) to identify prot5 star armor.
    6. Search a lure enchantment with ID 62 (>) and level 5 (ENQ) to identify a lure5 fishing rod.
    7. Continue searching for every single star shop item in every single inventory slot because I can't be bothered to add another I-don't-even-know-how-many cases for every single star tool to this list.
    8. Repeat steps 2-7 for the enderchest contents, which I had to ignore due to a lack of time.
    9. Decide whether to delete or skip the file based on the previous tests. Star tools can't just be "overlooked" unless you want to make this even more complicated, so we won't wipe any other items from an inventory that contains a star item.
    10. Repeat steps 1-9 for every single user who has been offline for a bit.

    To be honest:
    I'd say Jamie has more important things to do than writing a program that evaluates Minecraft's binary data format.
     
    • Like Like x 1
    • Informative Informative x 1
    • List
    #2 314, Sep 17, 2017
    Last edited: Sep 17, 2017
  3. Capbo_

    Capbo_ Reformed Scammer
    Tycoon ⛰️⛰️⛰️ Ex-EcoMaster ⚜️⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Jun 21, 2016
    Messages:
    1,237
    Trophy Points:
    57,660
    Gender:
    Male
    EcoDollars:
    $1,348,456
    Ratings:
    +3,040
    @314 please correct me if I'm wrong. If this program had to do this for every offline player, would it not lag the server?
     
  4. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,963
    Trophy Points:
    87,660
    EcoDollars:
    $27,000,000
    Ratings:
    +4,866
    The effect should be negligible compared to a server that needs to send chunk data to 60-70 players at the same time, handle their movement, chat, commands, inventories and so much more.
     
  5. cdlawrence

    cdlawrence Nubby Nubs
    Builder ⛰️ Ex-EcoLeader ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Dec 10, 2012
    Messages:
    363
    Trophy Points:
    38,490
    Gender:
    Male
    Ratings:
    +273
    But star tools removed from economy are good and hoarded star tools reappearing in economy is bad
     
  6. 12345shane

    12345shane ρяєѕι∂єитιαℓ ρяαєтσя
    Builder ⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ I ⭐ Premium Upgrade

    Joined:
    Dec 25, 2011
    Messages:
    2,853
    Trophy Points:
    81,160
    Gender:
    Male
    Ratings:
    +2,132
    as an inactive player i absolutely support the clearing of items... helps the economy a bit and then there's the fact that it's really not that hard to not lose stuff as long as you don't get banned or something with star tools in your inv
     
  7. JamieSinn

    JamieSinn Retired Lead Administrator/Developer
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Jun 4, 2011
    Messages:
    5,517
    Trophy Points:
    78,090
    Gender:
    Male
    Ratings:
    +4,588
    Not feasible due to how we do cleanups. Sorry. Your items are your responsibility.
     
Thread Status:
Not open for further replies.