1. These forums are being retired. Please ask all questions and help threads and any other type of discussions on GitHub. During this time, new threads and user registrations have been disabled.

1.22 (obsolete) Purge Players 1.0.3.22

Purge Players based on last access date

  1. GrandPa-G
    API Version:
    21
    TShock Version:
    4.3.9
    Source URL:
    https://github.com/Grandpa-G/PurgePlayers
    Purge Players

    Purge Players will delete users and associated character information from the database based upon criteria given in a config file or by command line options. The plugin is invoked by the command purgeplayers or pp. The command options are:
    Code:
    Syntax: /purgeplayers [-help]
    Flags:
    -purge        starts purge operation
    -reload/-r    reloads options from purgeplayers.json config file
    -verbose/-v   show each user purge
    -!verbose/-!v don't show each user purged
    -days n       purges any user not accessed in the last n days before today
    -!preview/!p  negates preview, thus users will be deleted
    -preview/p    performs purge action without actually purging any users
    -list/l       show current purge criteria
    -help         this information
    The options may be set in the config file name purgeplayers.json held in the TShock folder. The options are:
    Code:
    {
      "purgeBeforeDays": 20,
      "archiveDeletes": false,
      "archiveFileName": "DeletedPlayers.sql",
      "DoNotDelete": [
        ""
      ],
      "DoNotDeleteGroups": [
        "admin",
        "trustedadmin",
        "newadmin",
        "superadmin"
      ],
      "autoPurge": false,
      "autoPurgeTime": "12:00:00"
    }
    purgeBeforeDays specifies how many days ago the user has accessed the server. Users with no accessed date will be purged as well.

    archiveDeletes is a true/false to indicate if archiving the data from the database will be performed. If true, text SQL insert records will be placed in the file specified by archiveFileName. An external tool maybe used to replace the records in case there is a mistake made in the purge criteria.

    DoNotDelete is a list of quoted usernames from the users table in the database that are not to be deleted even if they meet the criteria.

    DoNotDeleteGroupsis a list of quoted groups from the users table in the database that are not to be deleted even if they meet the criteria.

    autoPurge is a true/false indicator to set the option to perform automatic purging based upon the time specified by autoPurgeTime. The time is given in HH:MM:SS (though seconds are not used). When this time is reached in the day, the server will perform a purge based upon the config file criteria.

    [NOTE] A huge thank you to member Kjkillercom for all his help. He made most of the suggestions and help debug the result.
    Kojiro_S and Kjkillercom like this.

Recent Reviews

  1. Kojiro_S
    Kojiro_S
    5/5,
    Version: 1.0.3.21
    Neat little tool to keep your user database in order. As an added plus, it has auto-purge options included.