Making a database to read from

Discussion in 'Plugin Development' started by JjPwN1, Aug 1, 2012.

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

    JjPwN1

    Unneeded.
     
  2. Offline

    lazertester

    Are you looking MySql based or flatfile?
     
  3. Offline

    LucasEmanuel

  4. Offline

    JjPwN1

    lazertester
    Flatfile. I want it so when the plugin is enabled it generates a flatfile file called "strikes.yml" or something and the plugin reads strikes from there.
     
  5. Offline

    LucasEmanuel

    Thats not a database thats a configuration file.
     
  6. Offline

    lazertester

    Do something like what is referenced in this thread only get the player's strikes, increment it or set it to 1 if it does not exist. Don't forget to save it afterward.
     
  7. Offline

    JjPwN1

    LucasEmanuel
    Alright, I see. Either way, how would I add strikes into it, as well as pulling strikes from it. I know how to get the config and read a string from it, but that's basically all I know.
     
  8. Offline

    JeroenV

    Yeah, take in note that I'm using a hashmap to store my values while the server is running but I'm saving a file for when the server is restarting so that the hashmap for the player doesn't reset.

    I just get the boolean values from the hashmap and put them into the file when a player leaves, then call them when the player joins again. I'm unsure if this is going to cause some problems with the server restarting while there are players online (idk if it will count as a PlayerQuitEvent or a PlayerKickEvent).

    But yeah, you can use something in those lines.

    Greets,
    Jeroen V.
     
  9. Offline

    JjPwN1

    I'll work on the plugin as soon as I get home from my trip. I am very anxious to try this out. I will post back here if I have any problems.
     
Thread Status:
Not open for further replies.

Share This Page