[GEN/INFO] DeathCounter v1.0.1 - Count your kills [1185]

Discussion in 'Inactive/Unsupported Plugins' started by krinsdeath, Jul 10, 2011.

  1. Death Counter v1.0.1
    Count player and monster kills and rank them accordingly​
    V1.0: 1.0.1 - 1.0
    v0.3: 0.3.2 - 0.3.1 - 0.3.0
    v0.2: 0.2.2 - 0.2.1 - 0.2.0
    v0.1: 0.1.4 - 0.1.3 - 0.1.2 - 0.1.1 - 0.1.0
    Important!
    v1.0 adds some new functionality; searching /dc @playername will search for the stats of that player, and print out a list of all of their currently recorded kills.​
    Thanks @ltguide!​
    Also, as a way of lessening I/O operations on larger servers, I disabled updating SQLite on-the-fly for users as they kill mobs. I believe this was the issue (your disks were getting IO locked), and it should help dramatically. The result, however, is that you'll have to wait 30 minutes for updated rankings while using SQLite. YAML remains unaffected, but should also have improved in stability (I also updated the saving methods for YAML as well).​

    Important!: Version 0.2.0 makes the configuration file considerably less complex. It is shown in the config.yml spoiler.
    Important!: If you're upgrading from 0.1.1 to 0.1.2, there are a lot of new keys in the config. It's recommended that you delete your config (or, if you're comfortable editing YML files, copy the new keys from this post in the example config.yml) to get the updated keys.

    Note: Plugin was originally requested by @3ric in this thread.

    Description:
    Ever wanted to keep track of how many pigs you've slaughtered? With this plugin, you can! Permissions is not needed.
    note: I've tried to keep this plugin as lightweight as possible, and SQLite attempts to keep updated player records in memory to prevent writing to and reading from the DB for every kill. If you encounter some issues, let me know. I'm not terribly well versed with SQLite!

    Basic Usage:
    Drop DeathCounter.jar into your plugins directory, and it'll create a folder (DeathCounter) with a configuration file (config.yml), and a user database (currently users.yml). In the future, I will add MySQL. By default, it stores users in YAML, which will be quite sufficient if your server is small (~100 players). SQLite is now supported, and should be used for servers with more than 100 players.

    The config contains some information on how it actually works, as well as a very simple localization setup. It currently only supports the messages in the config, but if it's requested I can set up multiple localizations and persist them by user (without permissions)
    config.yml (open)

    Code:
    # There is really no need for Permissions support, but I will gladly enable it if you need it for whatever reason
    # Some variables can be parsed for the console logger, and are contained within <>
    # <version>         - plugin version
    # <shortname>       - plugin name
    # <fullname>        - plugin name + version
    # <author>          - my name
    settings:
        # if permissions is set to true, players will need the flag 'deathcounter.admin' to access '/deathcount reset [player]'
        permissions: false
        # if economy is set to true, players will earn money for each kill based on the values in this config
        economy: false
        # the time (in minutes) between full saves of the user database
        save_interval: 30
        # the amount of lines to display when a user types '/deathcount leaders' or '/deathcount [mob name]' without a number
        leaderboard: 5
        # the prepended message on log entries
        log: '[<fullname>] '
        # log_verbosity:
        # 0     - Logging will be disabled for everything but errors
        # 1     - Standard log messages will be output (onEnable, onDisable, errors) (default)
        # 2     - More messages (user database saving and user creation)
        # 3     - Absolutely everything will be logged
        log_verbosity: 1
        storage:
            # Currently only YAML and SQLite will work
            # Will add MySQL at some later date
            type: 'YAML'
            info:
                # this entry is used only for YAML. you can specify your own users file name if you wish.
                # note: if you want to specify a directory, please create it before hand, and do not supply a leading slash
                filename: 'users.yml'
                # The following information only applies to MySQL
                database: 'users'
                server: 'localhost'
                port: 3306
                username: 'username'
                password: 'password'
    
    economy:
        pig: 0.0
        sheep: 0.0
        cow: 0.0
        squid: 1.0
        chicken: 0.0
        spider: 5.0
        skeleton: 2.0
        zombie: 2.0
        creeper: 7.0
        ghast: 5.0
        pigzombie: 5.0
        wolf: 3.0
        slime: 1.0
        player: 10.0
    
    messages:
        header: 'Leaders -Top <num>- (<field>)'
        first_rank: '#<rank> - <name> (<kills>)'
        second_rank: '#<rank> - <name> (<kills>)'
        third_rank: '#<rank> - <name> (<kills>)'
        other_rank: '#<rank> - <name> (<kills>)'
        own_rank: '--- #<rank> - <name> (<kills>) ---'
    

    Permissions (open)

    This plugin uses the following permissions:
    • deathcounter.admin - Gives access to /deathcount reset [player]
    • deathcounter.users - Gives access to /deathcount leaders AND /deathcounter [mobname] - Defaults to true
    This plugin also defines the following nodes for convenience:
    • deathcounter.* - Gives access to everything. - Sets deathcounter.admin, deathcounter.users

    Screenshots (open)

    [​IMG]

    Commands:
    • /deathcount leaders [num] - Will display a message containing the top kill leaders up to [num], as well as your location in the leaderboard
    • /deathcount [mobname] [num] - Same as leaders, will display the top [num] kill leaders for the specified monster, as well as your location in the leaderboards.
    • admins: /deathcount reset [player] - Will delete a player from the database.
    Features:
    • Track player and monster kills
    • Leaderboards for total kills and individual monsters
    • SQLite and Flatfile database support
    • Permissions support! (optional)
    • iConomy support! (optional)
    TODO:
    • MySQL
    Versions:
    Version 1.0.1:
    • Removed deprecated EntityDamageByProjectileEvent
    Version 1.0:
    • Switched from Register to AllPay v3.0
    • Now supports iConomy 4/5/6, RealEconomy, MultiCurrency, BOSEconomy 6/7, Essentials Eco
    • Factored in pull request from ltguide to include @playername functionality for searches.
    • Moved plugin to load: startup to ensure economy hooking.
    • Additional bug and glitch fixes.
    Version 0.3.2:
    • Refactored com.nijikokun.register to net.krinsoft.register to prevent conflicts
    Version 0.3.1:
    • Switched from iConomy to Register; all major economies are now supported, including BOSE 6 & 7, iConomy 4 & 5, Essentials Economy, and Multi-currency
      • Register is included in the source code, and as such does not require any outside libraries. The plugin will attempt to hook the first economy plugin it finds.
    • Minor bugfix and code cleanup
    • Moved to maven
    Changelog(old) (open)

    Version 0.3.0:
    • Removed all dependencies on Permissions, the plugin uses Superperms now.
    • Permissions 2.x and 3.x (and possibly GM and PEX) will still work
    • /deathcount now has 2 aliases, /dc and /deathcounter, which (when used without parameters) will display the top 5 leaders. As such, /deathcount leaders is no longer necessary, but still works.
    0.2.2:
    • Added iConomy support
    • Lessened I/O operations for large servers, which I believe were getting IO locked
    0.2.1:
    • Fixed spiders not being tracked.
    • General code cleanup
    0.2.0:
    • Finished SQLite support
    • Added Permissions (optional). Flag is 'deathcounter.admin' (permissions is off by default)
    • Reorganized the entire project from scratch. It's more module-like, so I can add new features much more easily.
    0.1.4:
    • Added SQLite support
    0.1.3:
    • Added a hardcoded limit to the number of loops displayed by /deathcount leaders. It will not exceed 10 loops.
    • minor code cleanup
    • Added a configurable location for the users.yml (in fact, the name of the file can even be changed) in config.yml. Should allow for symlinking or any number of useful features
    0.1.2:
    • Added /deathcount reset for admins.
    • Added quiet_plugin field in config.yml - setting this to true will disable "You killed a [target]!" messages.
    • Cleaned up code.
    • More localization flags
    0.1.1:
    • Fixed a few bugs
    • Added support for EntityDamageByProjectileEvent
    • Players should now be tracked properly
    • Added quiet_save field in config.yml - setting this to true will disable log messages stating that the users.yml has been updated.
    0.1.0:
    • Initial release

    Special thanks to:

    3ric for his support
     
  2. Offline

    Fob_Upset

    Oh really? This is the only Pvp/Death counter plugin i seen.
    Could you perhaps link me to a plugin that does that?
     
  3. Offline

    Danielzxzx

    Hello, I own a server that has about 200 unique players that joined. I'm still using YAML. Is this safe even though you said it is for 100 players? Is there anything that could go wrong still using YAML for death counter with about 200 players?
     
  4. @Danielzxzx - There should be no problems using this with 200 players on any of the different database schemas. In fact, the YAML option should work fluidly with as many as 1000 players; it's just a matter of space and disk access times; IO locking may or may not happen a lot more frequently with YAML, especially with large numbers of players online at one time.

    Mostly, you will only need SQLite or MySQL if you have 100 players online simultaneously.
     
  5. Offline

    Danielzxzx

    Is there a way to make it so that if someone reaches a certain amount of kills, it changes the group they are in in PermissionsBukkit automatically?
     
  6. It's possible, I suppose. I never thought about doing auto-promotion or anything of that nature. Post an issue on my tracker no dev.bukkit.org and I'll work on it. I've got to rewrite the plugin for CB1597+ anyway.
     
  7. Offline

    kreinas

    Hey, I seem to be having an issue with the counter regarding Player kills when dying by "Bow" and "Enchanted Bow". It just doesn't record! Also, considering I use this plugin ONLY for player kills, could you make a "player kill only" version? And preferably fix the bow death issue before the next release, considering that's the main weapon for my server!
     
  8. Offline

    3ric

    I think krinsdeath is busy with other projects at the moment. Just be patient and this plugin will be updated when he has time.
     
  9. Hey guys, very sorry about not responding here. I've been only tracking my issues and posts on my BukkitDev page. This plugin should work properly with 1.1-R3 (the latest release on my BukkitDev page).

    Sorry about this.
     

Share This Page