[INACTIVE][INFO] Playtime Tracker v0.6 - Log player time and activities online (MySQL/SQLite) [1240]

Discussion in 'Inactive/Unsupported Plugins' started by cwingrav, Aug 23, 2011.

  1. Offline

    cwingrav


    Description:
    Tracks time players have been online (total time as well as last time on), as well as useful stats of their activity, in a MySQL or SQLite db. Gives top X reports as well (like top 5 players in time spent playing).
    NOTE: I've seen other plugins do this but they either are discontinued, buggy or use flat files. They've done a great job. They didn't fit our needs however so Playtime Tracker was created to fill our, and hopefully some other people's needs.

    Download: PlaytimeTracker.jar
    Source: moc_PlaytimeTracker_v0.2.tar.gz
    Dependency: MOCDBLib.jar - see its forum page, project page

    Wiki Link: Minds of Chimera: PlayTime Tracker


    Demonstration Video:


    Screen Shot:
    As of version 0.3, it logs player events per world. Here is what the output of: "/playtimetracker user cwingrav world" displays, where the user is "cwingrav" and the world name is "world".
    [​IMG]

    [​IMG]

    Commands:

    Code:
    /playtime sum- Prints amount of time you have played.
    /playtime sum [player] - Prints stats about time spent playing.
    /playtime sumall- Prints stats about time spent playing for all players ever logged in.
    /playtime laston - Lists last login times of self.
    /playtime laston [player] - Lists last login times of the given player.
    /playtime lastonall - Lists last login times of all players.
    /playtime full - for the player, list their sum and laston
    /playtime full [player] - for the given player, list their sum and laston
    /playtime user [player] [world] - prints user states about their activities in the world
    /playtime top [criteria] [# to print] [world] - Prints the top 5 in the categories this is tracking. Default is top 5 online time.
                       [criteria] currently include: online, place, destroy, die, moved, pk, hk, fk
                           pk=player kills, hk=hostile kills, fk=friendly kills (like cows, pigs, etc).
    Permissions:
    Show Spoiler
    PlaytimeTracker.self:
    description: Gives access to discover the amount of time the player is online.
    default: true
    PlaytimeTracker.player:
    description: Gives access to discover the amount of time a player is online or last on.
    default: false
    PlaytimeTracker.all:
    description: Gives access to discover the amount of time all players are online or last on.
    PlaytimeTracker.top:
    description: Lets people list the top X for a given value.


    Installation:
    1. add the PlaytimeTracker.jar file to your plugins directory.
    2. add the MOCDBLib.jar file to your plugins directory.
    3. follow the configuration instructions below.

    Configuration:
    Show Spoiler

    It uses MOCDBLib for its persistence so see that plugin for more details. Here is a bit that might help you out:

    File: ./plugins/PlaytimeTracker/DBLib.properties:

    Code:
        MySQL=false
        host=localhost
        database=playtimetracker
        username=root
        password=pass
        port=3306
    These settings configure the storage of people's online time. If MySQL is false, then it creates an SQLLite db. If you use MySQL, remember to manually create the given database in mysql. Thanks to the SQLite project for original database code. Currently uses a new DB library based upon it.
    NOTE: This file should generate on the fly if you don't have it. Default is MySQL=false.

    Features Requested:
    • Properties file for setting the names of the databases this is using. This will allow multiple servers to run off the same MySQL server. (ok, will do)
    • Is it possible to have playertime be a variable the MOTD can use? So "Welcome <player> who has been online <X>days and <Y> hours." (ok, will do)
    • /afk support (interesting, might do but I will have to make a lot of changes to support this and to make sure it doesn't impact the server)
    • Report top X for all, for things other than the login time. (This requires a rework of my datastructures, but it will be more optimal so will do it)
    • Log sumall to the server fine.
    Revision History:
    see the project page
     
  2. Offline

    Tendonsie

    No dowlnoad link?
     
  3. Offline

    cwingrav

    Lol. TY. It was on the wiki, but not here. Thanks for catching that.

    Man, I never noticed that sheep in the video until now. That's kinda funny.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  4. Offline

    Tendonsie

    No "port" option in the file?
    Is that a problem for me if I do localhost.
    So please add some option like that!

    I get this error. (Bukkit 1060!)
    Code:
    5:39:28 [INFO] [PlaytimeTracker] MySQL Initializing
    15:39:28 [SEVERE] [PlaytimeTracker] SQLException! Communications link failure
    
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    15:39:28 [INFO] [PlaytimeTracker] MySQL connection successful
    15:39:28 [SEVERE] [PlaytimeTracker] SQLException! Communications link failure
    
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    15:39:28 [SEVERE] Error using database 'minecraft'... do you need to create it?
    15:39:28 [SEVERE] java.lang.NullPointerException
    15:39:28 [SEVERE]       at com.alta189.sqlLibrary.MySQL.DatabaseHandler.checkTable(DatabaseHandler.java:134)
    15:39:28 [SEVERE]       at com.alta189.sqlLibrary.MySQL.mysqlCore.checkTable(mysqlCore.java:72)
    15:39:28 [SEVERE]       at moc.PlaytimeTracker.PlaytimeTrackerMySQL.<init>(PlaytimeTrackerMySQL.java:137)
    15:39:28 [SEVERE]       at moc.PlaytimeTracker.PlaytimeTracker.onEnable(PlaytimeTracker.java:31)
    15:39:28 [SEVERE]       at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
    15:39:28 [SEVERE]       at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:885)
    15:39:28 [SEVERE]       at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:278)
    15:39:28 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:178)
    15:39:28 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:161)
    15:39:28 [SEVERE]       at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:286)
    15:39:28 [SEVERE]       at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:273)
    15:39:28 [SEVERE]       at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:149)
    15:39:28 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:337)
    15:39:28 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    15:39:28 [INFO] [PlaytimeTracker] has been enabled!
    
    
     
  5. Offline

    cwingrav

    See the error message there. You probably need to create the database you specified in the properties file. That's a common issue with a lot of these plugins as I think they use similar SQL libraries and the library does not do a "CREATE DATABASE IF NOT EXISTS X".

    Good idea about the port number. I'll add that in shortly.
     
  6. Offline

    Kohle

    How about if the command /playtime showed everything? So it would tell you how long you have totally played, your last login, etc.

    So basically it would be one command to show everything!
     
  7. Offline

    Jacek

    Not sure I want to know this ;)

    Also, it might be an idea to add a flatfile option, this does not really need to be in a database. You could keep track of the time by watching player_join and player_quit and keep track in a hashmap while the server is running then write to a file on shutdown.
     
  8. Offline

    cwingrav

    I could do that for one player, but this info quickly scrolls past the client's viewable area. I'll keep an eye on this idea though.
     
  9. Offline

    Jacek

    You also seem to be registering a player_move event that you then do nothing with, and it doesn't look like you sanitise the player name at all before it becomes part of the SQL.
     
  10. Offline

    cwingrav

    Functionally, that's pretty much what this does (in addition to player_kicks). The existing options used flat files but DBs are faster and easier to parse. Take a look at the other plugins that use flat files. My concern is what happens when the server has been up for a long time.

    Also, DBs allow for easier access to 3rd party plugins or websites and such that could also reuse this information for their own needs. Like the post above mentions, using a DB, we could create a web report of players and such from the DB.
     
  11. Offline

    Jacek

    All true, but consider someone hosting on a small VPS (like I used to). All of the RAM is allocated to minecraft so they cant afford to run a mysql server. This eliminates a few big plugins like iConomy and LogBlock that use the database heavily. I don’t see the need for that to eliminate somethign like this though, since you will presumably only update the database when they log out the number of operations will be so low you may as well just use a file.
     
  12. Offline

    Kohle

    Hmm... how about just having it display:
    You have been on this server for a total of (the total here).
    You were last online (date here).

    And you could also do /playtime <name> to get:
    <name> has been on this server for a total of (the total here).
    <name> was last online (date here).
     
  13. Offline

    Tendonsie

    Database exist :)
    So its not the config.

    Maybe because my port is not 3306 for security resonse.
     
  14. Offline

    cwingrav

    Going to fix tonight:
    * Remove PLAYER_MOVE event (left over from my learning code, this is my 1st plugin).
    * Rewriting the SQL library I am using so it handles ports and PreparedStatements for more secure SQL.

    If time:
    * /playtime report [player] and /playtime report to generate the format that Kohle mentioned.

    Thanks for the input all. As I mentioned, this is my 1st plugin and I plan to use this as a format for future plugins. We have a slew of things we need to add regarding a more dynamic/programmable player environment.
     
  15. Offline

    cwingrav

    Ok, version 0.2 is posted with the listed changes. Except for flat files, this covers all requests.
     
  16. Offline

    Tendonsie

    Tips:
    -> Add also mysql table option, if you have 4 servers you wand to have 4 tables.
    -> The permissions is that bukkitpermissions of the classic of hmod ?
     
  17. Offline

    TehRandomGuy

  18. Offline

    Plague

    missing a CB tag
     
  19. Offline

    rockxz2135

    Whoa!!!! I always wanted this thank you sooo much!!!
     
  20. Offline

    cwingrav

    Glad to help!
    You might consider updating too. Grab the MOCDBLib.jar and the new PlaytimeTracker.jar. It has more interesting stats.

    Ok, I think you are referring to the [1060]. I added that. Let me know what it takes to go from the submitted to the released plugins.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  21. Offline

    Tendonsie

    Please update to 1185 :) Got an error with die v0.3 error after 1.8.1 bukkit. thx!
     
  22. Offline

    cwingrav

    FYI all, working on upgrading to 1.8 today. Tks Tendonsie.
     
  23. Offline

    OllyHal

    Not working for me in build 1185.
    On start up I get this error -
    Code:
    26.09 18:06:16 [Server] INFO     ... 11 more
    26.09 18:06:16 [Server] INFO     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    26.09 18:06:16 [Server] INFO     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    26.09 18:06:16 [Server] INFO     at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
    26.09 18:06:16 [Server] INFO     at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
    26.09 18:06:16 [Server] INFO     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    26.09 18:06:16 [Server] INFO     at java.security.AccessController.doPrivileged(Native Method)
    26.09 18:06:16 [Server] INFO     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    26.09 18:06:16 [Server] INFO     at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    26.09 18:06:16 [Server] INFO Caused by: java.lang.ClassNotFoundException: moc.MOCDBLib.MOCDBLib
    26.09 18:06:16 [Server] INFO     at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    26.09 18:06:16 [Server] INFO     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:348)
    26.09 18:06:16 [Server] INFO     at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:152)
    26.09 18:06:16 [Server] INFO     at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:284)
    26.09 18:06:16 [Server] INFO     at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:297)
    26.09 18:06:16 [Server] INFO     at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:156)
    26.09 18:06:16 [Server] INFO     at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:173)
    26.09 18:06:16 [Server] INFO     at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:278)
    26.09 18:06:16 [Server] INFO     at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:920)
    26.09 18:06:16 [Server] INFO     at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
    26.09 18:06:16 [Server] INFO     at moc.PlaytimeTracker.PlaytimeTracker.onEnable(PlaytimeTracker.java:60)
    26.09 18:06:16 [Server] INFO java.lang.NoClassDefFoundError: moc/MOCDBLib/MOCDBLib
    26.09 18:06:16 [Server] SEVERE Error occurred while enabling PlaytimeTracker v0.3 (Is it up to date?): moc/MOCDBLib/MOCDBLib
    Whenever I try doing a command such as /playtime sum I get this error -
    Code:
    26.09 18:07:39 [Server] INFO     ... 16 more
    26.09 18:07:39 [Server] INFO     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    26.09 18:07:39 [Server] INFO     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    26.09 18:07:39 [Server] INFO     at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
    26.09 18:07:39 [Server] INFO     at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
    26.09 18:07:39 [Server] INFO     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    26.09 18:07:39 [Server] INFO     at java.security.AccessController.doPrivileged(Native Method)
    26.09 18:07:39 [Server] INFO     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    26.09 18:07:39 [Server] INFO     at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    26.09 18:07:39 [Server] INFO Caused by: java.lang.ClassNotFoundException: moc.MOCDBLib.DBConnector
    26.09 18:07:39 [Server] INFO     ... 13 more
    26.09 18:07:39 [Server] INFO     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:39)
    26.09 18:07:39 [Server] INFO     at moc.PlaytimeTracker.PlaytimeTracker.onCommand(PlaytimeTracker.java:231)
    26.09 18:07:39 [Server] INFO     at moc.PlaytimeTracker.PlaytimeTracker.getPlaytimeString(PlaytimeTracker.java:354)
    26.09 18:07:39 [Server] INFO Caused by: java.lang.NoClassDefFoundError: moc/MOCDBLib/DBConnector
    26.09 18:07:39 [Server] INFO     at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    26.09 18:07:39 [Server] INFO     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    26.09 18:07:39 [Server] INFO     at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:464)
    26.09 18:07:39 [Server] INFO     at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    26.09 18:07:39 [Server] INFO     at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:500)
    26.09 18:07:39 [Server] INFO     at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    26.09 18:07:39 [Server] INFO     at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    26.09 18:07:39 [Server] INFO     at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
    26.09 18:07:39 [Server] INFO     at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:714)
    26.09 18:07:39 [Server] INFO     at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:721)
    26.09 18:07:39 [Server] INFO     at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:756)
    26.09 18:07:39 [Server] INFO     at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:353)
    26.09 18:07:39 [Server] INFO     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:163)
    26.09 18:07:39 [Server] INFO     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:41)
    26.09 18:07:39 [Server] INFO org.bukkit.command.CommandException: Unhandled exception executing command 'playtime' in plugin PlaytimeTracker v0.3
     
  24. Offline

    cwingrav

    Not a 1185 error. Easy fix. Just install the MOCDBLib.jar dependency. Link at the top.

    I'll add a failure note so the log file is more explicit. Cheers!

    BTW all, I've been using this for 1185 all weekend w/o issue. I just want to test further before I update to 1185.

    Can I get more details? I killed my character w/o incident. How did you die? What were the errors? What went wrong? What did the logfiles have in them. That would really help me out.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  25. Offline

    DQuaN

    Would it be possible to have a /playtime top5 command where it would show the 5 users that have spent the most time on the server?
     
  26. Offline

    cwingrav

    I've thought of that before too. I'll bump it on my todo list.
     
  27. Offline

    DQuaN

    Great thanks!

    I'm having a few issues.

    Code:
    18:23:44 [INFO] [PlaytimeTracker]  openConnection: jdbc:sqlite://C:\DQCraft\plug
    ins\PlaytimeTracker\minecraft.db
    18:23:44 [INFO] [PlaytimeTracker]  Database connection successful
    18:23:44 [SEVERE] java.sql.SQLException: [SQLITE_ERROR] SQL error or missing dat
    abase (near "?": syntax error)
    18:23:44 [SEVERE]       at org.sqlite.DB.newSQLException(DB.java:383)
    18:23:44 [SEVERE]       at org.sqlite.DB.newSQLException(DB.java:387)
    18:23:44 [SEVERE]       at org.sqlite.DB.throwex(DB.java:374)
    18:23:44 [SEVERE]       at org.sqlite.NativeDB.prepare(Native Method)
    18:23:44 [SEVERE]       at org.sqlite.DB.prepare(DB.java:123)
    18:23:44 [SEVERE]       at org.sqlite.PrepStmt.<init>(PrepStmt.java:42)
    18:23:44 [SEVERE]       at org.sqlite.Conn.prepareStatement(Conn.java:404)
    18:23:44 [SEVERE]       at org.sqlite.Conn.prepareStatement(Conn.java:399)
    18:23:44 [SEVERE]       at org.sqlite.Conn.prepareStatement(Conn.java:383)
    18:23:44 [SEVERE]       at moc.MOCDBLib.DBConnector.checkTable(DBConnector.java:
    206)
    18:23:44 [SEVERE]       at moc.MOCDBLib.DBConnector.ensureTable(DBConnector.java
    :248)
    18:23:44 [SEVERE]       at moc.PlaytimeTracker.PlaytimeTracker.onEnable(Playtime
    Tracker.java:76)
    18:23:44 [SEVERE]       at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlug
    in.java:126)
    18:23:44 [SEVERE]       at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(
    JavaPluginLoader.java:920)
    18:23:44 [SEVERE]       at org.bukkit.plugin.SimplePluginManager.enablePlugin(Si
    mplePluginManager.java:278)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftSe
    rver.java:173)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.enablePlugins(Craf
    tServer.java:156)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.reload(CraftServer
    .java:410)
    18:23:44 [SEVERE]       at org.bukkit.Bukkit.reload(Bukkit.java:173)
    18:23:44 [SEVERE]       at org.bukkit.command.defaults.ReloadCommand.execute(Rel
    oadCommand.java:22)
    18:23:44 [SEVERE]       at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCo
    mmandMap.java:163)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.dispatchCommand(Cr
    aftServer.java:353)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.dispatchCommand(Cr
    aftServer.java:349)
    18:23:44 [SEVERE]       at net.minecraft.server.MinecraftServer.b(MinecraftServe
    r.java:499)
    18:23:44 [SEVERE]       at net.minecraft.server.MinecraftServer.h(MinecraftServe
    r.java:478)
    18:23:44 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftSer
    ver.java:374)
    18:23:44 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(Sour
    ceFile:417)
    18:23:44 [INFO] [PlaytimeTracker]  Creating table PT_timelog: CREATE TABLE PT_ti
    melog ( player varchar(50), logintime TIMESTAMP NULL default NULL, logouttime TI
    MESTAMP NULL default NULL);
    18:23:44 [SEVERE] java.sql.SQLException: table PT_timelog already exists
    18:23:44 [SEVERE]       at org.sqlite.NativeDB.throwex(NativeDB.java:210)
    18:23:44 [SEVERE]       at org.sqlite.NativeDB._exec(Native Method)
    18:23:44 [SEVERE]       at org.sqlite.Stmt.executeUpdate(Stmt.java:152)
    18:23:44 [SEVERE]       at moc.MOCDBLib.DBConnector._iudSafeQuery(DBConnector.ja
    va:143)
    18:23:44 [SEVERE]       at moc.MOCDBLib.DBConnector.updateSafeQuery(DBConnector.
    java:133)
    18:23:44 [SEVERE]       at moc.MOCDBLib.DBConnector.ensureTable(DBConnector.java
    :252)
    18:23:44 [SEVERE]       at moc.PlaytimeTracker.PlaytimeTracker.onEnable(Playtime
    Tracker.java:76)
    18:23:44 [SEVERE]       at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlug
    in.java:126)
    18:23:44 [SEVERE]       at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(
    JavaPluginLoader.java:920)
    18:23:44 [SEVERE]       at org.bukkit.plugin.SimplePluginManager.enablePlugin(Si
    mplePluginManager.java:278)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftSe
    rver.java:173)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.enablePlugins(Craf
    tServer.java:156)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.reload(CraftServer
    .java:410)
    18:23:44 [SEVERE]       at org.bukkit.Bukkit.reload(Bukkit.java:173)
    18:23:44 [SEVERE]       at org.bukkit.command.defaults.ReloadCommand.execute(Rel
    oadCommand.java:22)
    18:23:44 [SEVERE]       at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCo
    mmandMap.java:163)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.dispatchCommand(Cr
    aftServer.java:353)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.dispatchCommand(Cr
    aftServer.java:349)
    18:23:44 [SEVERE]       at net.minecraft.server.MinecraftServer.b(MinecraftServe
    r.java:499)
    18:23:44 [SEVERE]       at net.minecraft.server.MinecraftServer.h(MinecraftServe
    r.java:478)
    18:23:44 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftSer
    ver.java:374)
    18:23:44 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(Sour
    ceFile:417)
    18:23:44 [SEVERE] Error ensuring table PT_timelog exists with database 'minecraf
    t'... do you need to create the database?
    18:23:44 [SEVERE] java.sql.SQLException: [SQLITE_ERROR] SQL error or missing dat
    abase (near "?": syntax error)
    18:23:44 [SEVERE]       at org.sqlite.DB.newSQLException(DB.java:383)
    18:23:44 [SEVERE]       at org.sqlite.DB.newSQLException(DB.java:387)
    18:23:44 [SEVERE]       at org.sqlite.DB.throwex(DB.java:374)
    18:23:44 [SEVERE]       at org.sqlite.NativeDB.prepare(Native Method)
    18:23:44 [SEVERE]       at org.sqlite.DB.prepare(DB.java:123)
    18:23:44 [SEVERE]       at org.sqlite.PrepStmt.<init>(PrepStmt.java:42)
    18:23:44 [SEVERE]       at org.sqlite.Conn.prepareStatement(Conn.java:404)
    18:23:44 [SEVERE]       at org.sqlite.Conn.prepareStatement(Conn.java:399)
    18:23:44 [SEVERE]       at org.sqlite.Conn.prepareStatement(Conn.java:383)
    18:23:44 [SEVERE]       at moc.MOCDBLib.DBConnector.checkTable(DBConnector.java:
    206)
    18:23:44 [SEVERE]       at moc.MOCDBLib.DBConnector.ensureTable(DBConnector.java
    :248)
    18:23:44 [SEVERE]       at moc.PlaytimeTracker.PlaytimeTracker.onEnable(Playtime
    Tracker.java:78)
    18:23:44 [SEVERE]       at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlug
    in.java:126)
    18:23:44 [SEVERE]       at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(
    JavaPluginLoader.java:920)
    18:23:44 [SEVERE]       at org.bukkit.plugin.SimplePluginManager.enablePlugin(Si
    mplePluginManager.java:278)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftSe
    rver.java:173)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.enablePlugins(Craf
    tServer.java:156)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.reload(CraftServer
    .java:410)
    18:23:44 [SEVERE]       at org.bukkit.Bukkit.reload(Bukkit.java:173)
    18:23:44 [SEVERE]       at org.bukkit.command.defaults.ReloadCommand.execute(Rel
    oadCommand.java:22)
    18:23:44 [SEVERE]       at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCo
    mmandMap.java:163)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.dispatchCommand(Cr
    aftServer.java:353)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.dispatchCommand(Cr
    aftServer.java:349)
    18:23:44 [SEVERE]       at net.minecraft.server.MinecraftServer.b(MinecraftServe
    r.java:499)
    18:23:44 [SEVERE]       at net.minecraft.server.MinecraftServer.h(MinecraftServe
    r.java:478)
    18:23:44 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftSer
    ver.java:374)
    18:23:44 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(Sour
    ceFile:417)
    18:23:44 [INFO] [PlaytimeTracker]  Creating table PT_playerworldstats: CREATE TA
    BLE PT_playerworldstats ( player varchar(50) NOT NULL,world varchar(50) NOT NULL
    ,PRIMARY KEY(player,world),died integer     DEFAULT 0,pk integer       DEFAULT 0
    ,hk integer       DEFAULT 0,fk integer       DEFAULT 0,bplace integer   DEFAULT
    0,bdestroy integer DEFAULT 0,moved double     DEFAULT 0.0);
    18:23:44 [SEVERE] java.sql.SQLException: near "died": syntax error
    18:23:44 [SEVERE]       at org.sqlite.NativeDB.throwex(NativeDB.java:210)
    18:23:44 [SEVERE]       at org.sqlite.NativeDB._exec(Native Method)
    18:23:44 [SEVERE]       at org.sqlite.Stmt.executeUpdate(Stmt.java:152)
    18:23:44 [SEVERE]       at moc.MOCDBLib.DBConnector._iudSafeQuery(DBConnector.ja
    va:143)
    18:23:44 [SEVERE]       at moc.MOCDBLib.DBConnector.updateSafeQuery(DBConnector.
    java:133)
    18:23:44 [SEVERE]       at moc.MOCDBLib.DBConnector.ensureTable(DBConnector.java
    :252)
    18:23:44 [SEVERE]       at moc.PlaytimeTracker.PlaytimeTracker.onEnable(Playtime
    Tracker.java:78)
    18:23:44 [SEVERE]       at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlug
    in.java:126)
    18:23:44 [SEVERE]       at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(
    JavaPluginLoader.java:920)
    18:23:44 [SEVERE]       at org.bukkit.plugin.SimplePluginManager.enablePlugin(Si
    mplePluginManager.java:278)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftSe
    rver.java:173)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.enablePlugins(Craf
    tServer.java:156)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.reload(CraftServer
    .java:410)
    18:23:44 [SEVERE]       at org.bukkit.Bukkit.reload(Bukkit.java:173)
    18:23:44 [SEVERE]       at org.bukkit.command.defaults.ReloadCommand.execute(Rel
    oadCommand.java:22)
    18:23:44 [SEVERE]       at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCo
    mmandMap.java:163)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.dispatchCommand(Cr
    aftServer.java:353)
    18:23:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.dispatchCommand(Cr
    aftServer.java:349)
    18:23:44 [SEVERE]       at net.minecraft.server.MinecraftServer.b(MinecraftServe
    r.java:499)
    18:23:44 [SEVERE]       at net.minecraft.server.MinecraftServer.h(MinecraftServe
    r.java:478)
    18:23:44 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftSer
    ver.java:374)
    18:23:44 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(Sour
    ceFile:417)
    18:23:44 [SEVERE] Error ensuring table PT_playerworldstats exists with database
    'minecraft'... do you need to create the database?
    The databse does exist, it was automatically created (minecraft.db). The first few lines even say it was opened succesfully.

    I'm also getting "Could not pass event PLAYER_MOVE" but I'm guessing that's just a folow on from the original error.
     
  28. Offline

    cwingrav


    Ok, fixed it. It was a bug in the db lib I was using and the SQL was MySQL specific. Both fixed. You will have to update the MOCDBLib.

    I also implemented the top X feature. I'll be pushing this out tonight in an update after I test it a bit more. Just letting you know an ETA.
     
  29. Offline

    DQuaN

    Awesome! Great work. :)
     
  30. Offline

    rskelhorn

    just installed it on our very active server. I will update soon
     

Share This Page