Economy Statistics

Discussion in 'Archived: Plugin Requests' started by klosjaarrr, Dec 7, 2013.

  1. Offline

    klosjaarrr

    Plugin category: Economy, Admin tools

    Suggested name: EcoStats

    What I want: I'd like to see a plugin that can show some information about the server economy. Basically, the plugin logs transactions (vault) and stores them in a database / flat file (database prefered). With simple commands you can request information about:

    - Total money sent to players /eco sent [time] [player]
    - Total money received from players /eco received [time] [player]
    - Total money used to buy from shop (Essentials) /eco bought [time] [player]
    - Total money used to sell to shop (Essentials) /eco sold [time] [player]
    - Players with most profit /eco profit [time] [player]
    - Players with least profit /eco debt [time] [player]
    - Spawned in money /eco spawned [time] [player]
    - Money that went to server /eco removed [time] [player]

    [Time] by default: Total
    [Player] by default: Everyone
    I need to be able to search for the following [Time]'s: Last hour / Last day / Last week / Last Month / Last year / Total. If possible, you can also make it use the Essentials time thing (2s, 1h, 5d etc.). The [player] can be left blank to use everyone, but by using a playername it will only show details about that specific player.

    Ideas for commands: See above.

    Ideas for permissions: eco.commands ?

    When I'd like it by: As soon as someone is able to make it :)
     
  2. Offline

    timtower Moderator Moderator

    klosjaarrr Not impossible, but not easy either.
    Vault doesn't has events at the moment ( doubt it if they will get them )
     
  3. Offline

    klosjaarrr

    timtower Hmm that sucks, but okay... I'll see if I can come up with the same principal but easier to implement (and I am currently learning Java, hope I'll be able to do some basic plugin dev. soon :D)
     
  4. Offline

    timtower Moderator Moderator

    Other way: create an entire economy plugin. Most devs won't do that though because they have to reinvent the wheel.
     
  5. Offline

    klosjaarrr


    True, that's not an option, unless I can find a dev. that I can pay to make this, but that's not the purpose of the forum... Hmm, I'll see if there are any outdated plugins that do this and try to make them work again if the source is open.
     
    rfsantos1996 and timtower like this.
  6. Offline

    timtower Moderator Moderator

    I like your spirit!
     
    klosjaarrr likes this.
  7. Offline

    klosjaarrr


    Well as I am learning Java it might be a good way to learn it and get some experience with the way Bukkit plugin development works :D
     
    timtower likes this.
  8. Offline

    MrPmiguelP

    This is possible, I have done something comparable before. You will simply have to track the entire economy system.
     
  9. Offline

    klosjaarrr

    MrPmiguelP How difficult would you say it is to do that?
     
  10. Offline

    MrPmiguelP

    It wouldn't be difficult, just time consuming. Therefore I think many developers will pass on this one. Hopefully you will still manage to find someone.

    Greetings.
     
    klosjaarrr likes this.
  11. Offline

    AmShaegar

    I am currently thinking of doing something like that. Still researching if my idea was already implemented and if there is a real benefit from this. Are you still interested?
     
  12. Offline

    klosjaarrr


    Yes, I am still interested :) We are trying to create a roleplay server with a lot of custom features, having the ability to 'track' money (which is basically the idea, see flows of the economy etc.) will allow us to play with the economy more and see what is causing inflation / which players needs to be limited etc.
     
  13. Offline

    AmShaegar

    This is close to exactly what my intention was when I had the idea yesterday myself and found this thread. I'd like to create a new economy plugin that not only logs transactions but where balances only consist of transactions. I took the idea from bitcoins. Every transaction is saved in the database. If you need the balance you simple add all those transactions.
    The advantages are that you can track every bug (abuse), inflation, statistics or whatever you want plus beeing able to reroll transaction either of all players or specific ones for a specific period of time.
    There are two main problems with this:
    1. I need to figure out a way to add a description to transactions to identify them. Vault does not support a subject for transactions. This could be solved by getting the calling method. Its not a beatiful description but if a plugin is properly coded it's more than enough to identify the reason or a transaction.
    2. Performance. Ususally you just save and change the balance and look it up in a database. It means amount of players data sets. In my case you'd need a lot more data sets for every player. I am not sure if this will result in poor performance if you have hundreds of players over months. I will need some performance testing there.
    Including your features is hell easy then, when my plugin is done. You wont even need a plugin for this. You could just read all you want from a database. Maybe you want a web frontend with colorful graphs or something like this.
    Important: I have no idea yet if I really gonna make itt. I will try but I am not sure yet if I have enough time to finish it.
     
    klosjaarrr likes this.
  14. Offline

    klosjaarrr

    Looks really cool! If you're interested in actually making it: I'm a quite decent web developer so I could make a public web fronted that people can use with graphs per month etc. Let me know when you continue with your ideas and develop the plugin, I think a lot of servers would be interested if the performance is okay.
     
  15. Offline

    AmShaegar

    What I currently have is a basically working economy plugin with vault support (not official yet though). The database looks like this:
    Code:
    +----+-----------+
    | ID |  NAME     |
    +----+-----------+
    | 1  | AmShaegar |
    | 2  | Player    |
    +----+-----------+
    Code:
    +----+---------------+--------+--------+--------------------------------+----------------------------+
    | ID |    TIME       | PLAYER | AMOUNT |            SUBJECT             |        [COMMENT]           |
    +----+---------------+--------+--------+--------------------------------+----------------------------+
    | 1  | 1392062929850 | 1      | 10     | initial balance                | configurable throug plugin |
    | 2  | 1392062929861 | 1      | 10.0   | TestListener.onEnterServer<51> | generic subject            |
    | 3  | 1392063468706 | 1      | 42.0   | deposit by command             | subject choosen by plugin  |
    | 4  | 1392063515802 | 1      | -20.0  | withdraw by command            | subject choosen by plugin  |
    +----+---------------+--------+--------+--------------------------------+----------------------------+
     
    klosjaarrr likes this.
  16. Offline

    klosjaarrr

    Looks nice, maybe track who the player was who got the money when paying money?
     
  17. Offline

    AmShaegar

    How? Vault only uses deposit and withdraw. There is no transfer... You have to do both parts simultanuously.
     

Share This Page