graywolf336 / CasinoSlots

Animated, customizable, block-based slot machines, including audio, inside of Minecraft!
http://dev.bukkit.org/server-mods/casino-slots/
GNU General Public License v2.0
23 stars 24 forks source link

Please add more functionality to the stats #31

Open stgram opened 11 years ago

stgram commented 11 years ago

Great plugin, good stats, but lacks one thing: really good stats. Now you have global and per type wins. How about, a complete list, about who played and won what? And imagine, do it in MySQL as well. This way, the biggest winners can be easily announced on the server's website, and whatever else someone comes up with. Because, mysql is really easy to use, not like txt files. Hope you look into this.

graywolf336 commented 11 years ago

Yeah I've thought about this, but the thing is I'm just starting in learning mysql let alone java and mysql, BUT when I do get better in it then I will implement this. So, leaving this open to remind me.

graywolf336 commented 11 years ago

Been thinking about this. What if we did flat file at first (since not everyone will want mysql and I'm still trying to figure out how to do mysql correctly inside Java) and the structure of the stat file be:

playername:
    slot:
        played:
        won:
        lost:
        moneyWon:
        moneyLost:
    slot2:
        played:
        won:
        lost:
        moneyWon:
        moneyLost:

Anything else you'd add to it? Does that layout make sense?

graywolf336 commented 9 years ago

Going to be adding an API, events, which are thrown and provide information about when things happen. Will possibly create another plugin to listen to these events and enable advanced stats, with support for flatfile, mysql, and mongo.

stgram commented 9 years ago

oh hey there, got a random email about this. I closed down my server a while ago, so I am not up to things, but I can summarize once more what would be best /leaving it up to you to decide how it can be implemented/: Most servers have an sql database and a simple website. People play in the casino ingame, win money. Since most servers are separate from the webhosting, the sql is perfect mediator between those two. If you add the option to write to the database each time someone wins something, with a simple single query the website could A) display highest/recent-est wins B) sum up stats about players having won the most/played the most C) overall statistics. In school I had a class about queries and know a thing or two, even with the simplest table structure you could query all kinds or results and statistics, nothing complicated. :)

graywolf336 commented 9 years ago

Yup, that's exactly the idea I have through the usage of API and throwing events and having another plugin dedicated to listening to only those events so the main plugin doesn't get cluttered with database stuff.

stgram commented 9 years ago

Just a note, having two plugins for one thing can sometimes be problematic. Why not just implement as an option the inserting query for the database, in an async thread? I believe this won't take too much resources and will be a neat addition to whoever needs it without too much trouble.

graywolf336 commented 8 years ago

Another almost two years later and I've decided to take another stab at this plugin, revamping the code base (as it is terrible) and going to make a version 3. This will allow me to update how the stats are collected and stored, for those who still run a Minecraft server and use the plugin.