archfan7411 / clearplayers

Python script to clear unused Minetest players, reducing lag
GNU General Public License v3.0
0 stars 0 forks source link

This algorithm should be completely/partial(just a fix to the error) rethinked #2

Open Sires0 opened 6 years ago

Sires0 commented 6 years ago

This won't work by the reason that extended attributes are stored at the start of the file, increasing the number of lines making line 18 and 42 not where the inventory respectivily starts and ends. If you want to keep this current algorithm idea(the partial solution) you would have to check from line total_number_of_lines - 32 to total_number_of_lines and 32 could be the "line" var that decreases one each iteration

archfan7411 commented 6 years ago

Hmm, you're right. Perhaps I could search through the lines until I find a "Item" or "Empty", signaling the beginning of the inventory? I also want to in the future support a command line argument for the number of initial items, so that complicates it a bit.