[INACTIVE] SQLite and MySQL Tutorial/Library

Discussion in 'Resources' started by alta189, May 12, 2011.

  1. Online

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    This is my onEnable:
    Code:
    public void onEnable() {
            if (!Settings.exists()) {
                makeSettings(Settings);
            }
            PluginManager pm = getServer().getPluginManager();
            pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Priority.Normal, this);
            pm.registerEvent(Event.Type.BLOCK_PLACE, blockListener, Priority.Normal, this);
            pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Priority.Normal, this);
            pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.Normal, this);
            loadSettings();
            if(useSql.equalsIgnoreCase("true")){
                dbManager = new sqlCore(this.log, this.logPrefix, "skillz", "plugins/Skillz");
                dbManager.initialize();
                if (!dbManager.checkTable("skillz")) {
                    String query = "CREATE  TABLE skillz (  'id' INTEGER PRIMARY KEY,  'player' VARCHAR(80) NOT NULL ,  " +
                            "'skill' TEXT NOT NULL ,  'xp' TEXT NOT NULL ,  'level' TEXT NOT NULL);";
                    dbManager.createTable(query);
                }
            }
            
            new File(maindir).mkdir();
            new File(maindir+"users/").mkdir();
            new File(maindir+"Skillz/").mkdir();
            File dir = new File(maindir+ "Skillz/");
            File filename[] = dir.listFiles();        
            for (File f : filename){
                String fn = f.getName();
                log.info("Loaded file " + fn);
            }
            
            
            log.info("Skillz Enabled!");
        }
    And this is the error:
    Code:
    146 recipes
    16 achievements
    07:40:29 [INFO] Starting minecraft server version Beta 1.5_02
    07:40:29 [INFO] Loading properties
    07:40:29 [INFO] Starting Minecraft server on *:25564
    07:40:29 [WARNING] **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
    07:40:29 [WARNING] The server will make no attempt to authenticate usernames. Beware.
    07:40:29 [WARNING] While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect w
    ith any username they choose.
    07:40:29 [WARNING] To change this, set "online-mode" to "true" in the server.settings file.
    07:40:29 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-753-g34e310c-b803jnks (MC: 1.5_02)
    07:40:29 [INFO] Preparing level "world"
    07:40:29 [INFO] Preparing start region
    07:40:30 [INFO] Loaded Essentials build 2.2.5 maintained by Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo and ceulemans.
    07:40:30 [INFO] GroupManager - INFO - Scheduled Data Saving is set for every 10 minutes!
    07:40:30 [INFO] GroupManager version 1.0(alpha-5) is enabled!
    07:40:30 [INFO] Fake Permissions version 2.5.1 is enabled!
    07:40:30 [INFO] [FastObby] v2.0 enabled!
    07:40:30 [INFO] [iConomy] Logging is currently disabled.
    07:40:31 [INFO] [iConomy] v5.0 (Eruanna) loaded.
    07:40:31 [INFO] [iConomy] Developed by: [Nijikokun]
    07:40:31 [INFO] [iConomy] hooked into Permissions.
    07:40:31 [INFO] [Repair] enabled!
    07:40:31 [SEVERE] [Skillz] SQLite exception on initialize java.sql.SQLException: [SQLITE_CANTOPEN]  Unable to open the database file (out of
     memory)
    07:40:31 [SEVERE] [Skillz] SQLite exception on initialize java.sql.SQLException: [SQLITE_CANTOPEN]  Unable to open the database file (out of
     memory)
    07:40:31 [SEVERE] Error occurred while enabling Skillz v1.62 (Is it up to date?): null
    java.lang.NullPointerException
            at nl.lolmen.sqllitelib.DatabaseHandler.checkTable(DatabaseHandler.java:144)
            at nl.lolmen.sqllitelib.sqlCore.checkTable(sqlCore.java:82)
            at nl.lolmen.Skillz.Skillz.onEnable(Skillz.java:71)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:125)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:750)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:253)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:132)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:110)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:265)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    07:40:31 [INFO] [Sortal] version 3.4 is enabled!
    07:40:31 [INFO] Done (0.138s)! For help, type "help" or "?"
  2. Offline

    alta189

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Very odd indeed, send me the source in a zip so that I can test it :D
  3. Online

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Will do when I get home :p
  4. Online

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
  5. Online

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
  6. Offline

    alta189

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I just got home :D Will look at it soon.
  7. Online

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Yaay :p
  8. Offline

    flatd

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
  9. Online

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    lol, bringing it in was in the second video ;)
  10. Offline

    Adamki11s

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Hey Alta, it's finished :D
    What'd you think?
    [IMG]
    alta189 and Lolmewn like this.
  11. Online

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @alta189 Im testing if it works at school now :p
    EDIT: Nope, same error here.
  12. Offline

    alta189

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Ok, did a little testing, I am getting the same error. I am going to see what I can do to find it :D
  13. Online

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Anything found? I needz it so I can realease part 2 of Skillz =D
  14. Offline

    petteyg359

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    It's called SQLite, not SQL Lite. Making a tutorial is great, but it really helps to get the name right :)
  15. Offline

    alta189

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Calm down dude
  16. Offline

    alta189

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Absolutely Amazing :D
    Adamki11s likes this.
  17. Offline

    Adamki11s

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I feel like using that for my banner as well now I like it so much, I'd change the name obviously :p
  18. Offline

    alta189

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    lol :D
  19. Offline

    alta189

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I would suggest to wait till I upload the new version, which should be soon. Sorry I had alot of work to get done today, I am releasing the new Library soon, but alot has changed, sort of. Workin on a tutorial now to go with it :D
  20. Offline

    alta189

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I don't think that it should be in a jar... You need to included it. look at the second video or wait until the new tutorial is out.
  21. Offline

    Jayjay110

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    How can you store block information in the files? Does x,y,z sound legit? It seems kinda iffy to me
  22. Online

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @Jayjay110 X in one row, Y in one row, Z in one row. Make it Integers.
  23. Offline

    Jayjay110

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    is that the safest way to do it? Isnt there a better way :(
  24. Online

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    You can also saved it all with a comma between in a text field, thatonly takes up one space
  25. Offline

    Jayjay110

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    EDIT:
    Nvm I figured I save the block data, then get it on loading the plugin
  26. Offline

    alta189

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Sure you have to say each piece of data in a column. Also @Lolmewn the new version is going to come out today :D with MySQL support. Also it should fix a lot of errors, but before I release it I want finish the tutorial :D
  27. Online

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    pre-release for me? :p I need it to finish my stuffz
  28. Offline

    Jayjay110

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    WOOOT :D
  29. Offline

    alta189

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Will be out in about 5 hours.
  30. Offline

    Jayjay110

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    WOOOT WOOOT :cool:

Share This Page