Store stats

Discussion in 'Plugin Development' started by Forseth11, Oct 18, 2013.

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

    Forseth11

    I'm making a minigame and I need to know the best way to save player stats. Like wins. How would I do this. Would I use books, signs, config.

    I made another minigame and every time the config got more then 3000 player stats in it it started crashing. How could I make it less lagy.

    Note: I do not need to get top player and I am only storing one number.
     
  2. Offline

    The Fancy Whale

    Only way I could see storing data such as this is a file. It does not have to be the main config though.
     
  3. Offline

    BajanAmerican

    Forseth11
    Use MySQL, best way to store data.
     
  4. Offline

    Forseth11

    BajanAmerican I have no idea how to use mySQL and I would love to know.
     
  5. Offline

    1Rogue

    MySQL, SQLite, JSON, YAML, XML, TXT, any other SQL manager (Postgre). The list goes on and on, you just need to decide what you want :)

    Edit: re: sql. Have you worked with SQL in any way at all in the past?
     
  6. Offline

    Forseth11

    1Rogue I have never used SQL. Which one should I learn. And I only need to know the 4 basics. Getting data, adding data, changing data, saving it.
     
  7. Offline

    1Rogue


    How often would you be planning on updating the stats?
     
  8. Offline

    Forseth11

    Every time a map ends which is a min of: 35 seconds and a max of 20 minutes.
     
  9. Offline

    1Rogue

    I would recommend using SQLite then. If you want an idea of what it would look like for use, take a look at my SQLite implementation within one of my plugins, linked below. Keep in mind you will need to learn SQL syntax, which I can potentially link a resource to below.

    My implementation: https://github.com/1Rogue/PlayTime/tree/master/src/main/java/com/rogue/playtime/data/sqlite
    Sql guide (not the best): http://www.w3schools.com/sql/
    I really discourage w3schools for most things but overall I don't know many good ways to get started with sql.
     
  10. Offline

    Forseth11

    Can you just give me examples of:

    Getting data:
    Saving data:
    Adding data:
    Changing data:

    I'm looking at your code too.
    Edit: Is it possible for me to use the code from your classes you sent me and use methods to do the things above.
     
  11. Offline

    1Rogue

    You're welcome to use the instantiable SQLite class:

    https://github.com/1Rogue/PlayTime/...va/com/rogue/playtime/data/sqlite/SQLite.java

    Just leave the accreditation within it. Though you will have to modify it slightly :)

    To use it, simply make sure you've created the appropriate file, and then you can load it using SQLite.

    As for getting/saving/adding/changing data, those are all done through update and query strings.
     
Thread Status:
Not open for further replies.

Share This Page