Config Reset Command | Offline Player Info?

Discussion in 'Plugin Development' started by WolfLeader116, Jul 17, 2014.

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

    WolfLeader116

    Ok so I would like to make a custom plugin for my server because there are no plugins that suit my needs for /p <name> and showing player info. For offline players, I'm not sure how to do this because for an offline player, they already have all the permissions that the plugin needs to show info. An offline player is stripped of all permissions when they log off, so I'm not sure how to safe that data before it's wiped and then reload it when somebody does /p <offline player>. If possible I would like to save the data on a MySQL database which has the connection settings in the config file. Also on that note, I would like to create a command which resets the config file. /pi reset. Once you type /pi reset, you must type /pi confirm to actually reset the file. If you do not type /pi confirm within 15 seconds, it no longer works. I have tried many ways of doing this, but they don't seem to work. Oh and if you ask for my code, don't expect something beautiful and amazing as I kind of suck at coding...
     
  2. Offline

    lycano

    Use Conversation API that Bukkit provides for confirm "yes/no" stuff.

    As for offline player .. this is not ment to be used as you might think ... its only the last state. Many things like "permissions" and stuff is loaded at runtime and is event based. I.e. hits a block -> stuff happens.

    If you want to do so statistics or collect profile info use a database. Either sql server or sqlite. H2 needs a lib. Checkout the forums on "Persistence" if you dont know how.
     
  3. Offline

    WolfLeader116

    lycano Yes I said I wanted to use a database, but I'm not exactly sure how to connect to the database and write the information to it and also to retrieve information from it.
     
  4. Offline

    lycano

    WolfLeader116 Checkout http://www.source-code.biz/miniconnectionpoolmanager/ its a good start.

    You need to establish a connection to your favorite database usually this is mysql or sqlite (for small projects and for testing).

    Then you need to write yourself some API that will eventually write data to your database. Search the forums. You will find many =)
     
Thread Status:
Not open for further replies.

Share This Page