Muted Players File??? (IMPORTANT)

Discussion in 'Spigot Help' started by BlackDemonZ, Apr 30, 2017.

  1. Where does the Muted players go when they are muted? im using essentials /mute and i don't know where i can find a file where the muted players get stored.
  2. Is it not in the userdata folder?
  3. Choco


    Just checked the source code, and when calling User#setMute(boolean), it will then call EssentialsUserConf#setProperty("muted", boolean);. Essentially, this is stored in the player-specific .yml file
  4. I wonder where that config file may be located...[​IMG]
    • Agree Agree x 2
  5. Okay now the problem is, i have like 20.000 in the essentials userdata folder xd how can i UnMute all without deleting all the userdata :/
  6. You would need to create a batch script to cycle through all the .yml files in your userdata folder and change 'muted' to false.
  7. I think a python script would be easier;)
    Code (Python):
    import os
    for file in os.listdir():
        if file.endswith(".yml"):
            f = open(file, "w+")
            f.write("muted: true", "muted: false"))
    #7 spammy23, Apr 30, 2017
    Last edited: Apr 30, 2017
    • Like Like x 2
    • Creative Creative x 1
  8. Sorry for my noobie question, how can i start this script and do with this text in a Ubuntu (linux) dedicated? ^^ im 0% familiarized with that xD
  9. Put this file in the same folder with all the players' configs in. go into that folder by "cd"int into it, then run this command
    Code (Bash):
    python3 filename
    Where filename is the name of the file you put the script in
    Warning: This script, depending on how large the files are, may be memory intensive. If the program were to crash, one of your yml files would be left disfigured. I am not liable for any damages this may cause.
  10. Awesome! i will try it, I have to put this text in a text file and save it as??
  11. Yes, that is correct. Also, make sure that you have enough RAM available for the whole file to be stored into memory.
  12. 5GB ram free is okay?
  13. That should be more than enough.
  14. If there is any file that doesnt contain muted: (argument) it will skip to the next?
  15. Sort of, it will still read and write to the file, but it won't change anything
  16. How long can it take to replace like 20k files? :/
  17. Run this instead, it shows where it is at as a percentage:
    Code (Python):
    import os
    files = os.listdir()
    length = len(files)
    place = 1
    for file in files:
        if file.endswith(".yml"):
            f = open(file, "w+")
            f.write("muted: true", "muted: false"))
            print("done", str(place/length*100)+"%")
            place += 1
    Also, just in case your system reboots or anything bad happens, make a backup
  18. It fucked up :( the script didn't worked and all the files got empty
  19. i didn't make a backup, luckly was a PvP GameMode so Money didn't matters xD
  20. Did you make a backup?
    Never mind, already answered.