[INACTIVE][DEV] Persistence v0.76 - Data-Driven Bukkit [677]

Discussion in 'Inactive/Unsupported Plugins' started by NathanWolf, Jan 29, 2011.

  1. Offline

    NathanWolf

    Persistence - Data-Driven Bukkit

    PLEASE NOTE
    Persistence is a developer API and framework- NOT a game or admin plugin.

    If you've come here looking for plugin/admin support for Spells, Wand, NetherGate or any other plugin that uses Persistence- please turn around and go back to that thread. Thank you for your cooperation!

    If you're a dev, then check the Persistence wiki for information on using the Persistence framework.

    View changelog on github
     
    Duccis likes this.
  2. Offline

    NathanWolf

    If you're not using the persistence command dispatch, then none of these permission issues should really affect you, at least in theory.

    I've grabbed @mudzereli's zip file, I'll run that just as soon as I get a chance (work will not leave me alone, I'm supposed to be off this week! :()
    [MERGETIME="1299589221"][/MERGETIME]
    That is perfect, thank you for putting this together. I'll try it out today, and see if I can finally reproduce this issue- I'd really love to get it killed! :(

    UPDATE: Ok, this seems to be exactly what I needed. I ran it clean, it started up clean, but I got that NPE on player login.

    Now, I just need to figure out how to debug using this CB :)

    I debug using latest code, which really should be right around 492, a bit higher at this point I guess. So I really don't think it's the CB version- I doubt this could be related to anything in CB, anyway, it's all my code.

    I'm going to start by completely wiping my CB test folder, instead of just the plugins folder. I'll see if that gets this to happen- maybe it's because I'm in ops.txt? I dunno... shouldn't matter...

    Anyway, thanks again @mudzereli- this is the first real progress I've made here in a while :p
    [MERGETIME="1299589787"][/MERGETIME]
    Persisence 0.57 Released

    I think I fixed the player login NPE- please update!
    [MERGETIME="1299590023"][/MERGETIME]
    @mudzereli- it was your zip that did it, and it was a problem with a player not having data yet- as well as a plugin load order problem (NetherGate, at least, would have created the player data if it didn't exist yet, I think), so it only happened with Persistence by itself, or maybe with just Spells.

    Anyway- I'm hoping it's fixed now. I really apologize for all this, everyone- this permissions thing I added, I tried to make it really flexible (you can actually run any number of permission managers at once, in theory, to support Permissions backwards compatibility, but also let you move forward...)

    Anyway, it also created way too many code paths for things like this- I fixed the symptom here, but a bit of refactoring is probably needed to make sure it's harder for things like this to happen.

    Thanks for all your patience, and support, in finding this bug- I hope it's the last one for a bit. I'd like to get the internal permissions fixed, but I don't want to move on until I know I have a stable version released.
     
    Last edited by a moderator: Dec 15, 2016
  3. Offline

    mudzereli

    Excellent! I've tested persistence, no NPE on PLAYER_JOIN now. I'm able to load it along with spells, wand, and permissions support with no issues whatsoever on a brand new config. Looks like you've got it all sorted out. Thanks!
     
  4. Offline

    NathanWolf

    Thank gawd :)

    Thanks again for your help- I'm assuming I could've put together the right combination of plugins and missing data to make this happen on my own, but for some reason it just wasn't "working".
     
  5. Offline

    mudzereli

    No worries. Just glad to have it up and running. Thanks for an awesome set of plugins! :)
     
  6. Offline

    Triggjo2

    Is this the most recent version? If not could someone send me a link to the most recent version cause it won't work with bukkit i just updated to the most recent build (im pretty sure it was the most recent one) and now it won't work at all im try to use spells and wand but they won't work without persistence and btw im getting the casual failure error.
     
  7. Offline

    acegiak

    hahaha, just as I switched to doing my own sqlite system you get it working. Murphy's Law.
     
  8. Offline

    NathanWolf

    Patience is a virtue :)

    You could have always just grabbed an old version, too- but if you want to use sqlite/jdbc directly, go ahead- that's really a different course of action (with its plusses and minuses) from using an object persistence engine.
    [MERGETIME="1299684114"][/MERGETIME]
    0.57 is the most recent, are you getting errors?

    Spells and NetherGate both require Permissions at the moment, if it's "not working", it's probably because you don't have permissions to do anything.
     
  9. Offline

    Wulfspider

    @NathanWolf , not getting any error with 0.57.

    I was going to try again with 0.56 and no other plugins, but couldn't find the link for it.
    Edit: Found the link, going to try 0.56 just for kicks right now.
    Edit 2: Weird, 0.56 isn't breaking anymore with 0.56 with or without all my plugins. Maybe it was having issues with GroupManager which I updated today.
     
  10. Offline

    NathanWolf

    Oops, sorry- 0.57 is the most recent version. Basically, whatever I link to is what you should be using, unless it's known to be broken (should not be anymore).

    I updated my previous post to avoid confusion, so you're not crazy- I did say 0.56 originally :) I just glanced at the topic title, and apparently I forgot to update that- doing that now.
     
  11. Offline

    Triggjo2

    Really? I use EssentialsGroupManager could you allow them to work on that as well as Permissions?
     
  12. Offline

    NathanWolf

    Permissions.jar is all I'm going to support, in terms of permissions handlers. I was under the impression that GM and all the rest still used nij's handler, is that not true?

    [MERGETIME="1299707587"][/MERGETIME]
    And speaking of permissions, v0.58 has working, tested, internal permissions.

    Persistence's "internal" permissions system is an attempt (by me) to mimik bukkit's internal permissions. See this leaky page for how you would set up your plugin to use this.

    On the plugin dev side, you have to add all your permission nodes to config.yml- you can take a look at NetherGate's config.yml to see how this is done. It's pretty straightforward, but it's a good bit of frustrating YML work if you have a lot of commands/permission nodes.

    On the admin side, you set up permission profiles- here is a very simple example using NetherGate.

    The "default" profile will get applied to all players, and can be used to avoid/ignore the user/group management system. I can tell you, more or less for certain, that my user/group manager is not what the internal bukkit one will look like- so feel free to ignore it.

    Otherwise, the "grant" and "deny" commands can be used to assign permission profiles (by name) to players and groups.
     
  13. Offline

    Triggjo2

    Where to find a download for .58?
     
  14. Offline

    NathanWolf

    Old downloads are always available here, however I don't think you want 0.58 - 0.59 was a bugfix on top of that.

    Unless you've got a really good reason, you should always just grab the latest from the OP (Persistence.jar).
    [MERGETIME="1299718069"][/MERGETIME]
    Hey, I just updated my response to your Permissions question above- are you finding that my plugins don't work with Essentials GM?
     
  15. Offline

    Triggjo2

    Yes they don't work with Essentials GM fact with the both i believe that, that is the cause of my server crashing.
     
  16. Offline

    NathanWolf

    Does Essentials use Permissions.jar as its permissions handler, still?
    [MERGETIME="1299730524"][/MERGETIME]
    0.60 Released

    This is mainly a maintenance release for Spells 0.991, but I feel it's worth mentioning.

    A little background, in case you don't know what I'm doing here, exactly. The "internal permissions" system in Persistence right now is a light user/group manager slapped on top of bukkit permissions.

    I basically stole the bukkit permissions code (I had consent), and integrated it into the Persistence plugin.

    Up until now, that was it, just integration- but in 0.60 I've actually modified this code to behave a bit differently.

    I've made the "list" type more useful, in my opinion. Here is an example from Spells:

    config.yml:
    Code:
    permissions:
      Spells:
        description: Spells permissions
        type: map
        map:
          commands:
           ... [Spells console commands here]
          cast:
            description: The spells a player may cast
            type: list
    And then, when used in a profile:
    Code:
    # Defines the "default" profile
    # All players have this profile by default
    default:
      Spells:
        commands:
          spells: true
        cast:
          - heal
          - blink
          - torch
    I don't think this is at all what Dinnerbone intended, but so far I haven't found a better way to do what I want to do in Spells, and I imagine it's a common scenario- I'm really just talking about dynamic permission lists, and the ability to use them with pnodes just like an "official" hard-coded YML-defined permission. If there is a better way to do it, and I can pull my changes to the bukkit permissions code back out, I will.
     
  17. Offline

    Dominic

    Hey Nathan! First off I'd like to say that I appreciate your work and I thank you for it! But I was hopeing you could help me with an issue. I've updated to CB 522 and using your latest version of persistance and I keep getting the following error:
    Code:
    12:46:34 [INFO] Starting minecraft server version Beta 1.3
    12:46:34 [INFO] Loading properties
    12:46:34 [INFO] Starting Minecraft server on 10.0.1.2:25567
    12:46:34 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-522-
    g6c4ace1-b532jnks (MC: 1.3)
    12:46:34 [INFO] Preparing level "worldPRIVATE"
    12:46:34 [INFO] Preparing start region
    12:46:36 [INFO] Preparing spawn area: 40%
    12:46:37 [INFO] Preparing spawn area: 89%
    12:46:37 [INFO] [Permissions] version [2.5.4] (Phoenix) was Initialized.
    12:46:38 [INFO] Big Catch version 0.3_1 is enabled!
    12:46:38 [INFO] [ColorMe] v1.0 has been enabled.
    12:46:38 [INFO] CommandBook 1.0 enabled.
    12:46:38 [INFO] CommandBook: Permissions plugin detected! Using Permissions plug
    in for permissions.
    12:46:38 [INFO] FakeMessage version 0.3 is enabled!
    12:46:39 [INFO] [MYHOME]: 7 homes loaded
    12:46:39 [INFO] [MYHOME] Permissions enabled using: Permissions v2.5.4
    12:46:39 [WARNING] [MYHOME] 'Help' isn't detected. No /help support.
    12:46:39 [INFO] [MYHOME] MyHome 1.9.3 enabled
    12:46:41 [INFO] Preparing spawn area for nether, 73%
    12:46:42 [INFO] NetherGate version 0.53 is enabled
    12:46:42 [INFO] [Permissions] version [2.5.4] (Phoenix)  loaded
    12:46:42 [INFO] CommandBook: Permissions plugin detected! Using Permissions plug
    in for permissions.
    12:46:42 [INFO] PermissionsSupport: Found Permissions, using it for permissions.
    12:46:42 [INFO] PermissionsSupport version 0.1 is enabled
    12:46:42 [INFO] Persistence version 0.61 is enabled
    12:46:42 [INFO] [SpawnMob] Permissions enabled.
    12:46:42 [INFO] [SpawnMob] Version 1.7 enabled.
    12:46:42 [INFO] WorldEdit 4.0-beta8 enabled.
    12:46:42 [INFO] WorldEdit: Permissions plugin detected! Using Permissions plugin
    for permissions.
    12:46:42 [INFO] Done (0.767s)! For help, type "help" or "?"
    12:47:29 [INFO] 143 recipes
    12:47:29 [INFO] Dominic92x [/70.57.209.211:53404] logged in with entity id 201
    12:47:29 [SEVERE] Could not pass event PLAYER_JOIN to Persistence
    java.lang.NullPointerException
            at com.elmakers.mine.craftbukkit.permission.PermissionProfile.loadProfil
    es(PermissionProfile.java:112)
            at com.elmakers.mine.craftbukkit.permission.PermissionProfile.loadProfil
    es(PermissionProfile.java:132)
            at com.elmakers.mine.bukkit.permission.GroupManager.loadProfiles(GroupMa
    nager.java:331)
            at com.elmakers.mine.bukkit.permission.GroupManager.initializePermission
    s(GroupManager.java:91)
            at com.elmakers.mine.bukkit.plugins.persistence.PersistenceListener.onPl
    ayerJoin(PersistenceListener.java:21)
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:162)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:255)
            at net.minecraft.server.ServerConfigurationManager.a(ServerConfiguration
    Manager.java:98)
            at net.minecraft.server.NetLoginHandler.b(NetLoginHandler.java:87)
            at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:27)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:87)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    >
    
    I've read through the forum but it looks like V.56 was supposed to fix this issue? Maybe I'm doing something wrong? I'm not sure it's an issue with Persistance specifically because Permissions seems to have some control...

    Thank you for your time,
    Dominic
     
  18. Offline

    NathanWolf

    Hm- yes, it is supposed to fix that very issue- and I see you're running 0.61, so I'm not sure why you're still seeing that :(

    Can you trying removing your db files (at least global.db- back it up before deleting, or just move it to another folder) and see if that resolves the problem?
     
  19. Offline

    Dominic

    Sure thing! I will get back to you ASAP as soon as I get results

    EDIT: That seemed to do it! Thank you!
     
  20. Offline

    mythmon

    I am having trouble writing a plugin that uses Persistence. I wrote a DAO, and when I try and access it, I get an error "Class does not have the @PersistClass annotation". The class that I think it is referencing does have the annotation, so I am not sure what is going on.. You can look at my code on github.

    Stacktrace (open)

    Code:
    19:57:28 [SEVERE] com.elmakers.mine.bukkit.persistence.exception.InvalidPersistedClassException: Class does not have the @PersistClass annotation
    
    19:57:28 [SEVERE]       at com.elmakers.mine.craftbukkit.persistence.Persistence.getPersistedClass(Persistence.java:359)
    19:57:28 [SEVERE]       at com.elmakers.mine.craftbukkit.persistence.core.PersistedObject.bind(PersistedObject.java:62)
    19:57:28 [SEVERE]       at com.elmakers.mine.craftbukkit.persistence.core.PersistedClass.bindReferences(PersistedClass.java:255)
    19:57:28 [SEVERE]       at com.elmakers.mine.craftbukkit.persistence.Persistence.createPersistedClass(Persistence.java:393)
    19:57:28 [SEVERE]       at com.elmakers.mine.craftbukkit.persistence.Persistence.getPersistedClass(Persistence.java:434)
    19:57:28 [SEVERE]       at com.elmakers.mine.craftbukkit.persistence.Persistence.getPersistedClass(Persistence.java:362)
    19:57:28 [SEVERE]       at com.elmakers.mine.craftbukkit.persistence.Persistence.get(Persistence.java:201)
    19:57:28 [SEVERE]       at com.electricgrey.mine.bukkit.linked.LinkedBlockListener.onBlockInteract(LinkedBlockListener.java:58)
    19:57:28 [SEVERE]       at org.bukkit.plugin.java.JavaPluginLoader$23.execute(JavaPluginLoader.java:237)
    19:57:28 [SEVERE]       at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    19:57:28 [SEVERE]       at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:225)
    19:57:28 [SEVERE]       at net.minecraft.server.BlockChest.a(BlockChest.java:127)
    19:57:28 [SEVERE]       at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:160)
    19:57:28 [SEVERE]       at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:482)
    19:57:28 [SEVERE]       at net.minecraft.server.Packet15Place.a(SourceFile:57)
    19:57:28 [SEVERE]       at net.minecraft.server.NetworkManager.a(SourceFile:230)
    19:57:28 [SEVERE]       at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    19:57:28 [SEVERE]       at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    19:57:28 [SEVERE]       at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
    19:57:28 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    19:57:28 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    19:57:28 [SEVERE] Persistence: Reference field: null has no valid reference type
    19:57:28 [WARNING] Persistence: Empty DataRow name
    19:57:28 [SEVERE] Peristence: error creating table: [SQLITE_ERROR] SQL error or missing database (near ")": syntax error)
    19:57:28 [INFO] CREATE TABLE "ChestName" ("groupName" TEXT, PRIMARY KEY ())
    19:57:28 [WARNING] Persistence: Error selecting from table ChestName: [SQLITE_ERROR] SQL error or missing database (no such table: ChestName)
     
  21. Offline

    NathanWolf

    I apologize for the crappy error message there! I thought the new exception would show things like this better- I'll repro this and try make the error better.

    In this case, here is your issue:

    Code:
     @PersistField(id=true)
        public Block getId() {
            return id;
        }
    You can't directly persist references to Bukkit entities like Player and Block- because Bukkit manages these.

    I have, however, created some classes for this. Unfortunately, BlockData is currently part of Gameplay, not core Persistence.

    Fortunately, as soon as I'm done getting through forum posts, my goal today is to re-integrate Gameplay and Persistence. The split was not necessary- nor was the CB/Bukkit interface split, which I'll be reverting.

    After this, you'll have access to a few new global DAO's, including MaterialData and BlockData. You can use a BlockData to persist a reference to a block.

    In the meantime- I'd recommend using BlockVector and WorldData references - since thats what you need to uniquely identify a block. I am hoping to get that new Persistence up today, though, if you can wait :D
    [MERGETIME="1299946967"][/MERGETIME]
    Oh, or you could get started with the Gameplay library, which has BlockData in it- your code should carry over transparently when I update (you would just drop the reference to Gameplay and delete the jar).
    [MERGETIME="1299954152"][/MERGETIME]
    A Quick Word

    Ok, probably not quick- you know me better by now.

    So, I'm working on Persistence 0.75 right now- another version jump means another refactor.

    I have a few goals with this one, and mainly it involves undoing the last refactor. The Persistence plugin is going to be split up into several libraries: Persistence, Gameplay and Groups.

    However, instead of offering Groups and Gameplay separately (and hoping for Persistence integration in Bukkit), I'm going to reference all 3 libraries in the Persistence plugin, and just have you use that.

    What this means, technically, is that Gameplay functionality will be re-integrated into the Persistence plugin and Gameplay will be killed as a separate project.

    What it means, politically, is that I've (at least in the near-term) given up on Persistence becoming bukkit.persistence. I'm certainly willing to assist in that process, but the last fork I made for them (this was the second time I submitted persistence for integration) was at 0.50, and I'm really just tired of waiting and tired of making new forks.

    So, we'll see what happens, but at this point I can't really make any claims at all that Persistence will be THE bukkit persistence engine- I really wouldn't count on it, honestly, I haven't gotten the impression it's really what they want, now that they're actually code reviewing it.

    I'll continue to use Persistence as a plugin, perhaps long after there is a bukkit.persistence- all of my plugins are far too integrated at this point for it to be worthwhile for me to transition.

    This is also part of my motivation with this refactor- Persistence, the plugin, is no longer just a persistence engine- it's a data-driven API and framework for Bukkit that I'll be using as a base to build all of my plugins.

    You're welcome to do the same, and if you're already using Persistence in your plugin and are happy with it, I encourage you to continue. You may, at some point, want to transition to bukkit's internal system- but that honestly may be quite a ways out at this point. I'll let you know if I hear otherwise, but lately I haven't had much time for bukkit team interaction.

    Thanks for your attention :)
     
  22. Offline

    amkeyte

    I'm on board with this for the foreseeable future. Once persistence stabilizes it's going to be really easy to work with as a data platform and the command handling and other perks are nice too. Besides, I've gotten in the habit of making my code decoupled from other work at this point. Even when bukkit comes out with internal data, I'll probably support both as a configurable option.
     
  23. Offline

    mythmon

    I changed to using BlockVector for the id on my class, and that worked well, thanks!

    Next however, I fear I have a more difficult problem. I am getting the same error on a different piece of code now. I am not sure how far you looked into my code last time, but I have another DAO, SharedInventory, that is trying to persist a inventory of objects. Before I started trying to integrate Persistence keeping a net.minecraft.server.InventoryLargeChest in memory worked great. But obviously that is a class that can't be persisted Directly.

    So I tried to write a DAO that represented a single ItemStack (which is basically a wrapper around org.bukkit.inventory.ItemStack). Then I had my SharedInventory class keep a LinkedList of this new DAO, and convert it to and from a InventoryLargeChest in the getter/setter methods. This... didn't work. I feel like I am trying to do this the hard way, and would appreciate if you could take a look at what I have so far and what I am doing wrong, or if there is a better way.

    Again, source code is on github.

    Thanks for the help, and thanks for writing Persistence! I tried doing it myself with sqlite, and I realized how hard it is to get good persistence.
     
  24. Offline

    NathanWolf

    Always a good way to go!

    If it's compatible, I would also do this as a core Persistence feature- I did originally promise to do that (something along the lines of "make Persistence a thin interface on top of bukkit.persistence if it does not become the core engine"....)

    I'm just worried that it won't end up being compatible "enough" for this- we'll see! :)
    [MERGETIME="1299956703"][/MERGETIME]
    Cool! Love making progress :)

    This is a good way to go! If you look at Gameplay (or Persistence 0.75, when I get it together) you'll see a MaterialData - this could be used for what you want, though I plan to make an ItemData as well. They're basically the same thing to Bukkit, but I'd like to separate them at the data level, since it makes sense for them to be different concepts.

    Anyway, until I can figure out how to do that cleanly, I'm going to be using MaterialData to represent items. You could even use the "data" portion to persist damage to items (I think), since right now (by hack or not, I really am not sure) material data and item damage are the same thing.

    Anyway, I have not yet tried, but it is certainly my intention to persist a list of those. An ItemStack could then be a contained MaterialData, a count, and maybe a slot#- which could then persist.

    Anyway, you don't need MaterialData to do this- in fact you can persist Material directly (any enum is persistable). Let me take a look at your code :)

    Thanks! Glad you like it- I really just needed it for myself, and I like to share. I hope I don't take too much license when I refactor and such, it can be a pain for you to follow my changes... but I try to be good about it. 0.75 will be a big change, though.
    [MERGETIME="1299957202"][/MERGETIME]
    Ahhh, ok- I see the problem. I like what you're trying to do, but I don't think it will work :)

    Take a look at LocationData, if you like- it's a bit complex, but if you ignore all of the "helper" functions it's actually a pretty simple example of what you want to do.

    The idea is not to extend from ItemStack, but to contain or "wrap" an ItemStack. You maintain an internal "transient" reference to an ItemStack within your DAO, and provide an accessor for it.

    You would then "mirror" any data you want to persist from ItemStack (this is a little unfortunate, but I think the best way). This includes the item type (Material), damage (if you like), inventory slot# (probably the easiest way to do this) and count.

    So you would persist your "mirrored" data instead of persisting ItemStack directly.

    You then have two constructors - one default one, that Persistence will use- and one that takes an ItemStack, which you will use to create new ItemStackDAO objects. This second constructor would initialize all of the ItemStackDAO fields from the passed-in ItemStack, and store a transient reference to it.

    Now, this is where things get tricky. In the accessor for your transient ItemStack, you'll need to do an if(null) check- because when this object is loaded by Persistence, it won't have its ItemStack anymore (it's transient).

    So, you have to create one on-demand, the first time someone requests it.

    Unfortunately, to do this is where it gets tricky- you probably need a reference to an Inventory or at least a Server in order to create an ItemStack (maybe not). If this gets too messy, the easiest way (since you're your own client in this case!) is to just modify the "accessor" to take whatever it needs (and this is where amkeyte and I started having issues naming these things, it's questionable whether you'd call this an accessor or not...)

    public ItemStack getItemStack(Inventory inventory)

    So, you may call it "createItemStack" instead, etc. Again, you're your own client so you're kind of a bit freer in terms of what the "API" is going to look like ;)

    The idea, ultimately, is to extend the Persisted base class, which would have a reference to the Server containing this object- which you could use. You can see how this is done in LocationData, but @amkeyte has actually pointed out that it's flawed :)

    I'm going to fix that up as part of the 0.75 refactor, at which point it will work better- but the idea will still be to use the Persisted base class to get at references to Server (or its Persistence instance) for things like this.

    Hope that makes sense! You're really got the right idea, I hope I can help you make some good progress here.
    [MERGETIME="1299960481"][/MERGETIME]
    More Refactor Stuff

    Ok, here's where I'm at so far. I still need to put everything back together again, and this may change more, but I'm starting to like the way the design (at least) is coming together enough that I wanted to diagram it :)
    [​IMG]
    [MERGETIME="1299966586"][/MERGETIME]
    UPDATE: Still working on the design before going back to coding (hoping to get more time for this in the next couple of days....)

    In other news, I'm going to be moving most of the OP to a wiki, probably bukkit's wiki, soon. This diagram will definitely be part of that new documentation.

    Most importantly in this update I've moved the SQLite support to its own plugin. This will "force me" to finally get around to completely abstracting the data store providers, and making it super easy to drop in support for other DBs down the road. Also, I'm sick of updating 3MB Persistence.jar's, and hopefully SQLitePlugin.jar won't have to change once it's made.
    [MERGETIME="1299967630"][/MERGETIME]
    update2: I really want to do something about that Persistence<->DAO thing, but I'm not quite sure what the best way is to split that up. I wish my daughter would nap :(
    [MERGETIME="1299977137"][/MERGETIME]
    THARIFIXEDIT

    I think the Persistence/DAO split was unnecessary, hence the double arrow.
    [MERGETIME="1299983774"][/MERGETIME]
    Ok, the above diagram represents what I've got in the code at the moment, which is building but not yet functional. The fact that it's building, though, leads me to believe this is a pretty nice design- we'll see how much it changes before I release 0.70!
    [MERGETIME="1299983985"][/MERGETIME]
    One sexy thing about this design- "Data" has absolutely no dependencies, and "Persistence" doesn't depend on Bukkit at all. Most of these components don't depend on bukkit, in fact- it's really just a persistence engine now, with bukkit things layered on top and wrapped in a plugin.
     
  25. Offline

    zweigesicht

    could someone upload a plugins folder that has spells working properly? No matter what i try or where i look I can't get any of it to work. I don't feel like bothering with permissions or fixing the persistence bugs so could someone upload a folder with spells working? I'll be sure to back it up on a flash drive because im totally lost :D
     
  26. Offline

    NathanWolf

    I have a fully-functional CB with Spells/Wand and NetherGate set up (including permissions for Spells), here:

    www.elmakers.com/minecraft/elBukkit.zip

    You should be able to pick+choose what you want out of that, but I've tested it clean (just unzip+run), so it should all work together. Let me know if you have issues!

    Better documentation pages for my plugins are coming soon...
     
  27. Offline

    yoshasher

    I'm having roughly the same error as Dominic. I tried deleving both db files, no luck. Here's the log:

    Code:
     16:29:37 [INFO] Starting minecraft server version Beta 1.3
     16:29:37 [INFO] Loading properties
     16:29:37 [INFO] Starting Minecraft server on *:25565
     16:29:37 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-516-gdf87bb3-b531jnks (MC: 1.3)
     16:29:37 [INFO] Preparing level "world"
     16:29:37 [INFO] Preparing start region
     16:29:37 [INFO] ChatBukkit v0.0.1 is enabled!
     16:29:37 [INFO] CraftBookCommon 3.0-alpha1 enabled.
     16:29:37 [INFO] CraftBookCircuits 3.0-alpha1 enabled.
     16:29:37 [INFO] CraftBookMechanisms 3.0-alpha1 enabled.
     16:29:37 [INFO] CraftBookVehicles 3.0-alpha1 enabled.
     16:29:37 [INFO] [INFORMANT]version 1.6 is enabled
     16:29:37 [INFO] [INFORMANT]Loading Settings
     16:29:37 [INFO] [INFORMANT]Loading Previous Players
     16:29:39 [INFO] NetherGate version 0.53 is enabled
     16:29:39 [INFO] Persistence version 0.61 is enabled
     16:29:39 [INFO] ScrapBukkit version 0.2.1 is enabled!
     16:29:39 [INFO] Done (0.193s)! For help, type "help" or "?"
     16:29:41 [INFO] 143 recipes
     16:29:41 [INFO] yoshasher [/127.0.0.1:3797] logged in with entity id 55
     16:29:41 [SEVERE] Could not pass event PLAYER_JOIN to Persistence
    java.lang.NullPointerException
        at com.elmakers.mine.craftbukkit.permission.PermissionProfile.set(PermissionProfile.java:46)
        at com.elmakers.mine.craftbukkit.permission.PermissionProfile.loadNode(PermissionProfile.java:93)
        at com.elmakers.mine.craftbukkit.permission.PermissionProfile.loadNode(PermissionProfile.java:77)
        at com.elmakers.mine.craftbukkit.permission.PermissionProfile.loadNode(PermissionProfile.java:77)
        at com.elmakers.mine.craftbukkit.permission.PermissionProfile.loadNode(PermissionProfile.java:77)
        at com.elmakers.mine.craftbukkit.permission.PermissionProfile.loadNode(PermissionProfile.java:77)
        at com.elmakers.mine.craftbukkit.permission.PermissionProfile.loadProfile(PermissionProfile.java:103)
        at com.elmakers.mine.craftbukkit.permission.PermissionProfile.loadProfiles(PermissionProfile.java:116)
        at com.elmakers.mine.craftbukkit.permission.PermissionProfile.loadProfiles(PermissionProfile.java:132)
        at com.elmakers.mine.bukkit.permission.GroupManager.loadProfiles(GroupManager.java:331)
        at com.elmakers.mine.bukkit.permission.GroupManager.initializePermissions(GroupManager.java:91)
        at com.elmakers.mine.bukkit.plugins.persistence.PersistenceListener.onPlayerJoin(PersistenceListener.java:21)
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:162)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
        at net.minecraft.server.ServerConfigurationManager.a(ServerConfigurationManager.java:98)
        at net.minecraft.server.NetLoginHandler.b(NetLoginHandler.java:87)
        at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:27)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:87)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    
     
  28. Offline

    NathanWolf

    Hmmm... well, it's crappy that I'm throwing a raw NPE like that, for starters. Unfortunately, I'm right in the middle of a big code refactor, so I can't really cross-reference those line numbers.

    I can say that that is most likely some sort of parsing error with permissions.yml - do you get this error if you remove that file from "plugins/Persistence"?
     
  29. Offline

    yoshasher

    It's error free without it.

    I'll try it again after your refactor update.
     
  30. Offline

    NathanWolf

    Hm- well, that probably indicates a problem with the permissions.yml file- There should be a better error for it, though.

    If you want, you can use Permissions and PermissionsSupport.jar instead in the meantime.
    [MERGETIME="1300070768"][/MERGETIME]
    Got rid of the Gameplay library- it's now all in "Utilities".

    I've updated the javadocs for what 0.75 is going to look like- I'm hoping the code itself will be ready soon. If you want to get started early, I've made a new repo, so look here on github.

    I've got 0.75 up and running- I had to refactor NetherGate a little bit (mostly renaming some classpath includes), and it's now running under the new system.

    As soon as I get my other plugins updated, and everything seems like it's working well without any hacks, I'll publish an update. If you're using Persistence, you'll probably need to update your plugin at that point- hopefully I've given enough fair warning :)
     
  31. Offline

    Dev909

    Hey

    ummm all i want to do is to add spells and wands to my server, and i found out that i neede persistance. i got it downlaoded but have no clue on how to work it. can some one please give me a noob friendly version on how to set this up so i can use spells and wands? please?
     

Share This Page