Plugin Request [Solved] Clear data of players

Discussion in 'Plugin Help/Development/Requests' started by To175, Dec 23, 2014.

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

    To175

    Hi, I need a plugin which can clear data. For example in config :
    Code:
    TimeToPurge: 3600000 //1000 hours
    AutoPurge: false
    Worlds:
        - world
        - Mecraft_the_end
    Plugins:
        - Essentials
        - PermissionEX
        - LWC
        - QuickShop
        - PlotMe
        - GameModeInventories
        - Landlord
    Like that, if a player didn't went to the server for X seconds (here 1000 hours), it will delete data.
    Here, it will delete data in the worlds "world" and "Mecraft_the_end" But also all data relative to plugin : "Essentials", "permissionEx" ....

    Commands :
    Code:
    /purgewp reload => reload plugin
    /purgewp 3600000 => purge the data of 1000 hours ago
    /purgewp autopurge => auttopurge toggle

    How To ?
    You can make a light system which read files of the plugins and erase data of player

    Thanks :)
     
  2. Offline

    Skionz

    @To175 How is the program supposed to know which files do delete?
     
  3. Offline

    To175

    @Skionz
    Thanks,
    This is short codes. So for each well-known plugins, we can make a short code like that ! :p
     
  4. Offline

    Skionz

    @To175 Didn't I see you in the development section before? This is pretty simple and I think you should be able to make it.
     
  5. Offline

    To175

    @Skionz I though it is huge to learn how to read in files, I just know how to do in config.yml and I don't understand the writing/reading method etc...
    And I don't manage to crate a new plugin :( I've posted in plugin development too to say help it do thing :|
     
    Last edited: Dec 23, 2014
  6. Offline

    Skionz

    @To175 It is simple to delete files, just look at the Java's File class and you can accomplish it in two lines. As for reading files, most people (almost all people) use Bukkit's YAML API which makes reading files simply. Just for fun, this is how you would do it the complex way.
    Code:
    File file = new File("Plugins/Essentials/config.yml");
    BufferedReader reader = new BufferedReader(new FileReader(file));
    String line;
    while((line = reader.readLine() != null) {
        System.out.println(line);
    }
    reader.close();
     
    To175 likes this.
  7. Offline

    To175

    Skionz likes this.
Thread Status:
Not open for further replies.

Share This Page