Stumped on How to Implement a Punish History in Configuration

Discussion in 'Plugin Development' started by ThePandaPlayer, Aug 28, 2018.

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

    ThePandaPlayer

    Good day,

    I am currently developing a custom punishment plugin for a new server. I have a solid idea for how to implement the punishments themselves (kicks, bans, mutes, etc.) however, I have no solid idea on how to implement a punishment history. I've been thinking about using a Map or an ArrayList, however, then I'm concerned that I'll have to serialize my special 'Punishment' Object (I know how to serialize objects for a configuration), which I believe stores certain un-serializable data in itself. (Player and CommandSender objects in particular). I also don't necessarily want to use an SQL database as I have no experience whatsoever with SQL.

    What are my options?
     
  2. Offline

    Zombie_Striker

    1. If the unserializatable data are objects from your plugin, serialize them.
    2. If it is other data, create your own parser to find the data.
    Either way,you should not use maps or arraylist to store all of the player's history, since you don't always need it for every single player, and if you plan on using it a lot, it would use up more memory than needed. Instead, consider storing the history for each player in their own yml file, and only read the yml when needed.
     
Thread Status:
Not open for further replies.

Share This Page